DG RS left nav almost there. touched up publisher, among other things

This commit is contained in:
danielgrippi 2011-06-30 17:11:02 -07:00
parent d68c8a3a03
commit ca76db4550
16 changed files with 200 additions and 298 deletions

View file

@ -16,7 +16,7 @@ class ApplicationController < ActionController::Base
inflection_method :grammatical_gender => :gender
helper_method :all_aspects, :object_aspect_ids
helper_method :all_aspects, :object_aspect_ids, :all_contacts_count, :my_contacts_count, :only_sharing_count
def ensure_http_referer_is_set
request.env['HTTP_REFERER'] ||= '/aspects'
@ -46,6 +46,17 @@ class ApplicationController < ActionController::Base
end
end
def all_contacts_count
@all_contacts_count ||= current_user.contacts.count
end
def my_contacts_count
@my_contacts_count ||= current_user.contacts.receiving.count
end
def only_sharing_count
@only_sharing_count ||= current_user.contacts.only_sharing.count
end
def ensure_page
params[:page] = params[:page] ? params[:page].to_i : 1

View file

@ -8,10 +8,6 @@ class ContactsController < ApplicationController
def index
@aspect = :manage
@all_contacts_count = current_user.contacts.count
@my_contacts_count = current_user.contacts.receiving.count
@only_sharing_count = current_user.contacts.only_sharing.count
if params[:a_id]
@aspect_ = current_user.aspects.find(params["a_id"])
@contacts = @aspect_.contacts.includes(:aspects, :person => :profile).order('profiles.last_name ASC').paginate(:page => params[:page], :per_page => 25)

View file

@ -70,6 +70,14 @@ module AspectGlobalHelper
link_to aspect.name, aspects_path( opts[:params] ), opts
end
def aspect_listing_link_opts aspect
if controller.instance_of?(ContactsController)
{:href => contacts_path(:a_id => aspect.id)}
else
{:href => aspects_path("a_ids[]" => aspect.id), :class => "aspect_selector name hard_aspect_link", 'data-guid' => aspect.id}
end
end
def current_aspect?(aspect)
!@aspect.nil? && !@aspect.instance_of?(Symbol) && @aspect.id == aspect.id
end

View file

@ -2,26 +2,35 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
%h4
.right
= link_to t('contacts', :count => @contact_count), contacts_path , :title => t('contacts.index.your_contacts')
%ul#aspect_nav.left_nav
%li.all_aspects{:class => ("active" if params["set"] != "all" && params["set"] != "only_sharing")}
%a{:href => contacts_path, :class => ("sub_selected" if params["a_id"])}
.contact_count
= my_contacts_count
= t('contacts.index.my_contacts')
= t('aspects', :count => aspects.count)
%ul.sub_nav
- for aspect in all_aspects
%li{:class => ("active" if params["a_id"].to_i == aspect.id)}
%ul
- for aspect in aspects
= render 'aspects/aspect', :aspect => aspect, :contacts => aspect.contacts
%a{aspect_listing_link_opts(aspect)}
- if @contacts_sharing_with
%li#sharers{:class => ("dull" if @contacts_sharing_with.size == 0)}
.right
%b
= link_to t('contacts', :count => @contacts_sharing_with.size), sharing_contacts_path, :rel => 'facebox', :class => 'contact-count'
%b
= t('aspects.index.people_sharing_with_you')
%br
.contact_count
= aspect.contacts.size
= aspect
%li
= link_to "+ Add an aspect", "#add_aspect_pane", :class => "new_aspect", :rel => "facebox"
%li{:class => ("active" if params["set"] == "all" || params["set"] == "only_sharing")}
%a{:href => contacts_path(:set => "all"), :class => ("sub_selected" if params["set"] == "only_sharing")}
.contact_count
= all_contacts_count
= t('contacts.index.all_contacts')
%ul.sub_nav
%li{:class => ("active" if params["set"] == "only_sharing")}
%a{:href => contacts_path(:set => "only_sharing")}
.contact_count
= only_sharing_count
= t('contacts.index.only_sharing_with_me')
- if @contacts_sharing_with.size > 0
.contacts
- for contact in @contacts_sharing_with[0..15]
= person_image_link(contact.person)

View file

