diff --git a/app/controllers/admins_controller.rb b/app/controllers/admins_controller.rb
index 1b7e858f8..bd2dc4d13 100644
--- a/app/controllers/admins_controller.rb
+++ b/app/controllers/admins_controller.rb
@@ -28,4 +28,12 @@ class AdminsController < ApplicationController
flash[:notice] = "invitation sent to #{params[:identifier]}"
redirect_to user_search_path
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
diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb
index 5c30f9ede..e15a1d6fd 100644
--- a/app/helpers/notifications_helper.rb
+++ b/app/helpers/notifications_helper.rb
@@ -56,7 +56,7 @@ module NotificationsHelper
actors =people || note.actors
number_of_actors = actors.count
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
message = actor_links.to_sentence(sentence_translations)
diff --git a/app/models/person.rb b/app/models/person.rb
index c56adb374..e67a5071f 100644
--- a/app/models/person.rb
+++ b/app/models/person.rb
@@ -223,7 +223,7 @@ class Person < ActiveRecord::Base
json = {
:id => self.id,
:name => self.name,
- :avatar => self.profile.image_url(:thumb_small),
+ :avatar => self.profile.image_url(:thumb_medium),
:handle => self.diaspora_handle,
:url => "/people/#{self.id}",
:hashtags => self.profile.tags.map{|t| "##{t.name}"}
diff --git a/app/models/status_message.rb b/app/models/status_message.rb
index 0c8e998b2..a5aed41b3 100644
--- a/app/models/status_message.rb
+++ b/app/models/status_message.rb
@@ -57,7 +57,7 @@ class StatusMessage < Post
if opts[:plain_text]
person ? ERB::Util.h(person.name) : ERB::Util.h($~[1])
else
- person ? "@#{ERB::Util.h(person.name)}" : ERB::Util.h($~[1])
+ person ? "@#{ERB::Util.h(person.name)}" : ERB::Util.h($~[1])
end
end
form_message
@@ -107,7 +107,7 @@ class StatusMessage < Post
http://activitystrea.ms/schema/1.0/post
http://activitystrea.ms/schema/1.0/note
- XML
+ XML
end
def socket_to_user(user_or_id, opts={})
diff --git a/app/views/admins/stats.html.haml b/app/views/admins/stats.html.haml
new file mode 100644
index 000000000..565e7cfdf
--- /dev/null
+++ b/app/views/admins/stats.html.haml
@@ -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
diff --git a/app/views/aspect_memberships/create.js.erb b/app/views/aspect_memberships/create.js.erb
index 2292d0ae6..28f41cb13 100644
--- a/app/views/aspect_memberships/create.js.erb
+++ b/app/views/aspect_memberships/create.js.erb
@@ -2,8 +2,6 @@
// licensed under the Affero General Public License version 3 or later. See
// the COPYRIGHT file.
-ContactEdit.updateNumber("<%= @contact.person_id%>");
-
var element = $(".add[data-aspect_id=<%= @aspect.id %>][data-person_id=<%= @contact.person_id%>]");
if( $("#no_contacts").is(':visible') ) {
diff --git a/app/views/aspect_memberships/destroy.js.erb b/app/views/aspect_memberships/destroy.js.erb
index 3c48c7229..e8a933719 100644
--- a/app/views/aspect_memberships/destroy.js.erb
+++ b/app/views/aspect_memberships/destroy.js.erb
@@ -2,7 +2,6 @@
// licensed under the Affero General Public License version 3 or later. See
// the COPYRIGHT file.
-ContactEdit.updateNumber("<%= @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.fadeTo(200,1);
diff --git a/app/views/contacts/index.html.haml b/app/views/contacts/index.html.haml
index 5c7714eb8..0a7d1a309 100644
--- a/app/views/contacts/index.html.haml
+++ b/app/views/contacts/index.html.haml
@@ -9,6 +9,8 @@
- content_for :head do
= include_javascripts :people
+
+
#section_header
%h2
= t('.title')
@@ -20,7 +22,13 @@
#people_stream.stream.contacts
- if @aspect_
#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"
- if @contacts.size > 0
diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml
index b8a609eb0..4bac06a5f 100644
--- a/config/locales/diaspora/en.yml
+++ b/config/locales/diaspora/en.yml
@@ -214,6 +214,7 @@ en:
all_contacts: "All Contacts"
only_sharing_with_me: "Only sharing with me"
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:
index:
diff --git a/config/routes.rb b/config/routes.rb
index e78d8b2ec..4cfdf5bcc 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -83,6 +83,7 @@ Diaspora::Application.routes.draw do
match 'user_search' => :user_search
get 'admin_inviter' => :admin_inviter
get 'add_invites' => :add_invites, :as => 'add_invites'
+ get 'stats' => :stats, :as => 'pod_stats'
end
resource :profile
diff --git a/features/step_definitions/user_steps.rb b/features/step_definitions/user_steps.rb
index 1bf2f0d6b..e7054bdc5 100644
--- a/features/step_definitions/user_steps.rb
+++ b/features/step_definitions/user_steps.rb
@@ -121,7 +121,6 @@ When /^I (add|remove|toggle) the person (to|from) my ([\d])(nd|rd|st|th) aspect$
steps %Q{
And I press the first ".toggle.button"
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"
}
end
diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass
index 5faf6cf0b..ccfdfee8b 100644
--- a/public/stylesheets/sass/application.sass
+++ b/public/stylesheets/sass/application.sass
@@ -3078,16 +3078,28 @@ ul.left_nav
:width 70px
:margin
:right 10px
+ :left 0
+ :top 0 !important
:background
:color $background
+ :height 70px
+
:padding 5px
- :bottom 55px
+ :bottom 25px
:border 1px solid #999
:width 240px
+
+ h4
+ :margin
+ :bottom 10px
+ a
+ :color $blue
+ :font
+ :weight bold !important
.hovercard_footer
:position absolute
@@ -3097,8 +3109,7 @@ ul.left_nav
:color #eee
:width 100%
- :height 20px
- :min-height 20px
+ :min-height 19px
:font
:size smaller
@@ -3107,7 +3118,7 @@ ul.left_nav
:top 1px solid #ccc
.footer_container
- :padding 2px 5px
+ :padding 1px 5px
.hashtags
:overflow hidden
@@ -3118,6 +3129,8 @@ ul.left_nav
:color #999
:margin
:right 4px
+ :font
+ :weight normal
#hovercard_container
:padding 10px
diff --git a/public/stylesheets/sass/ui.sass b/public/stylesheets/sass/ui.sass
index c811f7da6..a5b9eaaa1 100644
--- a/public/stylesheets/sass/ui.sass
+++ b/public/stylesheets/sass/ui.sass
@@ -122,16 +122,19 @@
ul
@include user-select(none)
+ :font
+ :size normal
:padding 0 !important
:margin 0 !important
- :color #333
+ :color #000
> li
:font-size 11px !important
:padding 3px 2px
:left 24px
:position relative
+ :color #222
.check,
.checkWhite
diff --git a/spec/controllers/admins_controller_spec.rb b/spec/controllers/admins_controller_spec.rb
index 48348e0da..5b744d9c5 100644
--- a/spec/controllers/admins_controller_spec.rb
+++ b/spec/controllers/admins_controller_spec.rb
@@ -116,4 +116,16 @@ describe AdminsController do
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
diff --git a/spec/models/status_message_spec.rb b/spec/models/status_message_spec.rb
index 80969ddb0..ce2f6e557 100644
--- a/spec/models/status_message_spec.rb
+++ b/spec/models/status_message_spec.rb
@@ -87,8 +87,8 @@ STR
describe '#format_mentions' do
it 'adds the links in the formated message text' do
@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')}
-can mention people like Raphaellike Raphael #{link_to('@' << @people[2].name, person_path(@people[2]), :class => 'mention')} can mention people like Raph
+#{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 hovercardable')} can mention people like Raph
STR
end