Skip to content
Extraits de code Groupes Projets
Valider 93bbfd19 rédigé par Raphael's avatar Raphael
Parcourir les fichiers

Move back to image link helper, but static

parent 7bce44ef
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -96,7 +96,13 @@ module ApplicationHelper ...@@ -96,7 +96,13 @@ module ApplicationHelper
end end
def person_image_tag(person) def person_image_tag(person)
image_tag image_or_default(person), :class => "avatar", :alt => person.real_name, :title => person.real_name, "data-person_id" => person.id "<img alt='#{person.real_name}' class='avatar' data-person_id='#{person.id}' src='#{image_or_default(person)}' title='#{person.real_name}'>".html_safe
end
def person_link(person)
"<a href='/people/#{person.id}'>
#{person.real_name}
</a>".html_safe
end end
def image_or_default(person) def image_or_default(person)
...@@ -114,7 +120,9 @@ module ApplicationHelper ...@@ -114,7 +120,9 @@ module ApplicationHelper
if opts[:to] == :photos if opts[:to] == :photos
link_to person_image_tag(person), person_photos_path(person) link_to person_image_tag(person), person_photos_path(person)
else else
link_to person_image_tag(person), person_path(person) "<a href='/people/#{person.id}'>
#{person_image_tag(person)}
</a>".html_safe
end end
end end
......
...@@ -4,11 +4,10 @@ ...@@ -4,11 +4,10 @@
- comment = hash[:comment] - comment = hash[:comment]
- person = hash[:person] - person = hash[:person]
%li.comment{:data=>{:guid=>comment.id}} %li.comment{:data=>{:guid=>comment.id}}
%a{:href => "/people/#{person.id}"} =person_image_link(person)
%img{:src => image_or_default(person), :class => "avatar", :alt => person.real_name, :title => person.real_name, "data-person_id" => person.id}
.content .content
.from .from
%a{:href => "/people/#{person.id}"}=person.real_name =person_link(person)
= markdownify(comment.text, :youtube_maps => comment[:youtube_titles]) = markdownify(comment.text, :youtube_maps => comment[:youtube_titles])
%div.time %div.time
= comment.created_at ? "#{time_ago_in_words(comment.created_at)} #{t('ago')}" : time_ago_in_words(Time.now) = comment.created_at ? "#{time_ago_in_words(comment.created_at)} #{t('ago')}" : time_ago_in_words(Time.now)
......
...@@ -3,12 +3,10 @@ ...@@ -3,12 +3,10 @@
-# the COPYRIGHT file. -# the COPYRIGHT file.
%li.message{:data=>{:guid=>post.id}} %li.message{:data=>{:guid=>post.id}}
%a{:href => "/people/#{person.id}"} =person_image_link(person)
%img{:src => image_or_default(person), :class => "avatar", :alt => person.real_name, :title => person.real_name, "data-person_id" => person.id}
.content .content
.from .from
%a{:href => "/people/#{person.id}"}=person.real_name =person_link(person)
- if person.owner_id == current_user.id - if person.owner_id == current_user.id
.aspect .aspect
...@@ -22,7 +20,7 @@ ...@@ -22,7 +20,7 @@
.right .right
- reshare_aspects = aspects_without_post(aspects, post) - reshare_aspects = aspects_without_post(aspects, post)
- unless reshare_aspects.empty? - unless reshare_aspects.empty?
= render 'shared/reshare', :current_user => current_user, :aspects => reshare_aspects, :post => post = render 'shared/reshare', :aspects => reshare_aspects, :post => post
= link_to t('delete'), status_message_path(post), :confirm => t('are_you_sure'), :method => :delete, :remote => true, :class => "delete" = link_to t('delete'), status_message_path(post), :confirm => t('are_you_sure'), :method => :delete, :remote => true, :class => "delete"
= render 'status_messages/status_message', :post => post, :photos => photos = render 'status_messages/status_message', :post => post, :photos => photos
......
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