@ -2,13 +2,22 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
#aspect_stream_header
#sort_by
= t('.recently')
%span.controls
= link_to_if(session[:sort_order] == 'created_at', t('.commented_on'), aspects_path(:a_ids => params[:a_ids], :sort_order => 'updated_at'))
= link_to_if(session[:sort_order] == 'updated_at', t('.posted'), aspects_path(:a_ids => params[:a_ids], :sort_order => 'created_at' ))
%h3
- if @aspect == :all
Stream
- else
= @aspects.to_sentence
= render 'shared/publisher', :aspect => aspect, :aspect_ids => aspect_ids
#sort_by
= t('.sort_by')
= link_to_if(session[:sort_order] == 'created_at', t('.activity'), aspects_path(:a_ids => params[:a_ids], :sort_order => 'updated_at'))
|
= link_to_if(session[:sort_order] == 'updated_at', t('.post_time'), aspects_path(:a_ids => params[:a_ids], :sort_order => 'created_at' ))
#main_stream.stream{:data => {:guids => aspect_ids.join(',')}}
- if posts.length > 0
= render 'shared/stream', :posts => posts

View file

@ -5,26 +5,36 @@
- content_for :head do
= include_javascripts :home
.span-15.append-2
.span-5.leftNavBar
#home_user_badge
= owner_image_link
%h4{:style => "position:relative;"}
= current_user.first_name
.section
= render 'aspects/aspect_listings'
.span-13.append-1
#aspect_stream_container
= render 'aspect_stream',
:aspect => @aspect,
:aspect_ids => @aspect_ids,
:posts => @posts
.span-7.leftBar.last
#home_user_badge
= owner_image_link
%h3{:style => "position:relative;"}
= current_user.name
.description
= link_to current_user.diaspora_handle, person_path(current_user.person)
#aspect_listings.section
= render 'aspects/aspect_listings', :aspects => @aspects
.span-5.rightBar.last
.section
.title
= image_tag('/images/icons/bookmark.png')
%h5
Diaspora ID
.content
Your Diaspora ID is:
%b
= current_user.diaspora_handle
%br
%br
Give it to anyone and they'll be able to find you on Diaspora.
.section
.title
@ -55,3 +65,4 @@
.content
= render "shared/invitations", :invites => @invites

View file

@ -14,35 +14,7 @@
= t('.title')
.span-5.append-1
%ul#left_nav
%li{:class => ("active" if params["set"] != "all" && params["set"] != "only_sharing")}
%a{:href => contacts_path, :class => ("sub_selected" if params["a_id"])}
.contact_count
= @my_contacts_count
= t('.my_contacts')
%ul.sub_nav
- for aspect in all_aspects
%li{:class => ("active" if params["a_id"].to_i == aspect.id)}
%a{:href => contacts_path(:a_id => aspect.id)}
.contact_count
= aspect.contacts.count
= aspect
%li
= link_to "+ Add an aspect", "#add_aspect_pane", :class => "new_aspect", :rel => "facebox"
%li{:class => ("active" if params["set"] == "all" || params["set"] == "only_sharing")}
%a{:href => contacts_path(:set => "all"), :class => ("sub_selected" if params["set"] == "only_sharing")}
.contact_count
= @all_contacts_count
= t('.all_contacts')
%ul.sub_nav
%li{:class => ("active" if params["set"] == "only_sharing")}
%a{:href => contacts_path(:set => "only_sharing")}
.contact_count
= @only_sharing_count
= t('.only_sharing_with_me')
= render 'aspects/aspect_listings'
.span-18.last
#people_stream.stream.contacts

View file

@ -47,17 +47,6 @@
%li= link_to t('.logout'), destroy_user_session_path
-unless @landing_page
%ul#aspect_nav
%li{:class => ('selected' if @aspect == :all)}
= link_to t('all_aspects'), aspects_path, :class => 'home_selector'
- for aspect in (@all_aspects || all_aspects)
%li{:data=>{:guid=>aspect.id}, :class => ("selected" if (@object_aspect_ids || object_aspect_ids).include?(aspect.id))}
= link_for_aspect(aspect, :class => 'aspect_selector name', :title => t('contacts', :count => aspect.contacts.size))
%li
= link_to '+', '#add_aspect_pane', :class => "add_aspect_button", :title => t('contacts.index.add_a_new_aspect'), :rel => 'facebox'
.facebox_content
#add_aspect_pane
= render "aspects/new"

View file

@ -10,35 +10,26 @@
});
#publisher{:class => ((aspect == :profile)? 'mention_popup' : nil )}
#click_to_share
-unless aspect == :profile
= image_tag 'icons/doc_edit.png'
%span= t('.whats_on_your_mind')
= t('aspects', :count => aspect_ids.length)
.content_creation
= form_for(StatusMessage.new, :remote => true, :html => {"data-type" => "json"}) do |status|
- if @selected_contacts
= hidden_field_tag :contact_json, @selected_contacts.map{|contact| contact.person}.to_json
= status.error_messages
#file-upload
= image_tag 'icons/photos.png'
%br
= t('.add_photos')
%p
%params
#publisher_textarea_wrapper
%ul#photodropzone
= status.text_area :fake_text, :rows => 2, :value => h(params[:prefill]), :tabindex => 1
= status.text_area :fake_text, :rows => 2, :value => h(params[:prefill]), :tabindex => 1, :placeholder => t('.whats_on_your_mind')
= status.hidden_field :text, :value => '', :class => 'clear_on_submit'
- for aspect_id in aspect_ids
= hidden_field_tag 'aspect_ids[]', aspect_id.to_s
.options_and_submit
#file-upload
= image_tag 'icons/camera.svg', :height => 14
= t('.add_photos')
- if aspect == :profile
.mention_helper
.badges

View file

@ -98,9 +98,9 @@ en:
aspect_contacts:
done_editing: "done editing"
aspect_stream:
sort_by: "sort by:"
activity: "activity"
post_time: "post time"
recently: "recently:"
commented_on: "commented on"
posted: "posted"
show:
edit_aspect: "edit aspect"
no_posts_message:
@ -157,7 +157,7 @@ en:
other: "In %{count} aspects"
bookmarklet:
heading: "Diaspora Bookmarklet"
heading: "Bookmarklet"
post_success: "Posted! Closing!"
post_something: "Post something to Diaspora"
explanation: "Post to Diaspora from anywhere by bookmarking %{link}."

