tkh_content 0.3.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +25 -0
- data/app/assets/javascripts/ckeditor/config.js.coffee +1 -1
- data/app/controllers/blog_controller.rb +5 -2
- data/app/controllers/comments_controller.rb +14 -6
- data/app/controllers/contacts_controller.rb +7 -2
- data/app/controllers/pages_controller.rb +3 -3
- data/app/mailers/contact_mailer.rb +3 -3
- data/app/models/page.rb +0 -1
- data/app/views/blog/index.atom.builder +14 -0
- data/app/views/blog/index.html.erb +3 -2
- data/app/views/comments/_list_of_comments.html.erb +8 -8
- data/app/views/comments/_status_buttons.html.erb +3 -3
- data/app/views/comments/_tab_admin_menu.html.erb +8 -0
- data/app/views/comments/accepted.html.erb +29 -0
- data/app/views/comments/blocked.html.erb +29 -0
- data/app/views/comments/edit.html.erb +4 -1
- data/app/views/comments/for_feed.atom.builder +16 -0
- data/app/views/comments/index.html.erb +15 -14
- data/app/views/comments/pending.html.erb +31 -0
- data/app/views/contact_mailer/message_from_contact_form.text.erb +4 -5
- data/app/views/contacts/_tab_admin_menu.html.erb +4 -0
- data/app/views/contacts/index.html.erb +8 -6
- data/app/views/contacts/show.html.erb +18 -0
- data/app/views/pages/_admin_context_menu.html.erb +23 -12
- data/app/views/pages/_blog_post_meta.html.erb +4 -2
- data/app/views/pages/_comment_section.html.erb +1 -3
- data/app/views/pages/_form.html.erb +6 -6
- data/app/views/pages/_new_comment_section.html.erb +2 -2
- data/app/views/pages/_tab_admin_menu.html.erb +5 -0
- data/app/views/pages/edit.html.erb +4 -1
- data/app/views/pages/index.html.erb +9 -9
- data/app/views/pages/new.html.erb +4 -1
- data/app/views/pages/show.html.erb +2 -0
- data/app/views/shared/_admin_sidebar.html.erb +1 -1
- data/config/routes.rb +1 -0
- data/lib/generators/tkh_content/create_or_update_locales/templates/de.yml +78 -27
- data/lib/generators/tkh_content/create_or_update_locales/templates/en.yml +43 -16
- data/lib/generators/tkh_content/create_or_update_locales/templates/es.yml +72 -15
- data/lib/generators/tkh_content/create_or_update_locales/templates/fr.yml +73 -16
- data/lib/generators/tkh_content/create_or_update_locales/templates/it.yml +109 -0
- data/lib/tkh_content/version.rb +1 -1
- metadata +14 -5
- data/app/views/blog/index.rss.builder +0 -18
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,31 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
+
## 0.4.2
|
6
|
+
|
7
|
+
* In the admin section of the pages' sidebar, added links to admin panel and to the unmoderated comments when any
|
8
|
+
* Pages sidebar admin section title is now capitalized to fit with the other sidebar sections
|
9
|
+
* Fixed translations of comments section admin tabs
|
10
|
+
* Removed justify button from CKEditor toolbar
|
11
|
+
* Special CSS class for a comment by the page's author
|
12
|
+
* Added generation of canonical link in pages show and in blog index views
|
13
|
+
* Modified display of comments and their count in the blog meta info partial
|
14
|
+
* Created a comments atom feed
|
15
|
+
* Converted blog feed from RSS to atom
|
16
|
+
|
17
|
+
|
18
|
+
## 0.4.1
|
19
|
+
|
20
|
+
* Debugged blog post meta partial
|
21
|
+
|
22
|
+
|
23
|
+
## 0.4
|
24
|
+
|
25
|
+
* Added tab admin menu navigation in all sections
|
26
|
+
* Set up many, many translations
|
27
|
+
* Refactored contact mailer
|
28
|
+
|
29
|
+
|
5
30
|
## 0.3.1
|
6
31
|
|
7
32
|
* CKEditor strips formatting from text during pasting
|
@@ -8,7 +8,7 @@ CKEDITOR.editorConfig = (config) ->
|
|
8
8
|
config.toolbar_Pure = [
|
9
9
|
{ name: 'styles', items: [ 'Format' ] },
|
10
10
|
{ name: 'basicstyles', items: [ 'Bold','Italic','Strike','-','RemoveFormat' ] },
|
11
|
-
{ name: 'paragraph', items: [ 'BulletedList','NumberedList','-','Outdent','Indent','-','Blockquote','-','JustifyLeft','JustifyCenter','JustifyRight'
|
11
|
+
{ name: 'paragraph', items: [ 'BulletedList','NumberedList','-','Outdent','Indent','-','Blockquote','-','JustifyLeft','JustifyCenter','JustifyRight' ] },
|
12
12
|
'/',
|
13
13
|
{ name: 'clipboard', items: [ 'Undo','Redo' ] },
|
14
14
|
{ name: 'links', items: [ 'Link','Unlink' ] },
|
@@ -6,10 +6,13 @@ class BlogController < ApplicationController
|
|
6
6
|
else
|
7
7
|
@posts = Page.for_blog.published.tagged_with(params[:tag]).order('published_at desc').paginate(:page => params[:page], :per_page => 20)
|
8
8
|
end
|
9
|
-
|
10
|
-
|
9
|
+
respond_to do |format|
|
10
|
+
format.html { render :layout => 'blog' }
|
11
|
+
format.atom
|
12
|
+
end
|
11
13
|
end
|
12
14
|
|
15
|
+
# This is temporary and only to complete the import to SA's site.
|
13
16
|
def update_data
|
14
17
|
|
15
18
|
@count = 0
|
@@ -1,10 +1,10 @@
|
|
1
1
|
class CommentsController < ApplicationController
|
2
2
|
|
3
|
-
before_filter :authenticate
|
4
|
-
before_filter :authenticate_with_admin, :except => 'create'
|
3
|
+
before_filter :authenticate, :except => ['for_feed']
|
4
|
+
before_filter :authenticate_with_admin, :except => ['create', 'for_feed']
|
5
5
|
|
6
6
|
def index
|
7
|
-
@comments = Comment.by_recent
|
7
|
+
@comments = Comment.by_recent.paginate(:page => params[:page], :per_page => 50)
|
8
8
|
switch_to_admin_layout
|
9
9
|
end
|
10
10
|
|
@@ -64,18 +64,26 @@ class CommentsController < ApplicationController
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def pending
|
67
|
-
@comments = Comment.pending
|
67
|
+
@comments = Comment.pending.by_created.paginate(:page => params[:page], :per_page => 50)
|
68
68
|
switch_to_admin_layout
|
69
69
|
end
|
70
70
|
|
71
71
|
def accepted
|
72
|
-
@comments = Comment.accepted.by_recent
|
72
|
+
@comments = Comment.accepted.by_recent.paginate(:page => params[:page], :per_page => 50)
|
73
73
|
switch_to_admin_layout
|
74
74
|
end
|
75
75
|
|
76
76
|
def blocked
|
77
|
-
@comments = Comment.blocked.by_recent
|
77
|
+
@comments = Comment.blocked.by_recent.paginate(:page => params[:page], :per_page => 50)
|
78
78
|
switch_to_admin_layout
|
79
79
|
end
|
80
80
|
|
81
|
+
def for_feed
|
82
|
+
@comments = Comment.showable.for_locale(I18n.locale).by_recently_created.limit(50)
|
83
|
+
respond_to do |format|
|
84
|
+
format.html { redirect_to root_path }
|
85
|
+
format.atom
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
81
89
|
end
|
@@ -7,6 +7,11 @@ class ContactsController < ApplicationController
|
|
7
7
|
@contacts = Contact.by_recent.paginate(:page => params[:page], :per_page => 35)
|
8
8
|
switch_to_admin_layout
|
9
9
|
end
|
10
|
+
|
11
|
+
def show
|
12
|
+
@contact = Contact.find(params[:id])
|
13
|
+
switch_to_admin_layout
|
14
|
+
end
|
10
15
|
|
11
16
|
def create
|
12
17
|
@contact = Contact.new(params[:contact])
|
@@ -19,10 +24,10 @@ class ContactsController < ApplicationController
|
|
19
24
|
flash[:error] = t("contacts.create.warning")
|
20
25
|
redirect_to :back
|
21
26
|
elsif saved && sent_email == 'invalid'
|
22
|
-
flash[:error] = "#{t("contacts.create.warning")}
|
27
|
+
flash[:error] = "#{t("contacts.create.warning")} #{t('contacts.create.invalid_email')}"
|
23
28
|
redirect_to :back
|
24
29
|
else
|
25
|
-
flash[:error] = '
|
30
|
+
flash[:error] = t('contacts.create.did_not_reach')
|
26
31
|
redirect_to :back
|
27
32
|
end
|
28
33
|
end
|
@@ -57,21 +57,21 @@ class PagesController < ApplicationController
|
|
57
57
|
page = Page.find(params[:id])
|
58
58
|
page.published_at = Time.now
|
59
59
|
page.save
|
60
|
-
redirect_to pages_path, notice: '
|
60
|
+
redirect_to pages_path, notice: t('pages.status.changed.published')
|
61
61
|
end
|
62
62
|
|
63
63
|
def unpublish
|
64
64
|
page = Page.find(params[:id])
|
65
65
|
page.published_at = nil
|
66
66
|
page.save
|
67
|
-
redirect_to pages_path, notice:
|
67
|
+
redirect_to pages_path, notice: t('pages.status.changed.unpublished')
|
68
68
|
end
|
69
69
|
|
70
70
|
def toggle_for_blog
|
71
71
|
page = Page.find(params[:id])
|
72
72
|
page.for_blog? ? page.for_blog = false : page.for_blog = true
|
73
73
|
page.save
|
74
|
-
redirect_to pages_path notice:
|
74
|
+
redirect_to pages_path notice: t('pages.status.changed.toggled')
|
75
75
|
end
|
76
76
|
|
77
77
|
def sort
|
@@ -11,11 +11,11 @@ class ContactMailer < ActionMailer::Base
|
|
11
11
|
@contact = contact
|
12
12
|
# FIXME - only the email addresses show up. not the names :-(
|
13
13
|
# TODO - what do to if contact_email is not set?
|
14
|
-
recipient = "#{Setting.first.company_name} <#{Setting.first.contact_email}>"
|
14
|
+
recipient = "#{Setting.first.try(:company_name)} <#{Setting.first.try(:contact_email)}>"
|
15
15
|
reply_to = "#{@contact.sender_name} <#{@contact.sender_email}>"
|
16
16
|
mail to: recipient,
|
17
|
-
from: "#{Setting.first.site_name} <deploy@pragmaticyoga.org>",
|
17
|
+
from: "#{Setting.first.site_name} <deploy@ohlalaweb.pragmaticyoga.org>",
|
18
18
|
reply_to: reply_to,
|
19
|
-
subject: "Message from #{@contact.sender_name} via #{Setting.first.site_name} web site"
|
19
|
+
subject: "Message from #{@contact.sender_name} via #{Setting.first.try(:site_name)} web site"
|
20
20
|
end
|
21
21
|
end
|
data/app/models/page.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
atom_feed(:language => I18n.locale.to_s) do |feed|
|
2
|
+
feed.title Setting.first.blog_name || t('blog.itself')
|
3
|
+
feed.updated @posts.maximum(:updated_at)
|
4
|
+
|
5
|
+
@posts.each do |post|
|
6
|
+
feed.entry post, published: post.published_at do |entry|
|
7
|
+
entry.title post.title
|
8
|
+
entry.content post.body, type: 'html'
|
9
|
+
entry.author do |author|
|
10
|
+
author.name post.author.name
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -1,5 +1,6 @@
|
|
1
|
-
<% content_for :meta_title, Setting.first.company_name %>
|
2
|
-
|
1
|
+
<% content_for :meta_title, Setting.first.try(:company_name) %>
|
2
|
+
<% content_for :meta_description, "#{Setting.first.try(:blog_tagline)} - #{Setting.first.try(:company_name)}#{t('colon')} #{t('blog.official')}" %>
|
3
|
+
<% content_for :canonical_link, link_to('', blog_path, rel: 'canonical') %>
|
3
4
|
|
4
5
|
|
5
6
|
<% for post in @posts %>
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<% @page.comments.showable.for_locale(I18n.locale.to_s).by_created.each_with_index do |comment, index| %>
|
2
|
-
<div id="comment-<%= comment.id %>" class="individual-comment">
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
</div>
|
2
|
+
<div id="comment-<%= comment.id %>" class="individual-comment<%= " by-page-author" if comment.author_id == comment.page.author_id %>">
|
3
|
+
<p>
|
4
|
+
<span class="comment-index"><%= index + 1 %></span>
|
5
|
+
<span class="comment-author-name"><%= comment.author.name %></span>
|
6
|
+
<span class="comment-created-date"><%= l comment.created_at, format: :tkh_default %></span>
|
7
|
+
<span class="comment-body"><%= sanitize comment.body.gsub(/\r\n?/, "<br>"), :tags => %w(br), :attributes => %w() %></span>
|
8
|
+
</p>
|
9
|
+
</div>
|
10
10
|
<% end %>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<% if comment.status == 'pending' %>
|
2
|
-
<%= link_to t('comments.moderation.actions.accept'), accept_comment_path(comment), method: :post, class: 'btn btn-mini
|
2
|
+
<%= link_to t('comments.moderation.actions.accept'), accept_comment_path(comment), method: :post, class: 'btn btn-mini' %><%= link_to t('comments.moderation.actions.block'), block_comment_path(comment), method: :post, class: 'btn btn-mini' %>
|
3
3
|
<% elsif comment.status == 'accepted' %>
|
4
|
-
<%= link_to t('comments.moderation.actions.block'), block_comment_path(comment), method: :post, class: 'btn btn-mini
|
4
|
+
<%= link_to t('comments.moderation.actions.block'), block_comment_path(comment), method: :post, class: 'btn btn-mini' %>
|
5
5
|
<% elsif comment.status == 'blocked' %>
|
6
|
-
<%= link_to t('comments.moderation.actions.accept'), accept_comment_path(comment), method: :post, class: 'btn btn-mini
|
6
|
+
<%= link_to t('comments.moderation.actions.accept'), accept_comment_path(comment), method: :post, class: 'btn btn-mini' %>
|
7
7
|
<% end -%>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<ul class="nav nav-tabs" id="admin-menu-tab">
|
2
|
+
<%= content_tag :li, link_to(t('all'), comments_path), ({ class: 'active' } if controller.action_name.to_s == 'index' ) %>
|
3
|
+
<%= content_tag :li, link_to(t('comments.status.pending'), pending_comments_path), ({ class: 'active' } if controller.action_name.to_s == 'pending' ) %>
|
4
|
+
<%= content_tag :li, link_to(t('comments.status.accepted'), accepted_comments_path), ({ class: 'active' } if controller.action_name.to_s == 'accepted' ) %>
|
5
|
+
<%= content_tag :li, link_to(t('comments.status.blocked'), blocked_comments_path), ({ class: 'active' } if controller.action_name.to_s == 'blocked' ) %>
|
6
|
+
<%= content_tag :li, link_to(t('view'), comments_path), ({ class: 'active' }) if controller.action_name.to_s == 'show' %>
|
7
|
+
<%= content_tag :li, link_to(t('edit'), comments_path), ({ class: 'active' }) if controller.action_name.to_s == 'edit' %>
|
8
|
+
</ul>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<h1><%= t('activerecord.models.comments') %></h1>
|
2
|
+
|
3
|
+
<%= render 'tab_admin_menu' %>
|
4
|
+
|
5
|
+
<table class='table table-striped'>
|
6
|
+
<thead>
|
7
|
+
<tr>
|
8
|
+
<th><%= t('activerecord.attributes.comments.author') %>, <%= t('activerecord.models.page') %>, <%= t('activerecord.attributes.comments.locale') %><br />
|
9
|
+
<%= t('activerecord.attributes.comments.body') %></th>
|
10
|
+
<th><%= t('activerecord.attributes.comments.status') %></th>
|
11
|
+
<th><%= t('actions') %></th>
|
12
|
+
</tr>
|
13
|
+
</thead>
|
14
|
+
|
15
|
+
<tbody>
|
16
|
+
<% @comments.each do |comment| %>
|
17
|
+
<tr>
|
18
|
+
<td><%= comment.author.name %> - <%= link_to comment.page.title, comment.page %> | <%= comment.locale %><br /><br />
|
19
|
+
<%= sanitize comment.body.gsub(/\r\n?/, "<br>"), :tags => %w(br), :attributes => %w() %></td>
|
20
|
+
<td><%= t("comments.status.#{comment.status}") %><%= t 'colon' %><%= render 'comments/status_buttons', comment: comment %></td>
|
21
|
+
<td><%= link_to t('edit'), edit_comment_path(comment), class: 'btn btn-mini' %><%= link_to t('delete'), comment, method: :delete, data: { confirm: t('are_you_sure') }, class: 'btn btn-mini btn-danger' %></td>
|
22
|
+
</tr>
|
23
|
+
<% end %>
|
24
|
+
</tbody>
|
25
|
+
</table>
|
26
|
+
|
27
|
+
<%= will_paginate @comments %>
|
28
|
+
|
29
|
+
<%= render 'shared/admin_sidebar' %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<h1><%= t('activerecord.models.comments') %></h1>
|
2
|
+
|
3
|
+
<%= render 'tab_admin_menu' %>
|
4
|
+
|
5
|
+
<table class='table table-striped'>
|
6
|
+
<thead>
|
7
|
+
<tr>
|
8
|
+
<th><%= t('activerecord.attributes.comments.author') %>, <%= t('activerecord.models.page') %>, <%= t('activerecord.attributes.comments.locale') %><br />
|
9
|
+
<%= t('activerecord.attributes.comments.body') %></th>
|
10
|
+
<th><%= t('activerecord.attributes.comments.status') %></th>
|
11
|
+
<th><%= t('actions') %></th>
|
12
|
+
</tr>
|
13
|
+
</thead>
|
14
|
+
|
15
|
+
<tbody>
|
16
|
+
<% @comments.each do |comment| %>
|
17
|
+
<tr>
|
18
|
+
<td><%= comment.author.name %> - <%= link_to comment.page.title, comment.page %> | <%= comment.locale %><br /><br />
|
19
|
+
<%= sanitize comment.body.gsub(/\r\n?/, "<br>"), :tags => %w(br), :attributes => %w() %></td>
|
20
|
+
<td><%= t("comments.status.#{comment.status}") %><%= t 'colon' %><%= render 'comments/status_buttons', comment: comment %></td>
|
21
|
+
<td><%= link_to t('edit'), edit_comment_path(comment), class: 'btn btn-mini' %><%= link_to t('delete'), comment, method: :delete, data: { confirm: t('are_you_sure') }, class: 'btn btn-mini btn-danger' %></td>
|
22
|
+
</tr>
|
23
|
+
<% end %>
|
24
|
+
</tbody>
|
25
|
+
</table>
|
26
|
+
|
27
|
+
<%= will_paginate @comments %>
|
28
|
+
|
29
|
+
<%= render 'shared/admin_sidebar' %>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
atom_feed(:language => I18n.locale.to_s) do |feed|
|
2
|
+
feed.title "#{Setting.first.site_name}. #{t('activerecord.models.comments').capitalize}"
|
3
|
+
feed.updated @comments.maximum(:updated_at)
|
4
|
+
feed.language I18n.locale.to_s
|
5
|
+
|
6
|
+
@comments.each do |comment|
|
7
|
+
feed.entry comment, url: page_url(comment.page, anchor: "comment-#{comment.id}") do |entry|
|
8
|
+
entry.title truncate comment.body, length: 30, separator: ' ...'
|
9
|
+
entry.url page_url(comment.page, anchor: "comment-#{comment.id}")
|
10
|
+
entry.content comment.body
|
11
|
+
entry.author do |author|
|
12
|
+
author.name comment.author.name
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,29 +1,30 @@
|
|
1
|
-
<h1
|
1
|
+
<h1><%= t('activerecord.models.comments') %></h1>
|
2
|
+
|
3
|
+
<%= render 'tab_admin_menu' %>
|
2
4
|
|
3
5
|
<table class='table table-striped'>
|
4
6
|
<thead>
|
5
|
-
|
6
|
-
<th><%= t
|
7
|
-
|
8
|
-
<th><%= t
|
9
|
-
|
10
|
-
<th><%= t 'activerecord.attributes.comments.locale' %></th>
|
11
|
-
<th>Actions</th>
|
7
|
+
<tr>
|
8
|
+
<th><%= t('activerecord.attributes.comments.author') %>, <%= t('activerecord.models.page') %>, <%= t('activerecord.attributes.comments.locale') %><br />
|
9
|
+
<%= t('activerecord.attributes.comments.body') %></th>
|
10
|
+
<th><%= t('activerecord.attributes.comments.status') %></th>
|
11
|
+
<th><%= t('actions') %></th>
|
12
12
|
</tr>
|
13
13
|
</thead>
|
14
14
|
|
15
15
|
<tbody>
|
16
|
-
<% @comments.each do |comment| %>
|
16
|
+
<% @comments.each do |comment| %>
|
17
17
|
<tr>
|
18
|
-
<td><%= comment.author.name
|
19
|
-
|
20
|
-
|
21
|
-
<td><%= comment.status %><%= t 'colon' %><%= render 'comments/status_buttons', comment: comment %></td>
|
22
|
-
<td><%= comment.locale %></td>
|
18
|
+
<td><%= comment.author.name %> - <%= link_to comment.page.title, comment.page %> | <%= comment.locale %><br /><br />
|
19
|
+
<%= sanitize comment.body.gsub(/\r\n?/, "<br>"), :tags => %w(br), :attributes => %w() %></td>
|
20
|
+
|
21
|
+
<td><%= t("comments.status.#{comment.status}") %><%= t 'colon' %><%= render 'comments/status_buttons', comment: comment %></td>
|
23
22
|
<td><%= link_to t('edit'), edit_comment_path(comment), class: 'btn btn-mini' %><%= link_to t('delete'), comment, method: :delete, data: { confirm: t('are_you_sure') }, class: 'btn btn-mini btn-danger' %></td>
|
24
23
|
</tr>
|
25
24
|
<% end %>
|
26
25
|
</tbody>
|
27
26
|
</table>
|
28
27
|
|
28
|
+
<%= will_paginate @comments %>
|
29
|
+
|
29
30
|
<%= render 'shared/admin_sidebar' %>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<h1><%= t('activerecord.models.comments') %></h1>
|
2
|
+
|
3
|
+
<%= render 'tab_admin_menu' %>
|
4
|
+
|
5
|
+
<p><span class="label label-info"><%= t('comments.sorted_by_oldest') %></span></p>
|
6
|
+
|
7
|
+
<table class='table table-striped'>
|
8
|
+
<thead>
|
9
|
+
<tr>
|
10
|
+
<th><%= t('activerecord.attributes.comments.author') %>, <%= t('activerecord.models.page') %>, <%= t('activerecord.attributes.comments.locale') %><br />
|
11
|
+
<%= t('activerecord.attributes.comments.body') %></th>
|
12
|
+
<th><%= t('activerecord.attributes.comments.status') %></th>
|
13
|
+
<th><%= t('actions') %></th>
|
14
|
+
</tr>
|
15
|
+
</thead>
|
16
|
+
|
17
|
+
<tbody>
|
18
|
+
<% @comments.each do |comment| %>
|
19
|
+
<tr>
|
20
|
+
<td><%= comment.author.name %> - <%= link_to comment.page.title, comment.page %> | <%= comment.locale %><br /><br />
|
21
|
+
<%= sanitize comment.body.gsub(/\r\n?/, "<br>"), :tags => %w(br), :attributes => %w() %></td>
|
22
|
+
<td><%= t("comments.status.#{comment.status}") %><%= t 'colon' %><%= render 'comments/status_buttons', comment: comment %></td>
|
23
|
+
<td><%= link_to t('edit'), edit_comment_path(comment), class: 'btn btn-mini' %><%= link_to t('delete'), comment, method: :delete, data: { confirm: t('are_you_sure') }, class: 'btn btn-mini btn-danger' %></td>
|
24
|
+
</tr>
|
25
|
+
<% end %>
|
26
|
+
</tbody>
|
27
|
+
</table>
|
28
|
+
|
29
|
+
<%= will_paginate @comments %>
|
30
|
+
|
31
|
+
<%= render 'shared/admin_sidebar' %>
|
@@ -1,13 +1,12 @@
|
|
1
|
-
|
1
|
+
<%= t('contacts.mailer.intro') %>
|
2
2
|
|
3
|
-
-
|
4
|
-
-
|
3
|
+
- <%= t('contacts.mailer.sender_name') %> <%= @contact.sender_name %>
|
4
|
+
- <%= t('contacts.mailer.sender_email') %> <%= @contact.sender_email %>
|
5
5
|
|
6
|
-
|
6
|
+
<%= t('contacts.mailer.message') %>
|
7
7
|
|
8
8
|
-----------------------------------
|
9
9
|
|
10
10
|
<%= @contact.body %>
|
11
11
|
|
12
12
|
-----------------------------------
|
13
|
-
|
@@ -0,0 +1,4 @@
|
|
1
|
+
<ul class="nav nav-tabs" id="admin-menu-tab">
|
2
|
+
<%= content_tag :li, link_to(t('list'), contacts_path), ({ class: 'active' } if controller.action_name.to_s == 'index' ) %>
|
3
|
+
<%= content_tag :li, link_to(t('view'), contacts_path), ({ class: 'active' }) if controller.action_name.to_s == 'show' %>
|
4
|
+
</ul>
|
@@ -1,4 +1,6 @@
|
|
1
|
-
<h1><%= t '
|
1
|
+
<h1><%= t 'activerecord.models.contacts' %></h1>
|
2
|
+
|
3
|
+
<%= render 'tab_admin_menu' %>
|
2
4
|
|
3
5
|
<table class='table table-striped'>
|
4
6
|
<thead>
|
@@ -7,7 +9,7 @@
|
|
7
9
|
<th><%= t 'activerecord.attributes.contacts.sender_email' %></th>
|
8
10
|
<th><%= t 'activerecord.attributes.contacts.body' %></th>
|
9
11
|
<th><%= t 'contacts.sent' %></th>
|
10
|
-
<th
|
12
|
+
<th><%= t('actions') %></th>
|
11
13
|
</tr>
|
12
14
|
</thead>
|
13
15
|
|
@@ -15,10 +17,10 @@
|
|
15
17
|
<% @contacts.each do |contact| %>
|
16
18
|
<tr>
|
17
19
|
<td><%= contact.sender_name %></td>
|
18
|
-
<td><%=
|
19
|
-
<td><%= truncate contact.body, length:
|
20
|
-
<td><%= l contact.created_at, :format => :
|
21
|
-
<td
|
20
|
+
<td><%= link_to contact.sender_email, "mailto:#{contact.sender_email}" %></td>
|
21
|
+
<td><%= truncate contact.body, length: 85, separator: ' ...' %></td>
|
22
|
+
<td><%= l contact.created_at, :format => :tkh_default %></td>
|
23
|
+
<td><%= link_to t('view'), contact %></td>
|
22
24
|
</tr>
|
23
25
|
<% end %>
|
24
26
|
</tbody>
|