more private message wip.
This commit is contained in:
parent
d50863cc90
commit
8fafc48d32
6 changed files with 56 additions and 42 deletions
|
|
@ -4,6 +4,9 @@ class ConversationsController < ApplicationController
|
|||
respond_to :html, :json
|
||||
|
||||
def index
|
||||
|
||||
@all_contacts_and_ids = current_user.contacts.map{|c| {:id => c.id, :name => c.person.name}}
|
||||
|
||||
@conversations = Conversation.joins(:conversation_visibilities).where(
|
||||
:conversation_visibilities => {:person_id => current_user.person.id}).paginate(
|
||||
:page => params[:page], :per_page => 15, :order => 'updated_at DESC')
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
-# the COPYRIGHT file.
|
||||
|
||||
.stream_element.conversation{:data=>{:guid=>conversation.id}}
|
||||
= person_image_tag(conversation.messages.last.author)
|
||||
= person_image_tag(authors[conversation.id])
|
||||
|
||||
.subject
|
||||
.message_count
|
||||
|
|
@ -14,11 +14,7 @@
|
|||
.last_author
|
||||
.timestamp
|
||||
= time_ago_in_words conversation.updated_at
|
||||
= conversation.author.name
|
||||
= authors[conversation.id].name
|
||||
- if conversation.participants.size > 2
|
||||
%span.participant_count
|
||||
= "(+#{conversation.participants.size - 1})"
|
||||
|
||||
.message
|
||||
= "#{conversation.messages.last.text[0..45]}..."
|
||||
|
||||
|
|
|
|||
|
|
@ -2,23 +2,25 @@
|
|||
-# licensed under the Affero General Public License version 3 or later. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
.conversation_participants.span-16.last
|
||||
.span-10
|
||||
%h3
|
||||
= conversation.subject
|
||||
|
||||
.conversation_controls
|
||||
= link_to (image_tag('reply.png', :height => 14, :width => 14) + ' ' + 'reply'), '#', :id => 'reply_to_conversation'
|
||||
= link_to (image_tag('deletelabel.png') + ' ' + t('delete').downcase), conversation_conversation_visibility_path(conversation), :method => 'delete', :confirm => t('are_you_sure')
|
||||
|
||||
.span-6.avatars.last
|
||||
- for participant in conversation.participants
|
||||
= person_image_link(participant)
|
||||
.span-15.last
|
||||
.conversation_participants
|
||||
.span-9
|
||||
%h3
|
||||
= conversation.subject
|
||||
|
||||
.conversation_controls
|
||||
= link_to (image_tag('reply.png', :height => 14, :width => 14) + ' ' + 'reply'), '#', :id => 'reply_to_conversation'
|
||||
= link_to (image_tag('deletelabel.png') + ' ' + t('delete').downcase), conversation_conversation_visibility_path(conversation), :method => 'delete', :confirm => t('are_you_sure')
|
||||
|
||||
.span-6.avatars.last
|
||||
- for participant in conversation.participants
|
||||
= person_image_link(participant)
|
||||
|
||||
%br
|
||||
%br
|
||||
%br
|
||||
.span-16.last
|
||||
.span-15.last
|
||||
.stream
|
||||
= render :partial => 'messages/message', :collection => conversation.messages
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,11 @@
|
|||
:css
|
||||
footer{ display:none;}
|
||||
|
||||
.span-5.append-3
|
||||
%h3.fixit{:style => 'width:300px;'}
|
||||
|
||||
= hidden_field_tag :contact_json, @all_contacts_and_ids.to_json
|
||||
|
||||
.span-5.append-4
|
||||
%h3.fixit{:style => 'width:340px;'}
|
||||
.right
|
||||
= link_to 'New Message', new_conversation_path, :class => 'button', :rel => 'facebox'
|
||||
Inbox
|
||||
|
|
@ -24,13 +27,13 @@
|
|||
#conversation_inbox
|
||||
- if @conversations.count > 0
|
||||
.stream.conversations
|
||||
= render :partial => 'conversations/conversation', :collection => @conversations
|
||||
= render :partial => 'conversations/conversation', :collection => @conversations, :locals => {:authors => @authors}
|
||||
= will_paginate @conversations
|
||||
- else
|
||||
%i
|
||||
You have no messages
|
||||
|
||||
#conversation_show.span-16.last
|
||||
#conversation_show.span-15.last
|
||||
- if @conversation
|
||||
= render 'conversations/show', :conversation => @conversation
|
||||
- else
|
||||
|
|
|
|||
|
|
@ -2,6 +2,12 @@
|
|||
-# licensed under the Affero General Public License version 3 or later. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
:javascript
|
||||
$(document).ready(function () {
|
||||
$("#my-text-input").tokenInput("/url/to/your/script/");
|
||||
});
|
||||
|
||||
|
||||
|
||||
#new_message_pane
|
||||
#facebox_header
|
||||
|
|
|
|||
|
|
@ -52,6 +52,12 @@ form
|
|||
:width 50px
|
||||
:height 50px
|
||||
|
||||
#content
|
||||
:background
|
||||
:color #fff
|
||||
:border 1px solid #ccc
|
||||
:height 100%
|
||||
|
||||
#flash_notice,
|
||||
#flash_error,
|
||||
#flash_alert
|
||||
|
|
@ -2271,7 +2277,8 @@ ul.show_comments
|
|||
:position relative
|
||||
:top 10px
|
||||
|
||||
#aspect_edit_pane
|
||||
#aspect_edit_pane,
|
||||
#new_message_pane
|
||||
:width 400px
|
||||
.person_tiles
|
||||
.tile
|
||||
|
|
@ -2295,6 +2302,10 @@ ul.show_comments
|
|||
&.larger
|
||||
:width 600px
|
||||
|
||||
#new_message_pane
|
||||
input
|
||||
:width 90%
|
||||
|
||||
#facebox_header
|
||||
:padding 1em
|
||||
:background
|
||||
|
|
@ -2484,7 +2495,7 @@ ul.show_comments
|
|||
.stream_element
|
||||
.subject
|
||||
:font
|
||||
:size 14px
|
||||
:size 13px
|
||||
:weight bold
|
||||
:color #444
|
||||
:overflow hidden
|
||||
|
|
@ -2493,12 +2504,8 @@ ul.show_comments
|
|||
.last_author
|
||||
:font
|
||||
:size 12px
|
||||
:weight bold
|
||||
:color #777
|
||||
|
||||
.message
|
||||
:font
|
||||
:size 12px
|
||||
|
||||
.conversation_participants
|
||||
:z-index 3
|
||||
|
|
@ -2532,8 +2539,7 @@ ul.show_comments
|
|||
|
||||
:border
|
||||
:bottom 1px solid #666
|
||||
:padding 5px
|
||||
:left 10px
|
||||
:padding 0
|
||||
:top 90px
|
||||
:margin
|
||||
:top -100px
|
||||
|
|
@ -2541,6 +2547,8 @@ ul.show_comments
|
|||
.avatars
|
||||
:text
|
||||
:align right
|
||||
:margin
|
||||
:top 9px
|
||||
|
||||
.stream_element.new_message
|
||||
:border
|
||||
|
|
@ -2557,10 +2565,11 @@ ul.show_comments
|
|||
:right -11px
|
||||
|
||||
.stream_element.conversation
|
||||
:padding 5px
|
||||
:padding 10px
|
||||
:min-height 0px
|
||||
|
||||
.message_count
|
||||
:right 6px
|
||||
:right 10px
|
||||
:background
|
||||
:color #999
|
||||
:color #eee
|
||||
|
|
@ -2570,6 +2579,8 @@ ul.show_comments
|
|||
:size 12px
|
||||
:weight normal
|
||||
:-webkit-border-radius 3px
|
||||
:-moz-border-radius 3px
|
||||
:border-radius 3px
|
||||
|
||||
.participant_count
|
||||
:font
|
||||
|
|
@ -2577,7 +2588,7 @@ ul.show_comments
|
|||
|
||||
.timestamp
|
||||
:position absolute
|
||||
:right 6px
|
||||
:right 10px
|
||||
:font
|
||||
:weight normal
|
||||
:color $blue
|
||||
|
|
@ -2587,11 +2598,7 @@ ul.show_comments
|
|||
:width 35px
|
||||
:height 35px
|
||||
:margin
|
||||
:right 5px
|
||||
|
||||
.message
|
||||
:padding
|
||||
:left 40px
|
||||
:right 10px
|
||||
|
||||
&:hover:not(.selected)
|
||||
:background
|
||||
|
|
@ -2606,8 +2613,6 @@ ul.show_comments
|
|||
:color #fff
|
||||
.last_author
|
||||
:color #fff
|
||||
.message
|
||||
:color #eee
|
||||
.timestamp
|
||||
:color #eee
|
||||
:border
|
||||
|
|
@ -2621,11 +2626,10 @@ ul.show_comments
|
|||
:overflow-x none
|
||||
:background
|
||||
:color #f8f8f8
|
||||
:width 300px
|
||||
:width 358px
|
||||
|
||||
:border
|
||||
:right 2px solid #999
|
||||
:left 2px solid #eee
|
||||
|
||||
.fixit
|
||||
:position fixed
|
||||
|
|
|
|||
Loading…
Reference in a new issue