diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index d0b530aae9d557d095e43209310e95bd2e30c6c6..724ce994eafad20fa0e77bcf1d521f907de5c404 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. class PeopleController < ApplicationController - helper :comments + helper :comments, :aspects before_filter :authenticate_user!, :except => [:show] respond_to :html diff --git a/app/views/contacts/_aspect_dropdown.html.haml b/app/views/contacts/_aspect_dropdown.html.haml new file mode 100644 index 0000000000000000000000000000000000000000..6358a119f00b2b820c3e359a32b02df0bfe69aef --- /dev/null +++ b/app/views/contacts/_aspect_dropdown.html.haml @@ -0,0 +1,19 @@ +-# Copyright (c) 2011, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + +.dropdown{:class => "hang_#{hang}"} + .button.toggle + = t('.toggle', :count => contact.aspects.size) + ▼ + + .wrapper + %ul.dropdown_list{:unSelectable => 'on'} + - for aspect in @all_aspects + %li{:data => {:aspect_id => aspect.id}} + = check_box_tag "in_aspect", "in_aspect", aspect.contacts.include?(contact) + = aspect.name + + .hidden + = aspect_membership_button(aspect, contact, contact.person) + diff --git a/app/views/contacts/sharing.haml b/app/views/contacts/sharing.haml index 38675042c66cfb37fc83447cc9540312156708c2..1522d1300a51df96289b516218e85a677accc915 100644 --- a/app/views/contacts/sharing.haml +++ b/app/views/contacts/sharing.haml @@ -24,23 +24,9 @@ = link_to contact.person.name, contact.person .description = contact.person.diaspora_handle - .right - - .dropdown - .button.toggle - Add to aspect - ▼ - - .wrapper - %ul.dropdown_list{:unSelectable => 'on'} - - for aspect in @all_aspects - %li{:data => {:aspect_id => aspect.id}} - = check_box_tag "yo", "hey", aspect.contacts.include?(contact) - = aspect.name - - .hidden - = aspect_membership_button(aspect, contact, contact.person) + .right + = render 'aspect_dropdown', :contact => contact, :hang => 'right' %br %div{:style => "text-align:right;"} diff --git a/app/views/people/_profile_sidebar.html.haml b/app/views/people/_profile_sidebar.html.haml index d4455fa7847f97bcfe091f28aa2803336e9099c6..f22bc62389ed8cd6762a5113c6780d3739df3a19 100644 --- a/app/views/people/_profile_sidebar.html.haml +++ b/app/views/people/_profile_sidebar.html.haml @@ -18,56 +18,43 @@ .profile_photo = person_image_link(person, :size => :thumb_large, :to => :photos) - - if user_signed_in? && person == current_user.person - %p - = link_to t('people.profile_sidebar.edit_my_profile'), edit_profile_path + - if user_signed_in? + - if person == current_user.person + %p + = link_to t('people.profile_sidebar.edit_my_profile'), edit_profile_path - %hr{:style=>"width:300px;"} - - %ul - - if user_signed_in? && contact.receiving? - %li - = render :partial => 'people/aspect_list', - :locals => {:person => person, - :contact => contact, - :aspects_with_person => @aspects_with_person, - :aspects_without_person => @all_aspects.reject{ |aspect| @aspects_with_person.include?(aspect)}} - %br %hr{:style=>"width:300px;"} + + %br + = render 'contacts/aspect_dropdown', :contact => @contact, :hang => 'left' - - if user_signed_in? + -if contact.sharing? || person == current_user.person %br - - if contact.sharing? - %h4 - #{person.name} is sharing with you. - - elsif contact.receiving? - %h4 - You are sharing with #{person.name} - - -if user_signed_in? && (contact.sharing? || person == current_user.person) - %ul#profile_information - - unless person.profile.bio.blank? - %li - %h4 - =t('.bio') - %div{ :class => direction_for(person.profile.bio) } - = markdownify(person.profile.bio, :newlines => true) - - unless person.profile.location.blank? - %li - %h4 - =t('.location') - %div{ :class => direction_for(person.profile.location) } - = markdownify(person.profile.location, :newlines => true) - - %li.span-8.last - .span-4 - - unless person.profile.gender.blank? + %br + %hr{:style=>"width:300px;"} + %ul#profile_information + - unless person.profile.bio.blank? + %li %h4 - =t('.gender') - = person.profile.gender - - .span-4.last - - unless person.profile.birthday.blank? + =t('.bio') + %div{ :class => direction_for(person.profile.bio) } + = markdownify(person.profile.bio, :newlines => true) + - unless person.profile.location.blank? + %li %h4 - =t('.born') - = birthday_format(person.profile.birthday) + =t('.location') + %div{ :class => direction_for(person.profile.location) } + = markdownify(person.profile.location, :newlines => true) + + %li.span-8.last + .span-4 + - unless person.profile.gender.blank? + %h4 + =t('.gender') + = person.profile.gender + + .span-4.last + - unless person.profile.birthday.blank? + %h4 + =t('.born') + = birthday_format(person.profile.birthday) diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index 80d070501887edd96db26c7ef58adf96ef8fe42c..55eb45b7ab04f985023fca183ee276d6d80c24e0 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -25,28 +25,11 @@ .span-15.last #author_info - - if user_signed_in? - - if !@contact.receiving? - .right - = link_to t('.start_sharing'), - {:controller => "contacts", - :action => "new", - :person_id => @person.id}, - :class => 'share_with button', - :rel => 'facebox' - - if @share_with - = javascript_tag "$(document).ready(function() {jQuery.facebox({ ajax: '#{new_contact_path(:person_id => @person.id)}' });});" - - - elsif @contact - .right - = link_to t('.mention'), new_status_message_path(:person_id => @person.id), :class => 'button', :rel => 'facebox' - - if @contact.mutual? - = link_to t('.message'), new_conversation_path(:contact_id => @contact.id, :name => @contact.person.name, :contact_id => @contact.id), :class => 'button', :rel => 'facebox' - - /- if @post_type == :photos - / = link_to t('layouts.header.view_profile'), person_path(@person) - /- else - / = link_to t('_photos'), person_photos_path(@person) + - if user_signed_in? && @contact && @contact.receiving? + .right + = link_to t('.mention'), new_status_message_path(:person_id => @person.id), :class => 'button', :rel => 'facebox' + - if @contact.mutual? + = link_to t('.message'), new_conversation_path(:contact_id => @contact.id, :name => @contact.person.name, :contact_id => @contact.id), :class => 'button', :rel => 'facebox' %h3 = @person.name diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index ecd3f786699c8bbf084c7d77bd82c2e6e99cb1c1..7da244552af1e74753fa47b1df0d273b7b748eaa 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -179,6 +179,14 @@ en: add_new_aspect: "add to new aspect" create: failure: "Failed to create contact" + aspect_dropdown: + add_to_aspect: "Add to aspect" + toggle: + zero: "Add to aspect" + one: "In %{count} aspect" + few: "In %{count} aspects" + many: "In %{count} aspects" + other: "In %{count} aspects" conversations: index: @@ -371,7 +379,6 @@ en: message: "Message" mention: "Mention" profile_sidebar: - remove_contact: "remove contact" edit_my_profile: "Edit my profile" bio: "bio" location: "location" diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 8bf203fbcf5eb9d43f086231f7e7677fd4c40569..423aa97210815e1112d366e104be57b0029bb94d 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -35,11 +35,11 @@ var View = { /* Submit the form when the user hits enter */ .keypress(this.search.keyPress); - /* Getting started animation */ - $(this.gettingStarted.selector) - .live("click", this.gettingStarted.click); - /* User menu */ + $(this.userMenu.selector) + .click(this.userMenu.click); + + /* Dropdowns */ $(this.dropdowns.selector) .live('click', this.dropdowns.click); @@ -119,18 +119,6 @@ var View = { }, - gettingStarted: { - click: function() { - var $this = $(this); - $this.animate({ - left: parseInt($this.css("left"), 30) === 0 ? -$this.outerWidth() : 0 - }, function() { - $this.css("left", "1000px"); - }); - }, - selector: ".getting_started_box" - }, - newRequest: { submit: function() { $(this).hide().parent().find(".stream_element").removeClass("hidden"); @@ -240,6 +228,20 @@ var View = { parentSelector: ".dropdown > .wrapper" }, + userMenu: { + click: function(evt) { + $(this).parent().toggleClass("active"); + evt.preventDefault(); + }, + removeFocus: function(evt) { + var $target = $(evt.target); + if(!$target.closest("#user_menu").length || ($target.attr('href') != undefined && $target.attr('href') != '#')) { + $(View.userMenu.selector).parent().removeClass("active"); + } + }, + selector: "#user_menu li:first-child" + }, + webFingerForm: { submit: function(evt) { $(evt.currentTarget).siblings("#loader").show(); diff --git a/public/stylesheets/blueprint/screen.css b/public/stylesheets/blueprint/screen.css index 46ca92b197cde551e4612f3a0289f4117952d5a8..0c3b45f6f45cad33b4a7acc2d73a85f5ba7ada33 100644 --- a/public/stylesheets/blueprint/screen.css +++ b/public/stylesheets/blueprint/screen.css @@ -24,7 +24,7 @@ a img {border:none;} /* typography.css */ html {font-size:100.01%;} -body {font-size:75%;color:#222;background:#fff;font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;} +body {font-size:75%;color:#222;background:#fff;font-family:"Helvetica", Arial, sans-serif;} h1, h2, h3, h4, h5, h6 {font-weight:normal;color:#111;} h1 {font-size:3em;line-height:1;margin-bottom:0.5em;} h2 {font-size:2em;margin-bottom:0.75em;} @@ -255,4 +255,4 @@ hr {background:#ddd;color:#ddd;clear:both;float:none;width:100%;height:.1em;marg hr.space {background:#fff;color:#fff;visibility:hidden;} .clearfix:after, .container:after {content:"\0020";display:block;height:0;clear:both;visibility:hidden;overflow:hidden;} .clearfix, .container {display:block;} -.clear {clear:both;} \ No newline at end of file +.clear {clear:both;} diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 8b49dabc59ec6ea59a92c2a0e75a6eba0e3787ae..287c1b21554c61c8dcbd5cd29511efec74bb0bd5 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -249,12 +249,15 @@ ul.dropdown ////////////////////////////////// .dropdown + :position relative + :display inline-block + .button :width 240px .wrapper + :z-index 20 :position absolute - :right 4px :display none :width 140px :padding 2px 0 @@ -275,6 +278,14 @@ ul.dropdown :display inline :top 1px + &.hang_right + .wrapper + :right 4px + + &.hang_left + .wrapper + :left 0px + &.active .wrapper :display block @@ -814,8 +825,6 @@ a.paginate, #infscr-loading :padding 0 10px :font :size 16px - :font - :family 'MARKER FELT', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif :color #333 #debug_info diff --git a/public/stylesheets/sass/ui.sass b/public/stylesheets/sass/ui.sass index 31293f409bd81683adaa6d2546659c2dd12a4b0f..3f9fbe5b95dd4e6668c403b4d66e406e6962ad57 100644 --- a/public/stylesheets/sass/ui.sass +++ b/public/stylesheets/sass/ui.sass @@ -14,7 +14,6 @@ :font :style normal :weight bold - :family 'helvetica', sans-serif :display inline