Commit c63319f1 authored by danielvincent's avatar danielvincent

aspect#show cleanup. added 3 icons.

parent 21a90656
......@@ -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
......@@ -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
......
......@@ -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
......
......@@ -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();
......
......@@ -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."
......
......@@ -1257,6 +1257,10 @@ ul#settings_nav
:margin 0
:padding 0
#edit_aspect_pane
:margin
:top 12px
#left_pane.everyone,
#edit_aspect_pane
......@@ -1648,7 +1652,9 @@ ul#request_result
.contact_list
:height 300px
:max-height 300px
:overflow auto
:overflow-y auto
:overflow-x hidden
:border 2px solid #eee
......@@ -1686,11 +1692,11 @@ ul#request_result
&:hover
:background
:color rgb(250,250,250)
:color rgb(245,245,245)
.right
:top 8px
:right 6px
:right 8px
:top 2px
.avatar
:height 22px
......@@ -1702,12 +1708,22 @@ ul#request_result
:padding
:left 30px
a
&.add
:color green
a.button
:padding
:right 4px
:left 4px
&.added
:background -webkit-gradient( linear, left bottom, left top, color-stop(0, rgb(92,199,86)), color-stop(1, rgb(158,255,153)))
:background -moz-linear-gradient(top, rgb(158,255,153), rgb(92,199,86))
&.remove
:color red
&.added.remove
:background -webkit-gradient( linear, left bottom, left top, color-stop(0, rgb(199,86,86)), color-stop(1, rgb(255,153,153)))
:background -moz-linear-gradient(top, rgb(255,153,153), rgb(199,86,86))
&:active
:background -webkit-gradient( linear, left bottom, left top, color-stop(0, rgb(130,55,55)), color-stop(1, rgb(199,119,119)))
:background -moz-linear-gradient(top, rgb(199,119,119), rgb(130,55,55))
footer
:margin
......@@ -1932,6 +1948,10 @@ h3,h4
.big_buttons
input
:width 100%
:padding
:top 10px
:bottom 10px
:color #666
#original_post_info
p
......@@ -1974,3 +1994,7 @@ h3,h4
&:hover
:background
:color #107FC9
#edit_aspect_trigger
:font
:size 12px
......@@ -49,6 +49,12 @@
:top 1px solid #333
:bottom 1px solid #888
img
:position relative
:height 20px
:width 20px
:top 6px
ul.button_set
:padding
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment