Merge branch 'master' of git://github.com/diaspora/diaspora
This commit is contained in:
commit
84072305c5
15 changed files with 77 additions and 16 deletions
|
|
@ -28,4 +28,12 @@ class AdminsController < ApplicationController
|
||||||
flash[:notice] = "invitation sent to #{params[:identifier]}"
|
flash[:notice] = "invitation sent to #{params[:identifier]}"
|
||||||
redirect_to user_search_path
|
redirect_to user_search_path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def stats
|
||||||
|
@popular_tags = ActsAsTaggableOn::Tagging.joins(:tag).limit(15).count(:group => :tag, :order => 'count(taggings.id) DESC')
|
||||||
|
@most_liked_posts = Post.where(:type => ['StatusMessage', 'ActivityStreams::Photo'],
|
||||||
|
:public => true).order('likes_count DESC').limit(15).all
|
||||||
|
@new_posts = Post.where(:type => ['StatusMessage','ActivityStreams::Photo'],
|
||||||
|
:public => true).order('created_at DESC').limit(15).all
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ module NotificationsHelper
|
||||||
actors =people || note.actors
|
actors =people || note.actors
|
||||||
number_of_actors = actors.count
|
number_of_actors = actors.count
|
||||||
sentence_translations = {:two_words_connector => " #{t('notifications.index.and')} ", :last_word_connector => ", #{t('notifications.index.and')} " }
|
sentence_translations = {:two_words_connector => " #{t('notifications.index.and')} ", :last_word_connector => ", #{t('notifications.index.and')} " }
|
||||||
actor_links = actors.collect{ |person| link_to("#{h(person.name.titlecase.strip)}", person_path(person))}
|
actor_links = actors.collect{ |person| link_to("#{h(person.name.titlecase.strip)}", person_path(person), :class => ('hovercardable' if defined?(user_signed_in?) && user_signed_in? && current_user.person != person))}
|
||||||
|
|
||||||
if number_of_actors < 4
|
if number_of_actors < 4
|
||||||
message = actor_links.to_sentence(sentence_translations)
|
message = actor_links.to_sentence(sentence_translations)
|
||||||
|
|
|
||||||
|
|
@ -223,7 +223,7 @@ class Person < ActiveRecord::Base
|
||||||
json = {
|
json = {
|
||||||
:id => self.id,
|
:id => self.id,
|
||||||
:name => self.name,
|
:name => self.name,
|
||||||
:avatar => self.profile.image_url(:thumb_small),
|
:avatar => self.profile.image_url(:thumb_medium),
|
||||||
:handle => self.diaspora_handle,
|
:handle => self.diaspora_handle,
|
||||||
:url => "/people/#{self.id}",
|
:url => "/people/#{self.id}",
|
||||||
:hashtags => self.profile.tags.map{|t| "##{t.name}"}
|
:hashtags => self.profile.tags.map{|t| "##{t.name}"}
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ class StatusMessage < Post
|
||||||
if opts[:plain_text]
|
if opts[:plain_text]
|
||||||
person ? ERB::Util.h(person.name) : ERB::Util.h($~[1])
|
person ? ERB::Util.h(person.name) : ERB::Util.h($~[1])
|
||||||
else
|
else
|
||||||
person ? "<a href=\"/people/#{person.id}\" class=\"mention\">@#{ERB::Util.h(person.name)}</a>" : ERB::Util.h($~[1])
|
person ? "<a href=\"/people/#{person.id}\" class=\"mention hovercardable\">@#{ERB::Util.h(person.name)}</a>" : ERB::Util.h($~[1])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
form_message
|
form_message
|
||||||
|
|
@ -107,7 +107,7 @@ class StatusMessage < Post
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
|
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
|
<activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
|
||||||
</entry>
|
</entry>
|
||||||
XML
|
XML
|
||||||
end
|
end
|
||||||
|
|
||||||
def socket_to_user(user_or_id, opts={})
|
def socket_to_user(user_or_id, opts={})
|
||||||
|
|
|
||||||
19
app/views/admins/stats.html.haml
Normal file
19
app/views/admins/stats.html.haml
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
.span-24.last
|
||||||
|
%h3
|
||||||
|
= for tg in @popular_tags
|
||||||
|
= link_to tg, tags_path(tg)
|
||||||
|
|
||||||
|
%br
|
||||||
|
%br
|
||||||
|
|
||||||
|
.span-12
|
||||||
|
%h3
|
||||||
|
New public posts
|
||||||
|
.stream
|
||||||
|
= render 'shared/stream', :posts => @new_posts
|
||||||
|
|
||||||
|
.span-12.last
|
||||||
|
%h3
|
||||||
|
Most Liked
|
||||||
|
.stream
|
||||||
|
= render 'shared/stream', :posts => @most_liked_posts
|
||||||
|
|
@ -2,8 +2,6 @@
|
||||||
// licensed under the Affero General Public License version 3 or later. See
|
// licensed under the Affero General Public License version 3 or later. See
|
||||||
// the COPYRIGHT file.
|
// the COPYRIGHT file.
|
||||||
|
|
||||||
ContactEdit.updateNumber("<%= @contact.person_id%>");
|
|
||||||
|
|
||||||
var element = $(".add[data-aspect_id=<%= @aspect.id %>][data-person_id=<%= @contact.person_id%>]");
|
var element = $(".add[data-aspect_id=<%= @aspect.id %>][data-person_id=<%= @contact.person_id%>]");
|
||||||
|
|
||||||
if( $("#no_contacts").is(':visible') ) {
|
if( $("#no_contacts").is(':visible') ) {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
// licensed under the Affero General Public License version 3 or later. See
|
// licensed under the Affero General Public License version 3 or later. See
|
||||||
// the COPYRIGHT file.
|
// the COPYRIGHT file.
|
||||||
|
|
||||||
ContactEdit.updateNumber("<%= @contact.person_id%>");
|
|
||||||
var element = $(".added[data-aspect_id=<%= @aspect.id %>][data-person_id=<%= @contact.person_id%>]");
|
var element = $(".added[data-aspect_id=<%= @aspect.id %>][data-person_id=<%= @contact.person_id%>]");
|
||||||
element.parent().html("<%= escape_javascript(render('aspect_memberships/remove_from_aspect', :aspect => @aspect, :person => @contact.person, :contact => @contact)) %>");
|
element.parent().html("<%= escape_javascript(render('aspect_memberships/remove_from_aspect', :aspect => @aspect, :person => @contact.person, :contact => @contact)) %>");
|
||||||
element.fadeTo(200,1);
|
element.fadeTo(200,1);
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@
|
||||||
- content_for :head do
|
- content_for :head do
|
||||||
= include_javascripts :people
|
= include_javascripts :people
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#section_header
|
#section_header
|
||||||
%h2
|
%h2
|
||||||
= t('.title')
|
= t('.title')
|
||||||
|
|
@ -20,7 +22,13 @@
|
||||||
#people_stream.stream.contacts
|
#people_stream.stream.contacts
|
||||||
- if @aspect_
|
- if @aspect_
|
||||||
#aspect_controls
|
#aspect_controls
|
||||||
/= link_to t('.start_a_conversation'), new_conversation_path(:aspect_id => @aspect_.id, :name => @aspect_.name), :class => "button conversation_button", :rel => "facebox"
|
- suggested_limit = 16
|
||||||
|
- conv_opts = { :class => "button conversation_button", :rel => "facebox"}
|
||||||
|
- conv_opts[:title] = t('.many_people_are_you_sure', :suggested_limit => suggested_limit) if @contacts.size > suggested_limit
|
||||||
|
|
||||||
|
= link_to t('.start_a_conversation'), new_conversation_path(:aspect_id => @aspect_.id, :name => @aspect_.name), conv_opts
|
||||||
|
- if @contacts.size > suggested_limit
|
||||||
|
= javascript_tag "$('.conversation_button').tipsy({trigger: 'hover', gravity: 'n'});"
|
||||||
= link_to t('.edit_aspect', :name => @aspect_.name), edit_aspect_path(@aspect_), :rel => "facebox"
|
= link_to t('.edit_aspect', :name => @aspect_.name), edit_aspect_path(@aspect_), :rel => "facebox"
|
||||||
|
|
||||||
- if @contacts.size > 0
|
- if @contacts.size > 0
|
||||||
|
|
|
||||||
|
|
@ -214,6 +214,7 @@ en:
|
||||||
all_contacts: "All Contacts"
|
all_contacts: "All Contacts"
|
||||||
only_sharing_with_me: "Only sharing with me"
|
only_sharing_with_me: "Only sharing with me"
|
||||||
remove_person_from_aspect: "Remove %{person_name} from \"%{aspect_name}\""
|
remove_person_from_aspect: "Remove %{person_name} from \"%{aspect_name}\""
|
||||||
|
many_people_are_you_sure: "Are you sure you want to start a private conversation with more than %{suggested_limit} contacts? Posting to this aspect may be a better way to contact them."
|
||||||
|
|
||||||
conversations:
|
conversations:
|
||||||
index:
|
index:
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,7 @@ Diaspora::Application.routes.draw do
|
||||||
match 'user_search' => :user_search
|
match 'user_search' => :user_search
|
||||||
get 'admin_inviter' => :admin_inviter
|
get 'admin_inviter' => :admin_inviter
|
||||||
get 'add_invites' => :add_invites, :as => 'add_invites'
|
get 'add_invites' => :add_invites, :as => 'add_invites'
|
||||||
|
get 'stats' => :stats, :as => 'pod_stats'
|
||||||
end
|
end
|
||||||
|
|
||||||
resource :profile
|
resource :profile
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,6 @@ When /^I (add|remove|toggle) the person (to|from) my ([\d])(nd|rd|st|th) aspect$
|
||||||
steps %Q{
|
steps %Q{
|
||||||
And I press the first ".toggle.button"
|
And I press the first ".toggle.button"
|
||||||
And I press the #{aspect_number}#{nd} "li" within ".dropdown.active .dropdown_list"
|
And I press the #{aspect_number}#{nd} "li" within ".dropdown.active .dropdown_list"
|
||||||
And I wait for the ajax to finish
|
|
||||||
And I press the first ".toggle.button"
|
And I press the first ".toggle.button"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -3078,16 +3078,28 @@ ul.left_nav
|
||||||
:width 70px
|
:width 70px
|
||||||
:margin
|
:margin
|
||||||
:right 10px
|
:right 10px
|
||||||
|
:left 0
|
||||||
|
:top 0 !important
|
||||||
|
|
||||||
:background
|
:background
|
||||||
:color $background
|
:color $background
|
||||||
|
|
||||||
|
:height 70px
|
||||||
|
|
||||||
:padding 5px
|
:padding 5px
|
||||||
:bottom 55px
|
:bottom 25px
|
||||||
|
|
||||||
:border 1px solid #999
|
:border 1px solid #999
|
||||||
|
|
||||||
:width 240px
|
:width 240px
|
||||||
|
|
||||||
|
h4
|
||||||
|
:margin
|
||||||
|
:bottom 10px
|
||||||
|
a
|
||||||
|
:color $blue
|
||||||
|
:font
|
||||||
|
:weight bold !important
|
||||||
|
|
||||||
.hovercard_footer
|
.hovercard_footer
|
||||||
:position absolute
|
:position absolute
|
||||||
|
|
@ -3097,8 +3109,7 @@ ul.left_nav
|
||||||
:color #eee
|
:color #eee
|
||||||
:width 100%
|
:width 100%
|
||||||
|
|
||||||
:height 20px
|
:min-height 19px
|
||||||
:min-height 20px
|
|
||||||
|
|
||||||
:font
|
:font
|
||||||
:size smaller
|
:size smaller
|
||||||
|
|
@ -3107,7 +3118,7 @@ ul.left_nav
|
||||||
:top 1px solid #ccc
|
:top 1px solid #ccc
|
||||||
|
|
||||||
.footer_container
|
.footer_container
|
||||||
:padding 2px 5px
|
:padding 1px 5px
|
||||||
|
|
||||||
.hashtags
|
.hashtags
|
||||||
:overflow hidden
|
:overflow hidden
|
||||||
|
|
@ -3118,6 +3129,8 @@ ul.left_nav
|
||||||
:color #999
|
:color #999
|
||||||
:margin
|
:margin
|
||||||
:right 4px
|
:right 4px
|
||||||
|
:font
|
||||||
|
:weight normal
|
||||||
|
|
||||||
#hovercard_container
|
#hovercard_container
|
||||||
:padding 10px
|
:padding 10px
|
||||||
|
|
|
||||||
|
|
@ -122,16 +122,19 @@
|
||||||
|
|
||||||
ul
|
ul
|
||||||
@include user-select(none)
|
@include user-select(none)
|
||||||
|
:font
|
||||||
|
:size normal
|
||||||
|
|
||||||
:padding 0 !important
|
:padding 0 !important
|
||||||
:margin 0 !important
|
:margin 0 !important
|
||||||
:color #333
|
:color #000
|
||||||
|
|
||||||
> li
|
> li
|
||||||
:font-size 11px !important
|
:font-size 11px !important
|
||||||
:padding 3px 2px
|
:padding 3px 2px
|
||||||
:left 24px
|
:left 24px
|
||||||
:position relative
|
:position relative
|
||||||
|
:color #222
|
||||||
|
|
||||||
.check,
|
.check,
|
||||||
.checkWhite
|
.checkWhite
|
||||||
|
|
|
||||||
|
|
@ -116,4 +116,16 @@ describe AdminsController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe '#stats' do
|
||||||
|
before do
|
||||||
|
AppConfig[:admins] = [@user.username]
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'succeeds and renders stats' do
|
||||||
|
get :stats
|
||||||
|
response.should be_success
|
||||||
|
response.should render_template(:stats)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -87,8 +87,8 @@ STR
|
||||||
describe '#format_mentions' do
|
describe '#format_mentions' do
|
||||||
it 'adds the links in the formated message text' do
|
it 'adds the links in the formated message text' do
|
||||||
@sm.format_mentions(@sm.raw_message).should == <<-STR
|
@sm.format_mentions(@sm.raw_message).should == <<-STR
|
||||||
#{link_to('@' << @people[0].name, person_path(@people[0]), :class => 'mention')} can mention people like Raphael #{link_to('@' << @people[1].name, person_path(@people[1]), :class => 'mention')}
|
#{link_to('@' << @people[0].name, person_path(@people[0]), :class => 'mention hovercardable')} can mention people like Raphael #{link_to('@' << @people[1].name, person_path(@people[1]), :class => 'mention hovercardable')}
|
||||||
can mention people like Raphaellike Raphael #{link_to('@' << @people[2].name, person_path(@people[2]), :class => 'mention')} can mention people like Raph
|
can mention people like Raphaellike Raphael #{link_to('@' << @people[2].name, person_path(@people[2]), :class => 'mention hovercardable')} can mention people like Raph
|
||||||
STR
|
STR
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue