aspect dropdown shows name of aspect if contact is only in one; green
This commit is contained in:
parent
2c4f835998
commit
4e48db23f0
9 changed files with 31 additions and 27 deletions
|
|
@ -3,8 +3,11 @@
|
|||
-# the COPYRIGHT file.
|
||||
|
||||
.dropdown{:class => "hang_#{hang}"}
|
||||
.button.toggle
|
||||
= t('.toggle', :count => contact.aspects.size)
|
||||
.button.toggle{:class => ("in_aspects" if contact.aspects.size > 0)}
|
||||
- if contact.aspects.size == 1
|
||||
= contact.aspects.first.name
|
||||
- else
|
||||
= t('.toggle', :count => contact.aspects.size)
|
||||
▼
|
||||
|
||||
.wrapper
|
||||
|
|
|
|||
|
|
@ -11,11 +11,12 @@
|
|||
%p
|
||||
= link_to t('people.profile_sidebar.edit_my_profile'), edit_profile_path
|
||||
|
||||
|
||||
- if person != current_user.person
|
||||
%hr{:style=>"width:300px;"}
|
||||
%br
|
||||
= render 'aspect_memberships/aspect_dropdown', :contact => @contact, :person => @person, :hang => 'left'
|
||||
- else
|
||||
- if @contact && @contact.receiving?
|
||||
%br
|
||||
= link_to t('people.show.mention'), new_status_message_path(:person_id => @person.id), :class => 'button', :rel => 'facebox'
|
||||
- if @contact.mutual?
|
||||
= link_to t('people.show.message'), new_conversation_path(:contact_id => @contact.id, :name => @contact.person.name), :class => 'button', :rel => 'facebox'
|
||||
%br
|
||||
%br
|
||||
-if contact.sharing? || person == current_user.person
|
||||
|
|
|
|||
|
|
@ -25,16 +25,15 @@
|
|||
|
||||
.span-15.last
|
||||
#author_info
|
||||
- if user_signed_in? && @contact && @contact.receiving?
|
||||
- if user_signed_in? && current_user.person != @person
|
||||
.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), :class => 'button', :rel => 'facebox'
|
||||
= render 'aspect_memberships/aspect_dropdown', :contact => @contact, :person => @person, :hang => 'left'
|
||||
|
||||
%h3
|
||||
= @person.name
|
||||
%span.diaspora_handle
|
||||
= @person.diaspora_handle
|
||||
%span.diaspora_handle
|
||||
= @person.diaspora_handle
|
||||
|
||||
.description
|
||||
- if !@person.profile.tag_string.blank? && user_signed_in? && (@contact.persisted? || @person == current_user.person || @incoming_request)
|
||||
= @person.profile.format_tags(@person.profile.tag_string)
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ Feature: sending and receiving requests
|
|||
When I sign in as "bob@bob.bob"
|
||||
And I am on "alice@alice.alice"'s page
|
||||
|
||||
Then I should see "In 1 aspect"
|
||||
Then I should see "Besties"
|
||||
Then I should see "Mention"
|
||||
Then I should not see "Message"
|
||||
|
||||
|
|
|
|||
|
|
@ -18,4 +18,4 @@ Feature: Interacting with tags
|
|||
When I add the person to my 1st aspect
|
||||
|
||||
When I search for "#rockstar"
|
||||
Then I should see "In 1 aspect"
|
||||
Then I should see "generic"
|
||||
|
|
|
|||
|
|
@ -12,14 +12,16 @@ var ContactEdit = {
|
|||
updateNumber: function(personId){
|
||||
var dropdown = $(".dropdown_list[data-person_id=" + personId.toString() +"]"),
|
||||
number = dropdown.find(".selected").length,
|
||||
element = dropdown.parents(".dropdown").children('.button.toggle');
|
||||
button = dropdown.parents(".dropdown").children('.button.toggle');
|
||||
|
||||
var replacement;
|
||||
|
||||
if (number == 0) {
|
||||
replacement = Diaspora.widgets.i18n.t("aspect_dropdown.toggle.zero") ;
|
||||
button.removeClass("in_aspects");
|
||||
replacement = Diaspora.widgets.i18n.t("aspect_dropdown.toggle.zero");
|
||||
}else if (number == 1) {
|
||||
replacement = Diaspora.widgets.i18n.t('aspect_dropdown.toggle.one', { count: number.toString()})
|
||||
button.addClass("in_aspects");
|
||||
replacement = dropdown.find(".selected").first().text();
|
||||
}else if (number < 3) {
|
||||
replacement = Diaspora.widgets.i18n.t('aspect_dropdown.toggle.few', { count: number.toString()})
|
||||
}else if (number > 3) {
|
||||
|
|
@ -29,7 +31,7 @@ var ContactEdit = {
|
|||
replacement = Diaspora.widgets.i18n.t('aspect_dropdown.toggle.other', { count: number.toString()})
|
||||
}
|
||||
|
||||
element.html(replacement + ' ▼');
|
||||
button.html(replacement + ' ▼');
|
||||
},
|
||||
|
||||
toggleCheckbox:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
$blue: #3f8fba;
|
||||
$red: red;
|
||||
$background: rgb(252, 252, 252);
|
||||
$background: #fff;
|
||||
|
||||
$speed: 0.1s;
|
||||
$easing: linear;
|
||||
|
|
|
|||
|
|
@ -38,9 +38,6 @@ h4
|
|||
h1
|
||||
:color #111
|
||||
|
||||
h3
|
||||
:color #777
|
||||
|
||||
ul > li
|
||||
:list-style none
|
||||
|
||||
|
|
@ -329,7 +326,7 @@ ul.dropdown
|
|||
#author_info
|
||||
:position relative
|
||||
|
||||
img
|
||||
.avatar img
|
||||
:position relative
|
||||
:top 0px
|
||||
:display inline-block
|
||||
|
|
@ -349,6 +346,7 @@ ul.dropdown
|
|||
:display inline-block
|
||||
:margin
|
||||
:bottom 10px
|
||||
:right 10px
|
||||
|
||||
&.show
|
||||
a
|
||||
|
|
@ -2798,9 +2796,7 @@ h1.tag
|
|||
:font
|
||||
:size 12px
|
||||
:weight normal
|
||||
:color #999
|
||||
:margin
|
||||
:left 6px
|
||||
:color #555
|
||||
|
||||
.add_tags
|
||||
:font
|
||||
|
|
|
|||
|
|
@ -65,6 +65,9 @@
|
|||
:border
|
||||
:top 1px solid #aaa
|
||||
|
||||
.button.in_aspects
|
||||
@include linear-gradient(lighten(#76C000,8%),#76C000)
|
||||
|
||||
.right
|
||||
:position absolute
|
||||
:right 0
|
||||
|
|
|
|||
Loading…
Reference in a new issue