diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index e27eb1f1d..61f35030e 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. class NotificationsController < ApplicationController - include NotificationsHelper + before_filter :authenticate_user! def update note = Notification.where(:recipient_id => current_user.id, :id => params[:id]).first diff --git a/app/controllers/streams_controller.rb b/app/controllers/streams_controller.rb index f7f00f772..08c37c0f3 100644 --- a/app/controllers/streams_controller.rb +++ b/app/controllers/streams_controller.rb @@ -65,7 +65,7 @@ class StreamsController < ApplicationController respond_with do |format| format.html { render 'layouts/main_stream' } format.mobile { render 'layouts/main_stream' } - format.json { render_for_api :backbone, :json => @stream.stream_posts, :root => :posts } + format.json {render_for_api :backbone, :json => @stream.stream_posts, :root => :posts } end end diff --git a/app/helpers/contacts_helper.rb b/app/helpers/contacts_helper.rb new file mode 100644 index 000000000..67c0a01db --- /dev/null +++ b/app/helpers/contacts_helper.rb @@ -0,0 +1,20 @@ +module ContactsHelper + def contact_aspect_dropdown(contact) + if @aspect + link_to(image_tag('/images/icons/monotone_close_exit_delete.png', :height => 20, :width => 20), + {:controller => "aspect_memberships", + :action => 'destroy', + :id => 42, + :aspect_id => @aspect.id, + :person_id => contact.person.id + }, + :title => t('.remove_person_from_aspect', :person_name => contact.person.first_name, :aspect_name => @aspect.name), + :method => 'delete') + + else + render :partial => 'people/relationship_action', + :locals => { :person => contact.person, :contact => contact, + :current_user => current_user } + end + end +end \ No newline at end of file diff --git a/app/views/contacts/index.html.haml b/app/views/contacts/index.html.haml index 5051b9160..0c274744a 100644 --- a/app/views/contacts/index.html.haml +++ b/app/views/contacts/index.html.haml @@ -30,28 +30,18 @@ - if @contacts.size > 0 - for contact in @contacts .stream_element{:id => contact.person.id} - .right - - if @aspect - = link_to(image_tag('/images/icons/monotone_close_exit_delete.png', :height => 20, :width => 20), - {:controller => "aspect_memberships", - :action => 'destroy', - :id => 42, - :aspect_id => @aspect.id, - :person_id => contact.person.id}, - :title => t('.remove_person_from_aspect', :person_name => contact.person.first_name, :aspect_name => @aspect.name), - :method => 'delete') - - else - = render :partial => 'people/relationship_action', - :locals => { :person => contact.person, :contact => contact, - :current_user => current_user } + .float-right + = thing(contact) + + .media + .img + = person_image_link(contact.person) - = person_image_link(contact.person) - .content - %span.from - =person_link(contact.person) - .info - = contact.person.diaspora_handle + .bd + = person_link(contact.person) + .info + = contact.person.diaspora_handle = will_paginate @contacts - else diff --git a/app/views/conversations/_conversation.haml b/app/views/conversations/_conversation.haml index c71580beb..ed7764419 100644 --- a/app/views/conversations/_conversation.haml +++ b/app/views/conversations/_conversation.haml @@ -4,24 +4,27 @@ %a.conversation{:href => conversation_path(conversation)} .stream_element.conversation{:data=>{:guid=>conversation.id}, :class => ('unread' if unread_counts[conversation.id].to_i > 0)} - = person_image_tag(conversation.author) + .media + .img + = person_image_tag(conversation.author) - .subject - .message_count - = conversation.messages.size - - if unread_counts[conversation.id].to_i > 0 - .unread_message_count - = unread_counts[conversation.id].to_i + .bg + .subject + .message_count + = conversation.messages.size + - if unread_counts[conversation.id].to_i > 0 + .unread_message_count + = unread_counts[conversation.id].to_i - %div{ :class => direction_for(conversation.subject) } - = conversation.subject[0..30] + %div{ :class => direction_for(conversation.subject) } + = conversation.subject[0..30] - .last_author - .timestamp - = t('ago', :time => time_ago_in_words(conversation.updated_at)) - - if authors[conversation.id].present? - = authors[conversation.id].name + .last_author + .timestamp + = t('ago', :time => time_ago_in_words(conversation.updated_at)) + - if authors[conversation.id].present? + = authors[conversation.id].name - - if conversation.participants.size > 2 - %span.participant_count - = "(+#{conversation.participants.size - 1})" + - if conversation.participants.size > 2 + %span.participant_count + = "(+#{conversation.participants.size - 1})" diff --git a/app/views/conversations/_show.haml b/app/views/conversations/_show.haml index 98316933f..3ff60e33e 100644 --- a/app/views/conversations/_show.haml +++ b/app/views/conversations/_show.haml @@ -23,10 +23,11 @@ = render :partial => 'messages/message', :collection => conversation.messages .stream_element.new_message - = owner_image_tag(:thumb_small) + .media + .img + = owner_image_tag(:thumb_small) - .content - = form_for [conversation, Message.new] do |message| - = message.text_area :text, :rows => 5, :tabindex => 1 - .left + .bd + = form_for [conversation, Message.new] do |message| + = message.text_area :text, :rows => 5, :tabindex => 1 = message.submit t('.reply').capitalize, :disable_with => t('.replying'), :class => 'button creation', :tabindex => 2 diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index ab97407c2..0a472326f 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -48,9 +48,8 @@ fade-in 0.2s ease-in; -moz-animation: spin 1s infinite ease-in-out, fade-in 0.2s ease-in; - } - / Social Media Icons are by Paul Robert Lloyd @ http://paulrobertlloyd.com/2009/06/social_media_icons + } / bootstrap/blueprint switch - if @aspect == :getting_started || @page == :logged_out diff --git a/app/views/messages/_message.haml b/app/views/messages/_message.haml index ad44c9b79..aeb265a57 100644 --- a/app/views/messages/_message.haml +++ b/app/views/messages/_message.haml @@ -3,14 +3,13 @@ -# the COPYRIGHT file. .stream_element{:data=>{:guid=>message.id}} - = person_image_link(message.author, :size => :thumb_small) - - .content - .from - = person_link(message.author, :class => 'author') + .media + .img + = person_image_link(message.author, :size => :thumb_small) + .bd + = person_link(message.author, :class => 'author from') %time.timeago{:datetime => message.created_at} = how_long_ago(message) - %div{ :class => direction_for(message.text) } - = markdownify(message, :oembed => true) - + %div{ :class => direction_for(message.text) } + = markdownify(message, :oembed => true) \ No newline at end of file diff --git a/app/views/notifications/index.html.haml b/app/views/notifications/index.html.haml index b95b386a8..db4c85d54 100644 --- a/app/views/notifications/index.html.haml +++ b/app/views/notifications/index.html.haml @@ -19,16 +19,17 @@ - notes.each do |note| .stream_element{:data=>{:guid => note.id}, :class => "#{note.unread ? 'unread' : 'read'}"} - if note.type == "Notifications::StartedSharing" && contact = current_user.contact_for(note.effective_target) - .right + .float-right = aspect_membership_dropdown(contact, note.effective_target, 'left') - - %span.from - = notification_message_for(note) - %br - %time= timeago(note.created_at) - %a{:class => 'unread-setter'} - mark unread - .span-13.last + + .media + .bd + = notification_message_for(note) + %div + %time + = timeago(note.created_at) + = link_to "Mark unread", "#", :class => "unread-setter" + = will_paginate @notifications :javascript diff --git a/app/views/people/_index.html.haml b/app/views/people/_index.html.haml index 3b2c4ddb8..e7f38cf06 100644 --- a/app/views/people/_index.html.haml +++ b/app/views/people/_index.html.haml @@ -1,13 +1,11 @@ .people_stream - - for person in people + - people.each do |person| .stream_element{:id => person.id} - = person_image_link(person) - - if current_user - - contact = current_user.contacts.find_by_person_id(person.id) - - contact ||= Contact.new(:person => person) - - .content - %span.from - =person_link(person, :class => "hovercardable") + .media + .img + = person_image_link(person) + .bg + %span.from + = person_link(person, :class => "hovercardable") = will_paginate people, :inner_window => 3, :params => {:controller => 'people', :action => 'tag_index'} diff --git a/app/views/people/_person.html.haml b/app/views/people/_person.html.haml index 1f7b24840..3b52a18dc 100644 --- a/app/views/people/_person.html.haml +++ b/app/views/people/_person.html.haml @@ -3,11 +3,12 @@ -# the COPYRIGHT file. .stream_element{:id => person.id} + %div{:style => "float:right;margin-top:2px;"} + = render :partial => 'people/relationship_action', + :locals => { :person => person, :contact => contact, + :current_user => current_user } + .media - %div{:style => "float:right;margin-top:2px;"} - = render :partial => 'people/relationship_action', - :locals => { :person => person, :contact => contact, - :current_user => current_user } .img = person_image_link(person) diff --git a/public/javascripts/widgets/notifications.js b/public/javascripts/widgets/notifications.js index 8a8c1d8d8..55e64d0af 100644 --- a/public/javascripts/widgets/notifications.js +++ b/public/javascripts/widgets/notifications.js @@ -54,7 +54,7 @@ } this.unreadClick = function() { $.ajax({ - url: "/notifications/" + $(this).parent().data("guid"), + url: "/notifications/" + $(this).closest(".stream_element").data("guid"), data: { set_unread: true }, type: "PUT", success: self.clickSuccess diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index a35dbb824..5325cc03d 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -19,7 +19,7 @@ .media .img img :display block -.media .imgExt +.media .imgEt :float right :margin-left 10px /* ====== ----- ====== */ @@ -402,11 +402,6 @@ ul.as-selections :margin :bottom 10px -#conversation_inbox a - &:hover - :text - :decoration none - .stream_element a.author :font-weight bold @@ -607,6 +602,8 @@ form.new_comment :padding 8px 0 :text-align center :width 100% + img + :border none #photo_container :text @@ -1626,14 +1623,8 @@ ul#press_logos .notifications_for_day .stream_element - :margin - :bottom 0.3em :padding 0.2em 0.5em :width 500px - @include border-radius(5px) - - &:hover - :background-color #EFEFEF .day_group :min-height 100px @@ -1878,8 +1869,7 @@ ul#press_logos :top 9px .stream_element.conversation - :padding 10px - :min-height 0px + :padding 8px .message_count @include border-radius(5px) @@ -1960,6 +1950,10 @@ ul#press_logos :overflow-y auto :overflow-x none + a:hover + :text + :decoration none + #left_pane :position fixed :width 337px @@ -2321,10 +2315,7 @@ ul.left_nav :margin-left 8px .unread-setter - :float right :display none - :cursor pointer - :margin-top 8px .stream_container :min-height 500px @@ -2826,3 +2817,7 @@ a.toggle_selector :opacity 0.85 !important &:visible :opacity 0.5 + +.float-right + :float right + :margin-top 5px