From b5dbfc129ccd5ab52e228d4eda269314e3f860d4 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 24 Nov 2010 11:49:55 -0800 Subject: [PATCH] touched up aspect contact manage list, removed some unused sass. --- app/views/aspects/index.html.haml | 2 +- app/views/aspects/manage.html.haml | 4 +- app/views/layouts/_header.html.haml | 2 +- app/views/layouts/application.html.haml | 1 + app/views/people/_profile_sidebar.html.haml | 7 - app/views/people/show.html.haml | 12 +- app/views/photos/_index.html.haml | 22 +- app/views/shared/_add_contact.html.haml | 23 +-- app/views/shared/_aspect_contacts.haml | 6 +- app/views/shared/_author_info.html.haml | 7 +- app/views/shared/_contact_list.html.haml | 20 +- config/assets.yml | 1 - config/locales/diaspora/en.yml | 5 +- public/javascripts/stream.js | 22 +- public/stylesheets/sass/application.sass | 217 ++++---------------- 15 files changed, 117 insertions(+), 234 deletions(-) diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index ee4df65af..6af143dba 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -5,7 +5,7 @@ .span-24.last %h2{:style => "position:relative;"} = current_user.real_name - .right + .right{:style=>"top:0"} %span.description = current_user.diaspora_handle = info_text(t('.handle_explanation')) diff --git a/app/views/aspects/manage.html.haml b/app/views/aspects/manage.html.haml index c34ba9577..ed3e86e64 100644 --- a/app/views/aspects/manage.html.haml +++ b/app/views/aspects/manage.html.haml @@ -27,7 +27,7 @@ .x X .circle - = person_image_link(request.from) + = link_to person_image_tag(request.from), request.from = render 'shared/invitations', :invites => @invites @@ -53,7 +53,7 @@ .x X .circle - = person_image_link(contact.person) + = link_to person_image_tag(contact.person), contact.person .draggable_info =t('.drag_to_add') diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 23eff99fe..ec002e4c4 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -18,7 +18,7 @@ - else #global_search - = form_tag(people_path, :method => 'get') do + = form_tag(people_path, :method => 'get', :id => "global_search") do = text_field_tag 'q', nil, :placeholder => t('search'), :type => 'search', :results => 5 %ul#user_menu diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 2ed5dd16c..fd28b64f2 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -28,6 +28,7 @@ = javascript_include_tag "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" + = javascript_include_tag "vendor/jquery144.min" :javascript !window.jQuery && document.write(unescape('%3Cscript src="js/libs/jquery-1.4.4.js"%3E%3C/script%3E')) diff --git a/app/views/people/_profile_sidebar.html.haml b/app/views/people/_profile_sidebar.html.haml index 62e4eef7d..a8b3d8023 100644 --- a/app/views/people/_profile_sidebar.html.haml +++ b/app/views/people/_profile_sidebar.html.haml @@ -8,7 +8,6 @@ $('.delete').bind('ajax:success', function() { $(this).closest('li').fadeOut(200); }); - $('.delete').bind('ajax:failure', function() { alert("#{t('.cannot_remove', :name => person.real_name)}"); }); @@ -48,9 +47,3 @@ %h3 #{t('.born')} = "#{time_ago_in_words(person.profile.birthday)} #{t('ago')}" if @person.profile.birthday - .clearfix - %br - %br - %br - %br - %b.small= person.diaspora_handle diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index 85b460ce0..83b0f7bcd 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -4,7 +4,17 @@ .span-24.last - = render 'shared/author_info', :person => @person, :profile => true + #author_info + .from{:style=>"padding-left:0;display:block;"} + %h2 + = @person.real_name + .right{:style => "top:0;"} + %span.description + = @person.diaspora_handle + + #person_nav_links + = link_to t('layouts.header.view_profile'), person_path(@person) + = link_to t('_photos'), person_photos_path(@person) .span-8.append-1.last = render :partial => 'people/profile_sidebar', :locals => {:person => @person, :is_contact => @is_contact} diff --git a/app/views/photos/_index.html.haml b/app/views/photos/_index.html.haml index abb59d855..5550d5ef9 100644 --- a/app/views/photos/_index.html.haml +++ b/app/views/photos/_index.html.haml @@ -2,9 +2,21 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -.span-15.last - #thumbnails - - for photo in photos - .image_thumb - = link_to (image_tag photo.url(:thumb_medium)), photo_path(photo) + +- content_for :head do + + :javascript + $(document).ready(function(){ + $("#thumbnails").find("img").bind("mouseenter",function(){ + var photo = $(this), + messageId = photo.attr("data-message-id"); + + $("#thumbnails").find("img[data-message-id='"+messageId+"']").css('opacity','0.5'); + $("#thumbnails").find("img").fadeTo(100,1); + }); + }); + +#thumbnails.span-15.last + - for photo in photos + = link_to (image_tag photo.url(:thumb_medium), "data-message-id" => photo.status_message_id ), photo_path(photo) diff --git a/app/views/shared/_add_contact.html.haml b/app/views/shared/_add_contact.html.haml index e7b2c80bb..4d57753c2 100644 --- a/app/views/shared/_add_contact.html.haml +++ b/app/views/shared/_add_contact.html.haml @@ -3,24 +3,21 @@ -# the COPYRIGHT file. -%h3= t('aspects.manage.add_a_new_contact') +%h4 + = t('aspects.manage.add_a_new_contact') + = info_text(t('.enter_a_diaspora_username')) = form_tag(person_by_handle_path, :id => "new_request_to_#{aspect.id}", :class => "webfinger_form", :remote => true) do - =t('.enter_a_diaspora_username') - %br - %i= t '.your_diaspora_username_is', :diaspora_handle => current_user.diaspora_handle - = search_field_tag :diaspora_handle,'', :id => "request_d_handle_to_#{aspect.id}", :results => 5, :placeholder => t('.diaspora_handle') = hidden_field_tag :aspect_id, aspect.id - - - if defined?(getting_started) - = hidden_field_tag :getting_started, getting_started - - if defined?(manage) - = hidden_field_tag :manage, true - = submit_tag t('.create_request') -%br -#loader.hidden= image_tag 'ajax-loader.gif' + + %p{:style => "margin:12px 0 24px 0px;color:#999;text-align:center;"} + = t '.your_diaspora_username_is', :diaspora_handle => current_user.diaspora_handle + +#loader.hidden + = image_tag 'ajax-loader.gif' + %ul#request_result{:aspect_id => aspect.id} %li.error.hidden #message diff --git a/app/views/shared/_aspect_contacts.haml b/app/views/shared/_aspect_contacts.haml index 6979e42a8..96f1bc044 100644 --- a/app/views/shared/_aspect_contacts.haml +++ b/app/views/shared/_aspect_contacts.haml @@ -62,12 +62,12 @@ - unless aspect == :all #edit_aspect_pane - if @contacts.count > 0 - %h3= t('.add_existing') + %h4= t('.add_existing') = render 'shared/contact_list', :aspect => aspect, :contacts => @contacts, :manage => defined?(manage) = render 'shared/add_contact', :aspect => aspect - %h3= t('.aspect_settings') + %hr .big_buttons = button_to t('.remove_aspect'), aspect, :method => "delete", :confirm => t('.confirm_remove_aspect') @@ -102,7 +102,7 @@ = "#{user_aspect.contacts.count} #{t('.contacts')}" - if user_aspect.contacts.count > 0 - - for aspect_contact in user_aspect.contacts[0..8] + - for aspect_contact in user_aspect.contacts[0..7] = person_image_link(aspect_contact.person) .clearfix diff --git a/app/views/shared/_author_info.html.haml b/app/views/shared/_author_info.html.haml index 65ba39764..1679c1bc2 100644 --- a/app/views/shared/_author_info.html.haml +++ b/app/views/shared/_author_info.html.haml @@ -1,9 +1,9 @@ -#author_info{:class=>("profile" if defined?(profile))} - = person_image_link(person) unless defined?(profile) +#author_info + = person_image_link(person) .from %h2 = person.real_name - - if defined?(post) && current_user.owns?(post) + - if current_user.owns?(post) .aspect ➔ %ul @@ -12,6 +12,7 @@ - else - for aspect in current_user.aspects_with_post( post.id ) %li= link_to aspect.name, aspect + #person_nav_links = link_to t('layouts.header.view_profile'), person_path(person) = link_to t('_photos'), person_photos_path(person) diff --git a/app/views/shared/_contact_list.html.haml b/app/views/shared/_contact_list.html.haml index d58a9adbd..01dd54a93 100644 --- a/app/views/shared/_contact_list.html.haml +++ b/app/views/shared/_contact_list.html.haml @@ -56,6 +56,7 @@ $('.added').live('ajax:failure', function(data, html, xhr) { alert("#{t('.cannot_remove')}"); + $(this).fadeTo(200,1); }); $('.add').live('ajax:loading', function(data, html, xhr) { @@ -89,21 +90,16 @@ .contact_list - = search_field_tag :contact_search, "", :class => 'contact_list_search', :results => 5, :placeholder => t('.search_contacts') + = search_field_tag :contact_search, "", :class => 'contact_list_search', :results => 5, :placeholder => t('.all_contacts') %ul - for contact in contacts %li - - unless contact.aspect_ids.include?(aspect.id) - = person_image_link contact.person - %span.name - = link_to contact.person.real_name, contact.person - .right + = person_image_link contact.person + %span.name + = link_to contact.person.real_name, contact.person + .right + - unless contact.aspect_ids.include?(aspect.id) = add_to_aspect_button(aspect.id, contact.person.id) - - - else - = person_image_link contact.person - %span.name - = link_to contact.person.real_name, contact.person - .right + - else = remove_from_aspect_button(aspect.id, contact.person.id) diff --git a/config/assets.yml b/config/assets.yml index 5a14264ae..209a864c7 100644 --- a/config/assets.yml +++ b/config/assets.yml @@ -24,7 +24,6 @@ javascripts: - public/javascripts/vendor/mailchimp/jquery.form.js - public/javascripts/vendor/mailchimp/jquery.validate.js - public/javascripts/vendor/mailchimp/jquery126.min.js - photo: - public/javascripts/photo.js - public/javascripts/image-picker.js diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 0585eec91..f5f76c165 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -83,7 +83,6 @@ en: new_requests: "%{count} new requests!" new_request: "%{count} new request!" add_existing: "Add an existing contact" - aspect_settings: "Aspect settings" contacts: "contacts" remove_aspect: "Remove Aspect" confirm_remove_aspect: "Remove aspect?" @@ -96,7 +95,7 @@ en: enter_a_diaspora_username: "Enter a Diaspora username:" your_diaspora_username_is: "Your Diaspora username is: %{diaspora_handle}" create_request: "Find by Diaspora handle" - diaspora_handle: "Diaspora Handle" + diaspora_handle: "diaspora@handle.org" know_email: "Know their email address? You should invite them" invitations: invite_someone: "Invite someone" @@ -112,7 +111,7 @@ en: notification: new: "New %{type} from %{from}" contact_list: - search_contacts: "Search contacts" + all_contacts: "All contacts" cannot_remove: "Cannot remove person from last aspect. (If you want to disconnect from this person you must remove contact.)" aspects: show: diff --git a/public/javascripts/stream.js b/public/javascripts/stream.js index d392624fb..6ebde54ea 100644 --- a/public/javascripts/stream.js +++ b/public/javascripts/stream.js @@ -12,14 +12,14 @@ $(document).ready(function(){ var comments = $(this); if(comments.children("li").length > 1) { var show_comments_toggle = comments.closest("li").find(".show_post_comments"); - expandComments(show_comments_toggle); + expandComments(show_comments_toggle,false); } }); // comment toggle action $stream.not(".show").delegate("a.show_post_comments", "click", function(evt) { evt.preventDefault(); - expandComments($(this)); + expandComments($(this),true); }); // comment submit action @@ -112,20 +112,28 @@ $(document).ready(function(){ });//end document ready -function expandComments(toggler){ +function expandComments(toggler,animate){ var text = toggler.html(); commentBlock = toggler.closest("li").find("ul.comments", ".content"); if( toggler.hasClass("visible")) { toggler.removeClass("visible") .html(text.replace("hide", "show")); - //commentBlock.slideUp(150); - commentBlock.hide(); + + if(animate) { + commentBlock.fadeOut(150); + } else { + commentBlock.hide(); + } } else { toggler.addClass("visible") .html(text.replace("show", "hide")); - //commentBlock.slideDown(150); - commentBlock.show(); + + if(animate) { + commentBlock.fadeIn(150); + } else { + commentBlock.show(); + } } } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index bd8c0ac6c..542d0821c 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -4,18 +4,18 @@ @font-face - :font-family 'BrandonGrotesqueLightRegular' :src url('brandongrotesque_light/Brandon_light-webfont.eot') :src local('☺'), url('brandongrotesque_light/Brandon_light-webfont.woff') format('woff'), url('brandongrotesque_light/Brandon_light-webfont.ttf') format('truetype'), url('brandongrotesque_light/Brandon_light-webfont.svg#webfont') format('svg') - font + :font + :family 'BrandonGrotesqueLightRegular' :weight normal :style normal body - :padding 2em :margin 0 :background-color rgb(252,252,252) + a :color #107FC9 :text @@ -36,6 +36,15 @@ h4 ol, ul :list-style none +form + :position relative + input, + textarea, + label + :font + :size 14px + + .hidden :display none @@ -177,9 +186,6 @@ header :top 5px :right 0 - :list - :style none - a :padding :right 15px @@ -229,7 +235,6 @@ header :margin 0 :padding 0 > li - :list-style none :padding 12px :min-height 50px :border @@ -282,8 +287,6 @@ header :display inline :margin 0 :padding 0 - :list - :style none li :display inline &:after @@ -449,9 +452,6 @@ li.message :background :color #fafafa - :list - :style none - :border 5px solid #333 :text-shadow 0 2px #fff @@ -487,14 +487,6 @@ li.message :color #ccc -form - :position relative - input, - textarea, - label - :font - :size 14px - #user_name :margin :bottom 20px @@ -524,7 +516,6 @@ form :display inline :margin 0 :padding 0 - :list-style none > li :display inline @@ -566,7 +557,6 @@ ul.comments :margin 0 :top 1em :padding 0 - :list-style none :background :color rgba(10,81,109,0.05) @@ -621,7 +611,6 @@ ul.comments :margin :bottom 0 ul - :list-style-type none :margin 0 :padding 0 @@ -676,7 +665,6 @@ li.message:hover :position absolute :right 0 :display inline - :list-style none :margin 0 :padding 0 @@ -859,7 +847,6 @@ label img :border-radius 5px - textarea :height 42px @@ -922,104 +909,22 @@ label :top 5px -#image_picker - :margin - :top 5px - .small_photo - :height 100px - :position relative - :display inline-block - :margin - :right 1em - :bottom 1em - - img - :-moz-border-radius 3px - :-webkit-border-radius 3px - :border-radius 3px - - input[type='checkbox'] - :position absolute - - .selected - :-webkit-box-shadow 0 3px 6px #000 - :-moz-box-shadow 0 3px 6px #000 - :border 1px solid #fff - - .field_with_submit input[type='text'] :width 82% :display inline -h1.big_text - :position relative - :line-height auto - :border - :bottom 1px solid #666 - .right - :top -6px - -#content_bottom - .right - :top -5px - -.right - :display inline - :float right - - form - :margin - :right 0 - :top 0 - -.back - :font - :size 12px - :weight normal - -#content_bottom - :position relative - :line-height 36px - - :margin 0 - :top 25px - :bottom 25px - - :min-height 36px - - :border - :top 1px solid #999 - :bottom 2px solid #eee - -.show_post_comments ul.comments - :width 100% - -.sub_header - :position relative - :text - :align center - :font - :style italic - :margin - :bottom 20px - :color #999 - -.image_thumb - :display inline-block - :width 100px - :min-width 100px - :height 100px - :min-height 100px - - img - :height 100px +#thumbnails + a + :display inline-block :width 100px + :min-width 100px + :height 100px + :min-height 100px - -.image_cycle - img - :display none + img + :height 100px + :width 100px #aspect_nav :margin @@ -1028,17 +933,9 @@ h1.big_text :font :family 'Arial', 'Helvetica', sans-serif - #aspect_manage_button - :display inline - - a - :color #999 - ul :margin 0 :padding 0 - :list - :style none > li :padding 0 @@ -1140,8 +1037,6 @@ h1.big_text :display inline :padding 0 :margin 0 - :list - :style none li :display inline :margin @@ -1153,8 +1048,6 @@ h1.big_text .aspect, .requests, .aspect_remove - :list - :style none :color #999 :cursor default :text-shadow 0 1px #fff @@ -1169,8 +1062,6 @@ h1.big_text :-moz-border-radius 10px :border-radius 10px - :list - :style none :padding 15px :border 2px dashed #ccc @@ -1209,6 +1100,9 @@ h1.big_text :-moz-border-radius 5px :border-radius 5px + a:hover + :cursor move + &:hover .delete :display inline @@ -1268,8 +1162,6 @@ h1.big_text ul#settings_nav :display inline - :list - :style none :padding 0 :font :size large @@ -1313,13 +1205,9 @@ ul#settings_nav :margin 0 :padding 0 -#edit_aspect_pane - :margin - :top 12px #left_pane.everyone, #edit_aspect_pane - :background :color rgb(250,250,250) :border 1px solid #ddd @@ -1333,13 +1221,27 @@ ul#settings_nav :border :bottom 1px solid #666 +#edit_aspect_pane + h4 + :font + :weight bold + :text + :shadow 0 1px #fff + + :margin + :top 12px + :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#FBFBFB), to(#F5F5F5)) + + :border 1px solid #eee + :top 1px solid #fff + :bottom 1px solid #fff + .floating.empty_message :margin :bottom 24px :text :align center - :padding 2em :bottom 0.7em @@ -1437,35 +1339,9 @@ input[type="search"] :color #999 -ul#breadcrumb - :list - :style none - :margin 0 - :padding 0 - :font - :size 14px - :weight bold - :line - :height 3em - - a - :font - :weight bold - - > li - :display inline - - &:after - :content ' ››' - - &:last-child - &:after - :content '' - ul.aspects :margin 0 :padding 0 - :list-style none :color #999 :font :size 24px @@ -1561,8 +1437,6 @@ ul.aspects .inline_aspect_listing :margin 0 :padding 0 - :list - :style none :display inline > li :display inline @@ -1696,7 +1570,6 @@ h3 span.current_gs_step ul#request_result - :list-style none :padding 0 :margin 0 li @@ -1733,8 +1606,6 @@ ul#request_result :width 100% :margin 0 :padding 0 - :list - :style none > li :display block @@ -1800,8 +1671,6 @@ footer ul#footer_nav :margin 0 :padding 0 - :list - :style none > li :display inline @@ -1824,8 +1693,6 @@ footer ul#landing_nav :margin 0 :padding 0 - :list - :style none :top 30px @@ -1979,8 +1846,6 @@ ul#press_logos :margin 0 :top 100px :padding 0 - :list - :style none > li :display inline :margin @@ -2077,8 +1942,10 @@ h3,h4 :-moz-border-radius 10px :border-radius 10px - :width 15px + :width 12px + :height 12px :max-width 12px + :max-height 12px :text :indent 4px