From c63319f12767ba347ae62d8e089e5c0452e05e51 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 22 Nov 2010 17:03:19 -0800 Subject: [PATCH 1/2] aspect#show cleanup. added 3 icons. --- app/helpers/aspects_helper.rb | 4 +- app/views/aspects/show.html.haml | 14 ++++++ app/views/shared/_aspect_contacts.haml | 12 ----- app/views/shared/_contact_list.html.haml | 26 ++++++++++- config/locales/diaspora/en.yml | 8 +++- public/images/icons/monotone_check_yes.png | Bin 0 -> 678 bytes .../icons/monotone_close_exit_delete.png | Bin 0 -> 725 bytes .../images/icons/monotone_plus_add_round.png | Bin 0 -> 760 bytes public/stylesheets/sass/application.sass | 42 ++++++++++++++---- public/stylesheets/sass/ui.sass | 6 +++ 10 files changed, 85 insertions(+), 27 deletions(-) create mode 100644 public/images/icons/monotone_check_yes.png create mode 100644 public/images/icons/monotone_close_exit_delete.png create mode 100644 public/images/icons/monotone_plus_add_round.png diff --git a/app/helpers/aspects_helper.rb b/app/helpers/aspects_helper.rb index 1f90443d0..2b8cf11e0 100644 --- a/app/helpers/aspects_helper.rb +++ b/app/helpers/aspects_helper.rb @@ -16,10 +16,10 @@ module AspectsHelper end def add_to_aspect_button(aspect_id, person_id) - link_to '+', {:action => 'add_to_aspect', :aspect_id => aspect_id, :person_id => person_id}, :remote => true, :class => 'add button' + link_to image_tag('icons/monotone_plus_add_round.png'), {:action => 'add_to_aspect', :aspect_id => aspect_id, :person_id => person_id}, :remote => true, :class => 'add button' end def remove_from_aspect_button(aspect_id, person_id) - link_to 'x', {:action => 'remove_from_aspect', :aspect_id => aspect_id, :person_id => person_id}, :remote => true, :class => 'remove button' + link_to image_tag('icons/monotone_check_yes.png'), {:action => 'remove_from_aspect', :aspect_id => aspect_id, :person_id => person_id}, :remote => true, :class => 'added button' end end diff --git a/app/views/aspects/show.html.haml b/app/views/aspects/show.html.haml index 01877eb86..fa0c1721a 100644 --- a/app/views/aspects/show.html.haml +++ b/app/views/aspects/show.html.haml @@ -2,6 +2,20 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. +.span-24.last + %h2{:style=>"position:relative;margin-bottom:0;"} + = @aspect + + %span.aspect_contact_count{:style=>"color:#999;font-size:14px;"} + = @aspect.contacts.count + - if @aspect.contacts.count == 1 + = t('.contact') + - else + = t('.contacts') + + = link_to t('.edit_aspect'), "#", :id => "edit_aspect_trigger" + + .span-8.append-1.last = render 'shared/aspect_contacts', :contacts => @aspect_contacts, :aspect => @aspect diff --git a/app/views/shared/_aspect_contacts.haml b/app/views/shared/_aspect_contacts.haml index c01d80fab..363c9f713 100644 --- a/app/views/shared/_aspect_contacts.haml +++ b/app/views/shared/_aspect_contacts.haml @@ -58,18 +58,6 @@ #left_pane{:class => ("everyone" if aspect == :all)} - if aspect == :all %h2 All contacts - - else - %h2{:style=>"position:relative;margin-bottom:0;"} - = aspect - .right - = link_to t('.edit_aspect'), "#", :id => "edit_aspect_trigger", :class => "button" - - %span.aspect_contact_count{:style=>"color:#999;font-size:14px;"} - = aspect.contacts.count - - if aspect.contacts.count == 1 - = t('.contact') - - else - = t('.contacts') - unless aspect == :all #edit_aspect_pane diff --git a/app/views/shared/_contact_list.html.haml b/app/views/shared/_contact_list.html.haml index 9b998dced..4dab495d9 100644 --- a/app/views/shared/_contact_list.html.haml +++ b/app/views/shared/_contact_list.html.haml @@ -36,24 +36,46 @@ } }; - $('.remove').live('ajax:success', function(data, html, xhr) { + $('.added').live('ajax:loading', function(data, html, xhr) { + $(this).fadeTo(200,0.4); + }); + + $('.added').live('ajax:success', function(data, html, xhr) { var person_id = $(this).closest("li").find(".avatar").attr("data-person_id"); $(".contact_pictures").find("img[data-person_id='"+person_id+"']").parent().remove(); $(this).parent().html(html); ContactList.refreshContactCount(); + + $(this).fadeTo(200,1); }); - $('.remove').live('ajax:failure', function(data, html, xhr) { + $('.added').live('ajax:failure', function(data, html, xhr) { alert("#{t('.cannot_remove')}"); }); + + $('.add').live('ajax:loading', function(data, html, xhr) { + $(this).fadeTo(200,0.4); + }); + $('.add').live('ajax:success', function(data, html, xhr) { var person_image = $(this).closest("li").find(".avatar") person_image.parent().clone().appendTo(".contact_pictures"); $(this).parent().html(html); ContactList.refreshContactCount(); + + $(this).fadeTo(200,1); + }); + + + $('.added').live('mouseover', function(){ + $(this).addClass("remove"); + $(this).children("img").attr("src","/images/icons/monotone_close_exit_delete.png"); + }).live('mouseout', function(){ + $(this).removeClass("remove"); + $(this).children("img").attr("src","/images/icons/monotone_check_yes.png"); }); ContactList.initialize(); diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index e7b72b30a..c32f70e5f 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -82,11 +82,11 @@ en: done_editing: "done editing" new_requests: "%{count} new requests!" new_request: "%{count} new request!" + add_existing: "Add an existing contact" + aspect_settings: "Aspect settings" edit_aspect: "edit aspect" contact: "contact" contacts: "contacts" - add_existing: "Add an existing contact" - aspect_settings: "Aspect settings" remove_aspect: "Remove Aspect" confirm_remove_aspect: "Remove aspect?" no_contacts: "You currently have no contacts. Find your contacts here." @@ -116,6 +116,10 @@ en: search_contacts: "Search contacts" cannot_remove: "Cannot remove person from last aspect. (If you want to disconnect from this person you must remove contact.)" aspects: + show: + edit_aspect: "edit aspect" + contact: "contact" + contacts: "contacts" no_contacts_message: nobody: "We know you know people — bring them to Diaspora!" nobody_in_aspect: "Your aspect '%{aspect_name}' is empty." diff --git a/public/images/icons/monotone_check_yes.png b/public/images/icons/monotone_check_yes.png new file mode 100644 index 0000000000000000000000000000000000000000..7bc542e465b2ec22c27f4160d0ca5f5351c876c8 GIT binary patch literal 678 zcmV;X0$KfuP)ze;6ivcYH)RuHFAEhBNbY-Ihg#9_nO*CHffEm<8yiEKqFe~6s@iBYUZ2ZmR~P2zYk@!jPW?)?T4jCx{S`eN-esIO1yOV{r5@wF z8IHvoXDn;3TrS5>g)J^F2IHprjB&m%h$0Zijx0H;CaIERs3?w;c~cx!7*v(xF9?VX*sTUfqWoK+3O4G;qD ziG=G5UYne(3xoh+3__~u>|;tnpcLY!>EAvBwtYhk z2HjQx6kV_N*|z-)B^UGg2a2u(ru3jlSH{Pm`+}uXsVf|femR^F(zK7+T<&bXP^c)H zb_7#&{rjb{v6L?e0Jwi}aGpw%d$?8fNaRyU)7%zD7y}|n&}&&w0Ra1g2>opAuI}y^ zRFV$*P!Po4q@XdPNTwPy3pUGtIa!HE4U0!xNO>?2vBd;kCd literal 0 HcmV?d00001 diff --git a/public/images/icons/monotone_close_exit_delete.png b/public/images/icons/monotone_close_exit_delete.png new file mode 100644 index 0000000000000000000000000000000000000000..6de9eb18db1a4e1b465fe891561921a439909492 GIT binary patch literal 725 zcmV;`0xJE9P)#qo<=H+xK0f#1aZoli{e9qx}en`@PC)6$g0BCAz zs_#dmk#{dI*P+>zWQ^A>!+5p3yIVsD!L_TDDit;2IFEJ9`c4>g5ypTp2Ev%DndWiW zah`2&Z|m2BRVo$LiN)S3oHr05fGGvS7!bw)QwoR>Ae_6QX!PA*p#UH|@%SUkd4qO! zK{OseG;RArRuqsG1vJxaI?3b*uBuIia|lPHPXVBi)iW zER&hlP4m)Y7%-8|t{xm5=>9<9jjSkO+4kwe@^WumU?P>uF(De5QcyMRERjkr6^ljX z&gke;CYya&EEbjC{{Bhf@q8hS0TTjl`u+K~z}v&an}o4u%P-;aGzQY?2f17hudS`g z!ARt;(6p15uSk|*c7FcwDuZpw%6-hSy@5jZ)+5)Gi zr+X~h{)PyFNHls_tJU=0KwwO0+OewZZhCNVwp=c=U?lQdRunM2-m~1?oWCs)0OUk6 z`Ghd$G9em)P-stR+Gk8@6H^MRVbp`6&`U1F55hUb5{W{`wUH!ADwRrVBo?bEoP&I2 zsau1RDFwng1j6C>g+jsX2y3ZaF6$A;+0;z)RN)*Xj6wQ+dZ1g@MLdys@qBB`{!?zp z=WuUkCR{%`$)DHjt4-IHIp-U;&$qX?v-1fd@ti9*G&FRgeBZuIKFkaTX;(?fn4#2IZp|=Ff)I4Dt}dBQr+06qPMmCP ze3m~Xl%m4oV!C?mS~Gy=-+M*jFr7~%TJkwOm!#8a^>JpVUhDNoWDHVDNGXx=yr7UW zn5!A*V2r_aT}(_)9?u8n?0~_+!IGuL#RASb2tX_veJ6l^Wm(u04!EkTK?;ZEAW@T3QPI?c0wg=kPoaZ^y^GDyyrz*7pGbeBVb^Rn=@uQ`4hOZL@A2 zb*ZgwAQTQ0GmM`W;Zjn*Wtd^mUdPGa?(J>f5|$6W*xGtGQc;n~8CWPqTuOov6euX5 zXe>6{+1-6^v-vIm;?To~Ctf^%e)&@>b!>iqo=L+%BobMUMx!s!oIZU&kw~O=RJVy* qPDF*Bot^gZ@UTrp1%D0s@8UZ%9w61b4L8C70000