From d38e3a6b29bf3f61d9d044de8c0c0c0a9e765514 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Tue, 8 Mar 2011 15:51:46 -0800 Subject: [PATCH] added translations to all conversation/message views. tweaked css --- app/helpers/conversations_helper.rb | 9 +++++ app/views/comments/_comment.html.haml | 11 +++--- app/views/conversations/_conversation.haml | 2 +- app/views/conversations/_show.haml | 6 ++-- app/views/conversations/index.haml | 10 +++--- app/views/conversations/new.haml | 10 +++--- app/views/layouts/_header.html.haml | 6 ++-- app/views/shared/_stream_element.html.haml | 4 ++- config/locales/diaspora/en.yml | 15 +++++++++ public/images/icons/monotone_flag.png | Bin 0 -> 783 bytes public/stylesheets/sass/application.sass | 37 +++++++++++++++++---- 11 files changed, 79 insertions(+), 31 deletions(-) create mode 100644 app/helpers/conversations_helper.rb create mode 100644 public/images/icons/monotone_flag.png diff --git a/app/helpers/conversations_helper.rb b/app/helpers/conversations_helper.rb new file mode 100644 index 000000000..4c7e59115 --- /dev/null +++ b/app/helpers/conversations_helper.rb @@ -0,0 +1,9 @@ +module ConversationsHelper + def new_message_text(count) + if count > 0 + t('new_messages', :count => count) + else + t('no_new_messages') + end + end +end diff --git a/app/views/comments/_comment.html.haml b/app/views/comments/_comment.html.haml index 3d8a56173..ffe727553 100644 --- a/app/views/comments/_comment.html.haml +++ b/app/views/comments/_comment.html.haml @@ -5,11 +5,10 @@ %li.comment{:data=>{:guid => comment.id}, :class => ("hidden" if(defined? hidden))} = person_image_link(comment.author) .content - %strong + .from = person_link(comment.author) - - = markdownify(comment.text, :youtube_maps => comment.youtube_titles) - - .info - %span.time + %time.timeago{:datetime => comment.created_at} = comment.created_at ? timeago(comment.created_at) : timeago(Time.now) + + %p + = markdownify(comment.text, :youtube_maps => comment.youtube_titles) diff --git a/app/views/conversations/_conversation.haml b/app/views/conversations/_conversation.haml index 604ae5125..35657566e 100644 --- a/app/views/conversations/_conversation.haml +++ b/app/views/conversations/_conversation.haml @@ -13,7 +13,7 @@ .last_author .timestamp - = time_ago_in_words conversation.updated_at + = time_ago_in_words(conversation.updated_at) = authors[conversation.id].name - if conversation.participants.size > 2 diff --git a/app/views/conversations/_show.haml b/app/views/conversations/_show.haml index 85adf3bef..9e71f45b7 100644 --- a/app/views/conversations/_show.haml +++ b/app/views/conversations/_show.haml @@ -10,7 +10,7 @@ = conversation.subject .conversation_controls - = link_to (image_tag('reply.png', :height => 14, :width => 14) + ' ' + 'reply'), '#', :id => 'reply_to_conversation' + = link_to (image_tag('reply.png', :height => 14, :width => 14) + ' ' + t('.reply')), '#', :id => 'reply_to_conversation' = link_to (image_tag('deletelabel.png') + ' ' + t('delete').downcase), conversation_conversation_visibility_path(conversation), :method => 'delete', :confirm => t('are_you_sure') .span-6.avatars.last @@ -33,5 +33,5 @@ = form_for [conversation, Message.new] do |message| = message.text_area :text, :rows => 5 .right - = message.submit 'Reply', :class => 'button' - = link_to 'Cancel', '#' + = message.submit t('.reply').capitalize, :class => 'button' + = link_to t('cancel'), '#' diff --git a/app/views/conversations/index.haml b/app/views/conversations/index.haml index 6fdc0f141..7962d6c84 100644 --- a/app/views/conversations/index.haml +++ b/app/views/conversations/index.haml @@ -7,7 +7,7 @@ = include_javascripts :inbox - content_for :page_title do - Message Inbox + = t('.message_inbox') :css footer{ display:none;} @@ -16,7 +16,7 @@ #left_pane_header %h3 .right - = link_to 'New Message', new_conversation_path, :class => 'button', :rel => 'facebox' + = link_to t('.new_message'), new_conversation_path, :class => 'button', :rel => 'facebox' Inbox #conversation_inbox @@ -26,13 +26,13 @@ = will_paginate @conversations - else %i - You have no messages + = t('.you_have_no_new_messages') #conversation_show.span-16.prepend-8.last - if @conversation = render 'conversations/show', :conversation => @conversation - else #no_conversation_text - no conversation selected + = t('.no_conversation_selected') #no_conversation_controls - = link_to 'create a new message', new_conversation_path, :rel => 'facebox' + = link_to t('.create_a_new_message'), new_conversation_path, :rel => 'facebox' diff --git a/app/views/conversations/new.haml b/app/views/conversations/new.haml index 9be57e181..84c343fb0 100644 --- a/app/views/conversations/new.haml +++ b/app/views/conversations/new.haml @@ -26,20 +26,20 @@ .span-12.last #facebox_header %h4 - New Message + = t('conversations.index.new_message') = form_for Conversation.new do |conversation| %br .span-2 %h4 - to + = t('.to') .span-10.last = text_field_tag "contact_autocomplete" .span-2 %h4 - subject + = t('.subject') .span-10.last = conversation.text_field :subject @@ -47,5 +47,5 @@ = text_area_tag "conversation[text]", '', :rows => 5 .text-right - = conversation.submit :send, :class => 'button' - = link_to 'cancel', conversations_path + = conversation.submit t('.send'), :class => 'button' + = link_to t('cancel'), conversations_path diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 7184c98e6..589eb60d6 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -24,12 +24,12 @@ - if @notification_count #notification_badge = link_to "", notifications_path, :title => new_notification_text(@notification_count) - = image_tag 'icons/mail_grey.png' + = image_tag 'icons/monotone_flag.png', :height => 20, :width => 20 .badge_count{:class => ("hidden" if @notification_count == 0)} = @notification_count #message_inbox_badge - = link_to "", conversations_path #, :title => new_notification_text(@notification_count) - = image_tag 'icons/mail_grey.png' + = link_to "", conversations_path , :title => new_message_text(@unread_message_count) + = image_tag 'icons/mail_grey.png', :height => 16, :width => 16 .badge_count{:class => ("hidden" if @unread_message_count == 0)} = @unread_message_count diff --git a/app/views/shared/_stream_element.html.haml b/app/views/shared/_stream_element.html.haml index ec529a2e0..36a28cbc7 100644 --- a/app/views/shared/_stream_element.html.haml +++ b/app/views/shared/_stream_element.html.haml @@ -16,7 +16,6 @@ .from = person_link(post.author, :class => 'author') %time.timeago{:datetime => post.created_at} - = link_to(how_long_ago(post), status_message_path(post)) %p = render 'status_messages/status_message', :post => post, :photos => post.photos @@ -29,6 +28,9 @@ %span.aspect_badges = aspect_badges(aspects_with_post(all_aspects, post)) + %span.timeago + = link_to(how_long_ago(post), status_message_path(post)) + = link_to t('comments.new_comment.comment').downcase, '#', :class => 'focus_comment_textarea' = render "comments/comments", :post_id => post.id, :comments => post.comments, :current_user => current_user, :condensed => true, :commenting_disabled => defined?(@commenting_disabled) diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 2819c4a9c..8131d11b0 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -27,6 +27,8 @@ en: search: "Search" new_notifications: "%{count} new notifications" no_new_notifications: "no new notifications" + new_messages: "%{count} new messages" + no_new_messages: "no new messages" _home: "Home" _more: "More" _comments: "Comments" @@ -523,3 +525,16 @@ en: fullmonth_day: "%B %d" birthday: "%B %d" birthday_with_year: "%B %d %Y" + + conversations: + index: + message_inbox: "Message Inbox" + new_message: "New Message" + no_conversation_selected: "no conversation selected" + create_a_new_message: "create a new message" + show: + reply: 'reply' + new: + to: 'to' + subject: 'subject' + send: 'Send' diff --git a/public/images/icons/monotone_flag.png b/public/images/icons/monotone_flag.png new file mode 100644 index 0000000000000000000000000000000000000000..baea94936d2e36f689fdf10a49500c3b2cf26efc GIT binary patch literal 783 zcmV+q1MvKbP)&+5Xb-j`QB5|iiM;KrD>Z&5igzuX~9Bo)kC2mp@&K-N(A{#2n{yG%brU^JnRaM z!POoYdeB~a=&6WpD$+v^5`v;&q$b-!*(96rzM1i|yWKCXwFeJAc&GRH&3|V8Gr)g* z_)ibjYW0As9ubk_08X3Pbu;@e#`t5N=gR>6nSk|refQ?(<{5YY5WpMm-upumB$v$W zt5&O3pPrsxdn#~tcJ}oU!bOrNNCq=|Oo501095sR5&107^P5iuR;$$kcfS%scvn>) z1GzuSkR)P^NGUCt*?VJSV}JAl_JPle$O%;iNx1tRGrJ2wMFcTMgb)xy07;~jOhn!y z`EjGs$hyD)05dZ)he?hC5O+ri0q*`2fCm76NGbg$BKt}11+cBEzW_K#a-X}8uB@zF z18}RSFvfV)-Cyh0%-uoqRWn;JiehnmeEibl;^O)B_4N;$&E`k$euv~PGeeeT12M+Y zQpzOH_1DPV;qLoLJ`5r32Y|V`ximF3^>BE2_<52SLI}G7pd;dJ2^eEM*53d#gP9!= z5mnU}`>nIKwnhMd?GV5cFr`##y}Lt1UNN&50K7CmKYy^%Xk?X2MJ6XFo7>ylxvE|U zpdD}a=%E9si^#G5s3Jmle~#qf*4EaIcDubaI5@amtJPX&_A-FC0c0IVd{Y935N@gJ zuOf1&-^?O1U}pDXj3-s~5XpA{Aj`6D?VzgnQ%YZ!QeItMU3T{`02s;s#vBIlr@O<< zpsKyw2?!CH9~v53C;=;#iiybAW_G=6Tz7}6?lH3mJ4cWtLI^Ok1v9ITjErar2mpDW z-!F<{vM7pgNv2Npy#U(o-s&nBk?y422JmVB*p+|)FflRl^Tx);`>Ohhs@?^#3qWx9 zdtDHKB{RFwZnsbETnxZd_F=778!C$8O_EKLp9A>4D2l89wh#aR=Wpy0k`$FnKkfhk N002ovPDHLkV1oK%Zc_jN literal 0 HcmV?d00001 diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 89045d0bb..d5a85aa0b 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -254,6 +254,7 @@ header .stream .stream_element :padding 20px 20px + :right 70px :min-height 50px :border :bottom 1px solid #ddd @@ -262,6 +263,9 @@ header &:hover .right :display inline + .from + a + :color $blue .youtube-player, .vimeo-player :border none @@ -393,7 +397,7 @@ header :margin :top 2px :color #999 - :font-size smaller + :font-size 11px .comments .info @@ -410,7 +414,7 @@ header .time, .timeago - :color #ccc + :color #999 a :color #ccc :margin @@ -559,6 +563,8 @@ ul.show_comments :line :height 18px + :position relative + textarea :width 100% :height 1.4em @@ -593,9 +599,6 @@ ul.show_comments a :color #444 - div.time - :color #bbb - form :margin :top -5px @@ -634,6 +637,12 @@ ul.show_comments textarea :min-height 2.4em +.comments + time + :margin + :right -15px + .timeago + :color #999 .stream.show ul.comments @@ -693,11 +702,14 @@ a.paginate, #infscr-loading :right 12px &.controls + :z-index 6 :background :color $background :font :size 12px :color #999 + :padding + :left 100px a :color #999 :font @@ -1672,11 +1684,11 @@ h3 span.current_gs_step :top 5px :display inline :margin 0 10px - :right 0 + :right -5px :font :weight bold :size smaller - :width 30px + :width 28px a :z-index 5 @@ -1685,6 +1697,16 @@ h3 span.current_gs_step :width 20px :height 20px + &:hover + .badge_count + :background + :color lighten(#A40802, 5%) + +#notification_badge + img + :position relative + :top 2px + .badge_count :z-index 3 :position absolute @@ -2275,6 +2297,7 @@ ul.show_comments :margin :left 0.5em :right 0.5em + .mark_all_read :position relative :top 10px