Issue#15: Added Comment Notifications: notification_emails and comments view

This commit is contained in:
raluka 2015-07-17 18:55:47 +02:00
parent a73ca335a9
commit 38e8be8793
16 changed files with 155 additions and 13 deletions

View file

@ -0,0 +1,16 @@
.panel.well
-@ordered_events.each do |event|
- if event.comment_threads.count > 0
%panel
%panel.panel-header
%h4.title
= link_to event.title, admin_conference_event_path(event.conference.short_title, event)
%hr
-event.comment_threads.order(created_at: :desc).each do |comment|
%panel-body
%ul.list-unstyled
%li= comment.body
%ul.list-inline
%li Posted by: #{comment.user.name}
%li Created at: #{comment.created_at}
%hr

View file

@ -0,0 +1,14 @@
.panel.well
-@ordered_events.each do |event|
- if event.comment_threads.find_comments_by_user(current_user).count > 0
%panel
%panel.panel-header
%h4.title
= link_to event.title, admin_conference_event_path(event.conference.short_title, event)
%hr
-event.comment_threads.find_comments_by_user(current_user).each do |comment|
%panel-body
%ul.list-unstyled
%li= comment.body
%li Created at: #{comment.created_at}
%hr

View file

@ -0,0 +1,16 @@
.panel.well
-@ordered_events.each do |event|
- if event.comment_threads.find_since_last_login(current_user).count > 0
%panel
%panel.panel-header
%h4.title
= link_to event.title, admin_conference_event_path(event.conference.short_title, event)
%hr
-event.comment_threads.find_since_last_login(current_user).each do |comment|
%panel-body
%ul.list-unstyled
%li= comment.body
%ul.list-inline
%li Posted by: #{comment.user.name}
%li Created at: #{comment.created_at}
%hr

View file

@ -0,0 +1,23 @@
%h1 Comments
.row
.col-lg-12
%ul.nav.nav-tabs#commentsTable
%li.active
%a{:href=>"#unread_comments", "data-toggle"=>"tab"}
%span.fa.fa-comment
Unread comments
%li
%a{:href=>"#all_comments", "data-toggle"=>"tab"}
%span.fa.fa-comments-o
Comments
%li
%a{:href=>"#posted_comments", "data-toggle"=>"tab"}
%span.fa.fa-pencil
Posted Comments
.tab-content
.tab-pane.active#unread_comments
= render partial: 'unread_comments'
.tab-pane#all_comments
= render partial: 'all_comments'
.tab-pane#posted_comments
= render partial: 'posted_comments'

View file

@ -0,0 +1,10 @@
Dear <%= @user.name %>,
User <%= @comment.user.name %> posted a new comment for event <%= @event.title %> of <%= @conference.short_title %> .
"<%= @comment.body %>"
To reply to this comment, please go to <%= h( admin_conference_event_url(@conference.short_title, @event)) %>
Best wishes,
<%= @conference.short_title %> Team

View file

@ -13,17 +13,32 @@
%ul.nav.navbar-nav#splash-nav
= content_for :splash_nav
-if user_signed_in?
%ul.nav.navbar-nav.navbar-right
%li.dropdown
%a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#", id: "current-user-detail"}
- if not current_user.name.blank?
#{current_user.name}
-else
#{current_user.email}
= image_tag(current_user.gravatar_url(size: '18'), title: "Yo #{current_user.name}!", :alt => '')
%b.caret
%ul.dropdown-menu
= render 'layouts/user_menu'
.btn-group.pull-right
%ul.nav.navbar-nav.navbar-right
%li.dropdown
%a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#", id: "current-user-detail"}
- if not current_user.name.blank?
#{current_user.name}
-else
#{current_user.email}
= image_tag(current_user.gravatar_url(size: '18'), title: "Yo #{current_user.name}!", :alt => '')
%b.caret
%ul.dropdown-menu
= render 'layouts/user_menu'
- if can? :manage, Conference
%ul.nav.navbar-nav.navbar-right
%li.dropdown
%a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#", id: "unread-comments-preview"}
- if unread_notifications(current_user)
Notifications (#{unread_notifications(current_user).length})
%b.caret
%ul.dropdown-menu
- unread_notifications(current_user).limit(5).each do |unread_comment|
%li= link_to("New comment for: #{unread_comment.commentable.title}", admin_conference_event_path(unread_comment.commentable.conference.short_title, unread_comment.commentable_id))
%li.divider
%li= link_to 'See comments', admin_comments_path
-else
No Notifications
- else
%ul.nav.navbar-nav.navbar-right
- if CONFIG['authentication']['ichain']['enabled']

View file

@ -0,0 +1,2 @@
%li= link_to("New comment for: #{unread_comment.commentable.title}", admin_conference_event_path(unread_comment.commentable.conference.short_title, unread_comment.commentable_id))