12
public/images/icons/camera.svg Executable file
View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="100px" height="71.86px" viewBox="0 0 100 71.86" enable-background="new 0 0 100 71.86" xml:space="preserve">
<path d="M50,25.057c-8.875,0-16.096,7.22-16.096,16.096c0,8.875,7.221,16.096,16.096,16.096c8.876,0,16.096-7.221,16.096-16.096
C66.096,32.277,58.876,25.057,50,25.057z"/>
<path d="M86.986,10.445H70.373C70.373,4.677,65.696,0,59.928,0H40.072c-5.769,0-10.445,4.677-10.445,10.445H13.014
C5.826,10.445,0,16.272,0,23.459v35.387C0,66.034,5.826,71.86,13.014,71.86h73.973c7.188,0,13.014-5.826,13.014-13.014V23.459
C100,16.272,94.174,10.445,86.986,10.445z M50,64.098c-12.652,0-22.945-10.294-22.945-22.945c0-12.652,10.293-22.945,22.945-22.945
s22.945,10.293,22.945,22.945C72.945,53.804,62.652,64.098,50,64.098z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -12,13 +12,14 @@ var AspectFilters = {
AspectFilters.interceptAspectNavLinks();
},
initializeSelectedGUIDS: function(){
$("#aspect_nav li").each(function(){
$("#aspect_nav .aspect_selector").each(function(){
var button = $(this),
guid = button.attr('data-guid');
if(guid && location.href.search("a_ids..="+guid+"(&|$)") != -1){
button.addClass('selected');
button.parent().addClass('active');
AspectFilters.selectedGUIDS.push(guid);
$("#aspect_nav li.all_aspects").removeClass('active');
}
});
},
@ -43,8 +44,8 @@ var AspectFilters = {
var guid = aspectLi.attr('data-guid');
// select correct aspect in filter list & deselect others
$("#aspect_nav li").removeClass('selected');
aspectLi.addClass('selected');
$("#aspect_nav li.active").removeClass('active');
aspectLi.addClass('active');
AspectFilters.fadeOut();
@ -62,19 +63,19 @@ var AspectFilters = {
// filtering //////////////////////
var $this = $(this),
listElement = $this.parent(),
guid = listElement.attr('data-guid'),
homeListElement = $("#aspect_nav a.home_selector").parent();
guid = $this.attr('data-guid'),
homeListElement = $("#aspect_nav li.all_aspects");
if( listElement.hasClass('selected') ){
if( listElement.hasClass('active') ){
// remove filter
var idx = AspectFilters.selectedGUIDS.indexOf( guid );
if( idx != -1 ){
AspectFilters.selectedGUIDS.splice(idx,1);
}
listElement.removeClass('selected');
listElement.removeClass('active');
if(AspectFilters.selectedGUIDS.length === 0){
homeListElement.addClass('selected');
homeListElement.addClass('active');
}
} else {
@ -82,9 +83,9 @@ var AspectFilters = {
if(AspectFilters.selectedGUIDS.indexOf( guid == 1)){
AspectFilters.selectedGUIDS.push( guid );
}
listElement.addClass('selected');
listElement.addClass('active');
homeListElement.removeClass('selected');
homeListElement.removeClass('active');
}
AspectFilters.performAjax(AspectFilters.generateURL());

View file

@ -71,12 +71,15 @@ var Stream = {
});
$("textarea.comment_box", this.selector).live("focus blur", function(evt) {
if (this.value === undefined || this.value === ''){
var commentBox = $(this);
commentBox
.attr("rows", (evt.type === "focus") ? 2 : 1)
.parent().parent()
.toggleClass("open");
}
});
},
setUpAudioLinks: function() {

View file

@ -63,7 +63,7 @@ var View = {
$('textarea')
.autoResize({
'animate': false,
'extraSpace': 40
'extraSpace': 5
});
}
Diaspora.widgets.subscribe("stream/scrolled", startAutoResize)

View file

@ -7,7 +7,7 @@
body
:padding 2em
:margin 0
:top 60px
:top 40px
:background-color $background
a
:color #107FC9
@ -22,14 +22,13 @@ a
p
:word-wrap break-word
h1, h2, h3, h4, h5
h1
:color #333
:position relative
:font
:weight bold
h1, h2, h3
:letter-spacing -1px
h4
:margin
@ -137,6 +136,7 @@ header
:padding 0
:top 2px
:color #CCC
:height 35px
:position absolute
@ -265,9 +265,9 @@ ul.dropdown
.diaspora_header_logo
:position relative
:top 4px
:top 5px
:margin
:right 1em
:right 49px
&:active
:top 5px
@ -370,7 +370,7 @@ ul.dropdown
:color #888
:font
:size 14px
:size 13px
a.author
:font
@ -391,7 +391,7 @@ ul.dropdown
:margin
:bottom 0px
:font
:size 13px
:size 12px
:line
:height 18px
@ -641,9 +641,12 @@ ul.show_comments,
:position relative
textarea
:width 100%
:width 365px
:height 1.4em
input
:display none
li
:list
:style none
@ -697,8 +700,6 @@ ul.show_comments,
:size 1em
:margin
:bottom -3px
:width 438px
:min-height 23px
p
:position relative
@ -715,8 +716,8 @@ ul.show_comments,
:top 5px
:bottom 2px
:right 2px
textarea
:min-height 2.4em
input
:display inline-block
.comments
.timeago
@ -816,11 +817,12 @@ a.paginate, #infscr-loading
input:not([type='submit']):not([type='reset']),
textarea
@include border-radius(3px)
@include border-radius(2px)
:font
:family 'Arial', 'Helvetica', sans-serif
:size 14px
:padding 0.3em
:display block
:width 100%
@ -875,29 +877,30 @@ label
:bottom 10px
:top 0
:padding 12px
:top 1px
:top 0
:top 0
:border
:bottom 2px #777 solid
:bottom 1px #eee solid
form
textarea
:height 18px !important
:width 474px
&.mention_popup
:padding 1px 12px
:margin
:bottom 0
:border
:bottom none
&.closed
.options_and_submit
:display none !important
#file-upload
:display none
form
textarea
:height 18px !important
.counter
:display none
form
@ -906,11 +909,10 @@ label
input[type='text'],
textarea
:width 435px
:margin 0
:width 395px
textarea
:border 1px solid $blue
:height 42px
label
@ -951,38 +953,13 @@ label
:margin
:top 1em
#click_to_share
:position relative
:padding 1em
:top 0
:margin
:bottom -16px
span
:margin
:left 12px
:font
:weight bold
:color #444
img
:display inline
:position absolute
:top 0
:left 0px
#file-upload
@include border-radius(3px)
:float left
:z-index 10
:float right
:height 42px
:width 103px
:margin 0
:top 2px
:border 2px solid #ccc
:background
:color #fafafa
:display inline-block
:padding 0.3em
:cursor pointer
@ -993,7 +970,7 @@ label
:text
:align center
:shadow 0 1px 0 #eee
:shadow none
img
@include opacity(0.4)
@ -1006,18 +983,18 @@ label
&:hover
:background
:color #eee
:color none
:cursor pointer
:color #666
img
@include opacity(0.6)
@include opacity(0.8)
&:active
:text-shadow 0 1px 0 #fafafa
:color #ccc
:color #444
img
@include opacity(0.1)
@include opacity(1)
&.loading
@include opacity(0.5)
@ -1121,84 +1098,6 @@ img.scaled_full
:height 100px
:width 100px
ul#aspect_nav
:margin
:top 3px
:bottom 2px
:bottom 0
:color #000
:position relative
:padding 0
:bottom 3px
:margin
:bottom 0
a:hover
:text
:decoration none
> li
@include border-radius(2px)
:display inline
:padding 1px 8px
:margin 0
:right 2px
:text-shadow 0 1px 0 #444
:color #999
:max-width 120px
:overflow hidden
:text-overflow ellipsis
.aspect_selector_edit
:position absolute
:margin
:left -3px
:display none
:color #555
&:hover
:color #eee
&:hover
:background
:color #000
:color #eee
.aspect_selector_edit
:display inline
&.selected
:text-shadow 0 1px 0 #fff
:font
:weight bold
:background
:color rgb(235,235,235)
:border
:bottom 1px solid #fff
:color #444
.aspect_selector_edit
:margin
:left -4px
:color #777
&:hover
:color #999
&:hover
:color #888
a
:color #000
.new_requests
:color red
#global_search
:display inline
:position relative
@ -1406,19 +1305,6 @@ ul#settings_nav
a
:line-height 30px
.contact_pictures,
#aspect_listings li
img
:margin
:right 2px
:bottom 0px
:width 29px
:height 29px
h5
:margin
:bottom 6px
.contact_pictures.horizontal
img
:margin-right -5px
@ -1439,20 +1325,6 @@ ul#settings_nav
a
:color #69AEDD
#aspect_listings
.contacts
:margin
:top 6px
ul
:padding 0
:margin 0
> li
:position relative
:padding 8px 0
:border
:bottom 1px solid #ddd
.floating.empty_message
:margin
:bottom 24px
@ -2448,7 +2320,6 @@ ul.show_comments,
:size 11px
:weight normal
#aspect_edit_controls
:margin
:top 8px
@ -2460,23 +2331,18 @@ ul.show_comments,
:position absolute
:left 0
h3
h4
:position relative
:top 4px
:top 16px
:padding
:bottom 5px
:margin
:bottom 1em
:border
:bottom 1px solid #ccc
:bottom 60px
:padding
:left 60px
#aspect_listings
:margin
:top 24px
#new_notifications,
#new_requests
:position relative
@ -2544,7 +2410,15 @@ ul.show_comments,
:width 100%
#sort_by
:text-align right
:float right
:color #777
.controls
:font
:weight 700
a
:font
:weight normal
#remember_me
input[type='checkbox']
@ -2865,7 +2739,7 @@ h1.tag
:font
:weight bold
.leftBar
.rightBar
.title
:position relative
:border
@ -2896,7 +2770,6 @@ h1.tag
:padding 8px
:color #999
:font-size 11px
:height 36px
:margin
:bottom 4px
@ -2991,7 +2864,7 @@ ul#requested-scopes
.hold-me
:display inline-block
ul#left_nav
ul.left_nav
:margin 0
:padding 0
@ -3023,9 +2896,6 @@ ul#left_nav
:weight 700
:color #666
ul.sub_nav
:display block
.contact_count
@include border-radius(4px)
:float right
@ -3041,12 +2911,34 @@ ul#left_nav
ul.sub_nav
:padding 0
:margin 0
:display none
a
:padding
:left 15px
:width 182px
.section
.contact_count
:display none !important
.left_nav
ul.sub_nav
a
:width 140px
#aspect_stream_container
h3
:margin
:bottom 0
:border
:left 1px solid #eee
:padding
:left 10px
:margin
:left -10px
#aspect_stream_header
:padding 0 12px
.new_aspect
:color #999
:font

View file

@ -5,8 +5,6 @@
width: 105px; padding: 7px 0; text-align:center;
background:#333; border-bottom:1px solid #999;color:#fff;
}
.qq-upload-button-hover {background:#666;}
.qq-upload-button-focus {outline:1px dotted black;}
.qq-upload-drop-area {
position:absolute; top:0; left:0; width:100%; height:100%; min-height: 70px; z-index:2;