diff --git a/app/helpers/outfits_helper.rb b/app/helpers/outfits_helper.rb index be0d95eb..1c561363 100644 --- a/app/helpers/outfits_helper.rb +++ b/app/helpers/outfits_helper.rb @@ -24,6 +24,16 @@ module OutfitsHelper query << "&outfit=#{outfit.id}" if user_signed_in? && outfit.user_id == current_user.id link_to content, wardrobe_path(:anchor => query), options end + + def outfit_creation_summary(outfit) + user = outfit.user + user_link = link_to(user.name, user_contributions_path(user)) + created_at_ago = content_tag(:abbr, time_ago_in_words(@outfit.created_at), + :title => @outfit.created_at) + translate 'outfits.show.creation_summary_html', + :user_link => user_link, + :created_at_ago => created_at_ago + end def outfit_li_for(outfit) class_name = outfit.starred? ? 'starred' : nil diff --git a/app/views/outfits/show.html.haml b/app/views/outfits/show.html.haml index 207285bd..e06fa93d 100644 --- a/app/views/outfits/show.html.haml +++ b/app/views/outfits/show.html.haml @@ -1,4 +1,4 @@ -- title(@outfit.name || "Shared outfit") +- title(@outfit.name || t('.default_outfit_name')) - content_for :before_title, campaign_progress - open_graph :type => 'openneo-impress:outfit', :title => yield(:title), @@ -7,15 +7,14 @@ - open_graph :image => absolute_url(@outfit.image.url) = link_to_edit_outfit(@outfit, :class => 'button', :id => 'outfit-wardrobe-link') do - Edit - - unless user_signed_in? && @outfit.user == current_user - a copy + - if user_signed_in? && @outfit.user == current_user + = t '.edit' + - else + = t '.clone' + - if @outfit.user_id #outfit-user - Created by - == #{link_to @outfit.user.name, user_contributions_path(@outfit.user)}, - %span{:title => @outfit.created_at}= time_ago_in_words @outfit.created_at - ago + = outfit_creation_summary(@outfit) #preview-wrapper #preview-swf #outfit-items= render @outfit.worn_items diff --git a/config/locales/en-meep.yml b/config/locales/en-meep.yml index 1edebc6f..53a0551f 100644 --- a/config/locales/en-meep.yml +++ b/config/locales/en-meep.yml @@ -58,6 +58,12 @@ en-meep: Meep, %{user_link}!" blog_linkback: OpenNeo Meep newest_items_header: New Meeps + + show: + default_outfit_name: Meeped outfit + edit: Meep + clone: Meep a copy + creation_summary_html: Meeped by %{user_link}, %{created_at_ago} ago contributions: contributed_description: diff --git a/config/locales/en.yml b/config/locales/en.yml index cfeea61e..299fafb0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -59,6 +59,12 @@ en: Thanks, %{user_link}!" blog_linkback: OpenNeo Blog newest_items_header: New Items + + show: + default_outfit_name: Shared outfit + edit: Edit + clone: Edit a copy + creation_summary_html: Created by %{user_link}, %{created_at_ago} ago contributions: contributed_description: