cleaned up right pane on aspects#all. moved edit_contacts_pane out to a partial -- translation locations need updating.

This commit is contained in:
danielvincent 2010-11-25 22:11:42 -05:00
parent b56af997cb
commit 7c6d5b8d27
13 changed files with 112 additions and 87 deletions

View file

@ -86,10 +86,6 @@ module ApplicationHelper
end
end
def new_request(request_count)
"new_requests" if request_count > 0 #Should not be Il8ned
end
def post_yield_tag(post)
(':' + post.id.to_s).to_sym
end
@ -184,6 +180,6 @@ module ApplicationHelper
end
def info_text(text)
"<span class='what_is_this' title='#{text}'>?</span>".html_safe
image_tag 'icons/monotone_question.png', :class => 'what_is_this', :title => text
end
end

View file

@ -3,4 +3,19 @@
# the COPYRIGHT file.
module RequestsHelper
def new_request?(request_count)
'new_requests' if request_count > 0
end
def new_request_link(request_count)
if request_count > 0
if request_count > 1
link_to t('.new_requests', :count => @request_count), aspects_manage_path
else
link_to t('.new_request', :count => @request_count), aspects_manage_path
end
end
end
end

View file

@ -16,6 +16,8 @@ module SocketsHelper
v = render_to_string(:partial => 'shared/stream_element', :locals => {:post => object, :current_user => user})
elsif object.is_a? Person
v = render_to_string(:partial => type_partial(object), :locals => {:single_aspect_form => opts[:single_aspect_form], :person => object, :aspects => user.aspects, :current_user => user})
elsif object.is_a? Comment
v = render_to_string(:partial => type_partial(object), :locals => {:comment => object, :person => object.person, :current_user => user})
else
v = render_to_string(:partial => type_partial(object), :locals => {:post => object, :current_user => user}) unless object.is_a? Retraction
end

View file

@ -0,0 +1,15 @@
-# Copyright (c) 2010, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
#edit_aspect_pane
- if @contacts.count > 0
%h4= t('.add_existing')
= render 'shared/contact_list', :aspect => aspect, :contacts => contacts, :manage => defined?(manage)
= render 'shared/add_contact', :aspect => aspect
%hr
.big_buttons
= button_to t('.remove_aspect'), aspect, :method => "delete", :confirm => t('.confirm_remove_aspect')

View file

@ -7,7 +7,7 @@
#section_header
%h2=t('.manage_aspects')
.right
.right{:style=>"top:0;"}
= link_to("+ #{t('.add_a_new_aspect')}", "#add_aspect_pane", :class => "new_aspect add_aspect_button button", :title => t('.add_a_new_aspect'))
.span-4.append-1.last

View file

@ -35,7 +35,7 @@
#aspect_nav
%ul
%li{:class => ("selected" if @aspect == :all)}
= link_to ((@request_count == 0)? t('_home') : "#{t('_home')} (#{@request_count})"), root_path, :class => new_request(@request_count)
= link_to ((@request_count == 0)? t('_home') : "#{t('_home')} (#{@request_count})"), root_path, :class => new_request?(@request_count)
- for aspect in @aspects
%li{:class => ("selected" if current_aspect?(aspect))}

View file

@ -6,7 +6,7 @@
.span-24.last
#author_info
.from{:style=>"padding-left:0;display:block;"}
%h2
%h2{:style=>"display:block;"}
= @person.real_name
.right{:style => "top:0;"}
%span.description

View file

@ -13,7 +13,7 @@
= submit_tag t('.create_request')
%p{:style => "margin:12px 0 24px 0px;color:#999;text-align:center;"}
= t '.your_diaspora_username_is', :diaspora_handle => current_user.diaspora_handle
= t('.your_diaspora_username_is', :diaspora_handle => current_user.diaspora_handle)
#loader.hidden
= image_tag 'ajax-loader.gif'

View file

@ -40,7 +40,6 @@
}
};
- if aspect != :all && aspect.contacts.count == 0
:javascript
$(document).ready(function(){
@ -50,28 +49,14 @@
- if (aspect == :all) && @request_count > 0
#new_request_pane{:class => "everyone"}
%h1.new_request{:style => 'text-align:center'}
- if @request_count > 1
= link_to t('.new_requests', :count => @request_count), aspects_manage_path
- else
= link_to t('.new_request', :count => @request_count), aspects_manage_path
= new_request_link(@request_count)
#left_pane{:class => ("everyone" if aspect == :all)}
- if aspect == :all
%h2= t('.all_contacts')
%h3= t('.all_contacts')
- unless aspect == :all
#edit_aspect_pane
- if @contacts.count > 0
%h4= t('.add_existing')
= render 'shared/contact_list', :aspect => aspect, :contacts => @contacts, :manage => defined?(manage)
= render 'shared/add_contact', :aspect => aspect
%hr
.big_buttons
= button_to t('.remove_aspect'), aspect, :method => "delete", :confirm => t('.confirm_remove_aspect')
.contact_pictures
.section.contact_pictures
- for contact in contacts
= person_image_link(contact.person)
@ -81,37 +66,29 @@
= form_tag(people_path, :method => 'get') do
= text_field_tag 'q', nil, :placeholder => t('search'), :type => 'search', :results => 5
-if aspect == :all
%br
%br
%br
%br
%h3{:style=>"position:relative;"}
-if aspect == :all
.section.aspect_listings
%h3
= link_to(t('.aspects'), aspects_manage_path)
.right{:style=>"font-size:12px;top:7px;"}
= link_to t('.add_aspect'), '#add_aspect_pane', :class => "add_aspect_button"
- for user_aspect in current_user.aspects
%div{:style=>"border-bottom:1px solid #eee;padding:6px;"}
%h4.aspect_title_right{:style => "margin-bottom:0;"}
= link_to user_aspect, user_aspect
%span{:style=>"font-size:12px;color:#888;"}
= "#{user_aspect.contacts.count} #{t('.contacts')}"
- if user_aspect.contacts.count > 0
- for aspect_contact in user_aspect.contacts[0..7]
= person_image_link(aspect_contact.person)
.clearfix
%br
%br
%br
%br
%ul
- for user_aspect in current_user.aspects
%li
%h4
= link_to user_aspect, user_aspect
%span
= "#{user_aspect.contacts.count} #{t('.contacts')}"
- if user_aspect.contacts.count > 0
- for aspect_contact in user_aspect.contacts[0..7]
= person_image_link(aspect_contact.person)
.section
%h3= t('.invites')
= render "shared/invitations", :invites => @invites
-else
= render 'aspects/edit_aspect_pane', :aspect => aspect, :contacts => @contacts

View file

@ -7,3 +7,4 @@
= render "invitations/new"
- else
= t('.dont_have_now')

View file

@ -83,10 +83,7 @@ en:
done_editing: "done editing"
new_requests: "%{count} new requests!"
new_request: "%{count} new request!"
add_existing: "Add an existing contact"
contacts: "contacts"
remove_aspect: "Remove Aspect"
confirm_remove_aspect: "Remove aspect?"
no_contacts: "You currently have no contacts. Find your contacts here."
aspects: "Aspects"
add_aspect: "add aspect"
@ -163,6 +160,10 @@ en:
work: "Work"
index:
handle_explanation: "This is your diaspora handle. Like an email address, you can give this to people to reach you."
edit_aspect_pane:
remove_aspect: "Remove Aspect"
confirm_remove_aspect: "Remove aspect?"
add_existing: "Add an existing contact"
users:
edit:
export_data: "Export Data"

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

View file

@ -28,6 +28,7 @@ a
h1, h2, h3, h4
:color #444
:position relative
h4
:margin
@ -1176,16 +1177,13 @@ ul#settings_nav
a
:padding 2px
.settings_pane
:display none
#fancybox-close:hover
:background
:color transparent
.contact_pictures
:margin
:top 12px
@ -1220,23 +1218,55 @@ ul#settings_nav
h2,h3
:border
:bottom 1px solid #666
:bottom 1px solid #999
#edit_aspect_pane
h4
h2,h3,h4
:font
:weight bold
:text
:shadow 0 1px #fff
h4 > span
:font
:weight normal
:size 12px
:color #999
.avatar
:margin-right -1px
:width 30px
:height 30px
#edit_aspect_pane
:margin
:top 12px
:background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#FBFBFB), to(#F5F5F5))
:background -moz-linear-gradient(top, #FBFBFB, #F5F5F5)
:border 1px solid #eee
:top 1px solid #fff
:bottom 1px solid #fff
#left_pane.everyone
.aspect_listings
a
:font
:weight bold
.section
:margin
:bottom 24px
.aspect_listings
ul
:padding 0
:margin 0
> li
:padding 6px
:border
:bottom 1px solid #ddd
.floating.empty_message
:margin
:bottom 24px
@ -1598,6 +1628,9 @@ ul#request_result
:margin
:bottom 1.5em
:-webkit-box-shadow 0 1px #fff
:-moz-box-shadow 0 1px #fff
input.contact_list_search
:width 100%
:margin
@ -1651,8 +1684,14 @@ ul#request_result
&: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))
#edit_aspect_pane .contact_list
.avatar
:height 22px
:width 22px
:position absolute
:top 6px
footer
:margin
:top 40px
@ -1930,32 +1969,11 @@ h3,h4
:border-radius 5px
.what_is_this
:display inline-block
:cursor default
:font
:size 8px
:color #fff
:background
:color #ccc
:-webkit-border-radius 10px
:-moz-border-radius 10px
:border-radius 10px
:width 12px
:height 12px
:max-width 12px
:max-height 12px
:text
:indent 4px
:position relative
:top -4px
:top 3px
&:hover
:background
:color #107FC9
:opacity 0.5
#edit_aspect_trigger
:font