broke out dropdown into its own partial. aspect dropdown on person show. user menu fixed
This commit is contained in:
parent
7893129435
commit
4280417e41
10 changed files with 101 additions and 109 deletions
|
|
@ -3,7 +3,7 @@
|
|||
# the COPYRIGHT file.
|
||||
|
||||
class PeopleController < ApplicationController
|
||||
helper :comments
|
||||
helper :comments, :aspects
|
||||
before_filter :authenticate_user!, :except => [:show]
|
||||
|
||||
respond_to :html
|
||||
|
|
|
|||
19
app/views/contacts/_aspect_dropdown.html.haml
Normal file
19
app/views/contacts/_aspect_dropdown.html.haml
Normal file
|
|
@ -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)
|
||||
|
||||
|
|
@ -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)
|
||||
|
||||
= render 'aspect_dropdown', :contact => contact, :hang => 'right'
|
||||
|
||||
%br
|
||||
%div{:style => "text-align:right;"}
|
||||
|
|
|
|||
|
|
@ -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;"}
|
||||
|
||||
- if user_signed_in?
|
||||
%br
|
||||
= render 'contacts/aspect_dropdown', :contact => @contact, :hang => 'left'
|
||||
|
||||
-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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
:font
|
||||
:style normal
|
||||
:weight bold
|
||||
:family 'helvetica', sans-serif
|
||||
|
||||
:display inline
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue