aspect#show does not display search for contacts if user does not have any. aspect#index displays search box where all contact pictures go if user does not haveany contacts.
This commit is contained in:
parent
39f596462e
commit
6e603bf2af
5 changed files with 87 additions and 70 deletions
32
app/views/shared/_add_contact.html.haml
Normal file
32
app/views/shared/_add_contact.html.haml
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
-# Copyright (c) 2010, Diaspora Inc. This file is
|
||||||
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
|
|
||||||
|
%h3 Add a new contact
|
||||||
|
|
||||||
|
= 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 => "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'
|
||||||
|
%ul#request_result{:aspect_id => aspect.id}
|
||||||
|
%li.error.hidden
|
||||||
|
#message
|
||||||
|
= link_to "Know their email address? You should invite them", "#invite_user_pane", :class => "invite_user_button"
|
||||||
|
%br
|
||||||
|
.yo{ :style => "display:none;"}
|
||||||
|
#invite_user_pane
|
||||||
|
= render "invitations/new"
|
||||||
|
|
||||||
|
|
@ -4,26 +4,34 @@
|
||||||
|
|
||||||
- content_for :head do
|
- content_for :head do
|
||||||
:javascript
|
:javascript
|
||||||
$("#manage_aspect_trigger").live("click",
|
$("#edit_aspect_trigger").live("click",
|
||||||
function(){
|
function(){
|
||||||
if( $("#manage_aspect_pane").hasClass("active") ) {
|
if( $("#edit_aspect_pane").hasClass("active") ) {
|
||||||
managePaneFadeOut();
|
editPaneFadeOut();
|
||||||
} else {
|
} else {
|
||||||
managePaneFadeIn();
|
editPaneFadeIn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
managePaneFadeIn = function(){
|
editPaneFadeIn = function(){
|
||||||
$("#manage_aspect_pane").addClass("active");
|
|
||||||
|
var trigger = $("#edit_aspect_trigger");
|
||||||
|
|
||||||
|
$("#edit_aspect_pane").addClass("active");
|
||||||
$(".contact_pictures").fadeOut(200, function(){
|
$(".contact_pictures").fadeOut(200, function(){
|
||||||
$("#manage_aspect_pane").fadeIn(200);
|
$("#edit_aspect_pane").fadeIn(200);
|
||||||
|
trigger.html("done editing");
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
managePaneFadeOut = function(){
|
editPaneFadeOut = function(){
|
||||||
$("#manage_aspect_pane").removeClass("active");
|
|
||||||
$("#manage_aspect_pane").fadeOut(200, function(){
|
var trigger = $("#edit_aspect_trigger");
|
||||||
|
trigger.html("edit aspect");
|
||||||
|
|
||||||
|
$("#edit_aspect_pane").removeClass("active");
|
||||||
|
$("#edit_aspect_pane").fadeOut(200, function(){
|
||||||
$(".contact_pictures").fadeIn(200);
|
$(".contact_pictures").fadeIn(200);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -31,7 +39,7 @@
|
||||||
- if aspect != :all && aspect.contacts.count == 0
|
- if aspect != :all && aspect.contacts.count == 0
|
||||||
:javascript
|
:javascript
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
managePaneFadeIn();
|
editPaneFadeIn();
|
||||||
});
|
});
|
||||||
|
|
||||||
- if (aspect == :all) && @request_count > 0
|
- if (aspect == :all) && @request_count > 0
|
||||||
|
|
@ -46,60 +54,45 @@
|
||||||
- if aspect == :all
|
- if aspect == :all
|
||||||
%h2= t('.everyone')
|
%h2= t('.everyone')
|
||||||
- else
|
- else
|
||||||
%h2{:style=>"position:relative;"}
|
%h2{:style=>"position:relative;margin-bottom:0;"}
|
||||||
= aspect
|
= aspect
|
||||||
|
.right
|
||||||
|
= link_to "edit aspect", "#", :id => "edit_aspect_trigger", :class => "button"
|
||||||
|
|
||||||
|
%span{:style=>"color:#999;font-size:14px;"}
|
||||||
= aspect.contacts.count
|
= aspect.contacts.count
|
||||||
- if aspect.contacts.count == 1
|
- if aspect.contacts.count == 1
|
||||||
contact
|
contact
|
||||||
- else
|
- else
|
||||||
contacts
|
contacts
|
||||||
.right
|
|
||||||
= link_to "manage aspect", "#", :id => "manage_aspect_trigger", :class => "button"
|
|
||||||
|
|
||||||
- unless aspect == :all
|
- unless aspect == :all
|
||||||
#manage_aspect_pane
|
#edit_aspect_pane
|
||||||
%h3 Add an existing contact
|
- if @contacts.count > 0
|
||||||
= render 'shared/contact_list', :aspect => aspect, :contacts => @contacts, :manage => defined?(manage)
|
%h3 Add an existing contact
|
||||||
|
= render 'shared/contact_list', :aspect => aspect, :contacts => @contacts, :manage => defined?(manage)
|
||||||
|
|
||||||
%h3 Add a new contact
|
= render 'shared/add_contact', :aspect => aspect
|
||||||
= 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 => "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'
|
|
||||||
%ul#request_result{:aspect_id => aspect.id}
|
|
||||||
%li.error.hidden
|
|
||||||
#message
|
|
||||||
= link_to "Know their email address? You should invite them", "#invite_user_pane", :class => "invite_user_button"
|
|
||||||
%br
|
|
||||||
.yo{ :style => "display:none;"}
|
|
||||||
#invite_user_pane
|
|
||||||
= render "invitations/new"
|
|
||||||
|
|
||||||
|
%h3 Aspect settings
|
||||||
!= remove_link(aspect)
|
!= remove_link(aspect)
|
||||||
|
|
||||||
.contact_pictures
|
.contact_pictures
|
||||||
- for contact in contacts
|
- for contact in contacts
|
||||||
= person_image_link(contact.person)
|
= person_image_link(contact.person)
|
||||||
|
|
||||||
|
- if aspect == :all && @contacts.count == 0
|
||||||
|
%h4
|
||||||
|
You currently have no contacts. Find your contacts here.
|
||||||
|
= form_tag(people_path, :method => 'get') do
|
||||||
|
= text_field_tag 'q', nil, :placeholder => t('search'), :type => 'search', :results => 5
|
||||||
|
|
||||||
|
|
||||||
-if aspect == :all
|
-if aspect == :all
|
||||||
%br
|
%br
|
||||||
%br
|
%br
|
||||||
%br
|
%br
|
||||||
%br
|
%br
|
||||||
%br
|
|
||||||
|
|
||||||
%h3{:style=>"position:relative;"}
|
%h3{:style=>"position:relative;"}
|
||||||
Aspects
|
Aspects
|
||||||
|
|
@ -108,29 +101,24 @@
|
||||||
|
|
||||||
- for user_aspect in current_user.aspects
|
- for user_aspect in current_user.aspects
|
||||||
|
|
||||||
.aspectt
|
%div{:style=>"border-bottom:1px solid #eee;padding:6px;"}
|
||||||
%h4.aspect_title_right
|
%h4.aspect_title_right{:style => "margin-bottom:0;"}
|
||||||
= link_to user_aspect, user_aspect
|
= link_to user_aspect, user_aspect
|
||||||
|
|
||||||
%span{:style=>"font-size:12px;color:#888;"}
|
%span{:style=>"font-size:12px;color:#888;"}
|
||||||
= "#{user_aspect.contacts.count} contacts"
|
= "#{user_aspect.contacts.count} contacts"
|
||||||
|
|
||||||
- for aspect_contact in user_aspect.contacts[0..8]
|
- if user_aspect.contacts.count > 0
|
||||||
= person_image_link(aspect_contact.person)
|
- for aspect_contact in user_aspect.contacts[0..8]
|
||||||
|
= person_image_link(aspect_contact.person)
|
||||||
%br
|
|
||||||
%br
|
|
||||||
%br
|
|
||||||
|
|
||||||
.clearfix
|
.clearfix
|
||||||
|
|
||||||
%br
|
%br
|
||||||
|
%br
|
||||||
|
%br
|
||||||
|
%br
|
||||||
|
|
||||||
- if aspect == :all
|
%h3 Invites
|
||||||
%h3
|
%p invite people to join Diaspora.
|
||||||
Invites
|
= render "shared/invitations", :invites => @invites
|
||||||
|
|
||||||
%p invite people to join Diaspora.
|
|
||||||
|
|
||||||
= render "shared/invitations", :invites => @invites
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,10 +50,10 @@
|
||||||
%p.checkbox_select
|
%p.checkbox_select
|
||||||
= status.check_box( :public, {}, true, false )
|
= status.check_box( :public, {}, true, false )
|
||||||
= status.label :public, t('.make_public')
|
= status.label :public, t('.make_public')
|
||||||
= image_tag("social_media_logos/feed-16x16.png")
|
= image_tag "social_media_logos/feed-16x16.png", :title => "RSS"
|
||||||
- if current_user.services
|
- if current_user.services
|
||||||
- for service in current_user.services
|
- for service in current_user.services
|
||||||
= image_tag("social_media_logos/#{service.provider}-16x16.png")
|
= image_tag "social_media_logos/#{service.provider}-16x16.png", :title => service.provider
|
||||||
|
|
||||||
= link_to '(?)', "#question_mark_pane", :class => 'question_mark', :style=>"display:none;"
|
= link_to '(?)', "#question_mark_pane", :class => 'question_mark', :style=>"display:none;"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,7 @@ en:
|
||||||
everyone: "Everyone"
|
everyone: "Everyone"
|
||||||
add_to: "add to %{aspect}"
|
add_to: "add to %{aspect}"
|
||||||
add_a_new_contact_to: "Add a new contact to"
|
add_a_new_contact_to: "Add a new contact to"
|
||||||
|
add_contact:
|
||||||
enter_a_diaspora_username: "Enter a Diaspora username:"
|
enter_a_diaspora_username: "Enter a Diaspora username:"
|
||||||
your_diaspora_username_is: "Your Diaspora username is: %{diaspora_handle}"
|
your_diaspora_username_is: "Your Diaspora username is: %{diaspora_handle}"
|
||||||
contact_username: "Contact's username"
|
contact_username: "Contact's username"
|
||||||
|
|
|
||||||
|
|
@ -796,6 +796,7 @@ label
|
||||||
:margin 0
|
:margin 0
|
||||||
|
|
||||||
.options_and_submit
|
.options_and_submit
|
||||||
|
:display none
|
||||||
:min-height 21px
|
:min-height 21px
|
||||||
:position relative
|
:position relative
|
||||||
:padding
|
:padding
|
||||||
|
|
@ -1207,7 +1208,7 @@ ul#settings_nav
|
||||||
:padding 0
|
:padding 0
|
||||||
|
|
||||||
#left_pane.everyone,
|
#left_pane.everyone,
|
||||||
#manage_aspect_pane
|
#edit_aspect_pane
|
||||||
|
|
||||||
:background
|
:background
|
||||||
:color rgb(250,250,250)
|
:color rgb(250,250,250)
|
||||||
|
|
@ -1848,11 +1849,6 @@ h3,h4
|
||||||
:padding
|
:padding
|
||||||
:bottom 5px
|
:bottom 5px
|
||||||
|
|
||||||
.aspectt
|
|
||||||
h4
|
|
||||||
:margin
|
|
||||||
:bottom 0
|
|
||||||
|
|
||||||
#new_request_pane
|
#new_request_pane
|
||||||
:background
|
:background
|
||||||
:color red
|
:color red
|
||||||
|
|
@ -1868,7 +1864,7 @@ h3,h4
|
||||||
:font
|
:font
|
||||||
:weight bold
|
:weight bold
|
||||||
|
|
||||||
#manage_aspect_pane
|
#edit_aspect_pane
|
||||||
:-webkit-box-shadow 0 4px 8px #333
|
:-webkit-box-shadow 0 4px 8px #333
|
||||||
:-moz-box-shadow 0 4px 8px #333
|
:-moz-box-shadow 0 4px 8px #333
|
||||||
:box-shadow 0 4px 8px #333
|
:box-shadow 0 4px 8px #333
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue