Skip to content
Extraits de code Groupes Projets
Valider 84072305 rédigé par Jordi Mallach's avatar Jordi Mallach
Parcourir les fichiers

Merge branch 'master' of git://github.com/diaspora/diaspora

parents 355e29c2 e994c905
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Affichage de
avec 77 ajouts et 16 suppressions
......@@ -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
......@@ -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)
......
......@@ -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}"}
......
......@@ -57,7 +57,7 @@ class StatusMessage < Post
if opts[:plain_text]
person ? ERB::Util.h(person.name) : ERB::Util.h($~[1])
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
form_message
......@@ -107,7 +107,7 @@ class StatusMessage < Post
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
<activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
</entry>
XML
XML
end
def socket_to_user(user_or_id, opts={})
......
.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
// 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') ) {
......
......@@ -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);
......
......@@ -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
......
......@@ -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:
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......@@ -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
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter