tkh_content 0.9.16 → 0.9.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc7e2632e838c737c884c85407b4ecb138a45bb8
4
- data.tar.gz: 6e6fde83fa313aa364ece8625235ed2662cb0741
3
+ metadata.gz: 196660d06e8ea8145cd14796667136f660533cbe
4
+ data.tar.gz: 99db882adc8d6a6b09d6e3f3c38443a31e693061
5
5
  SHA512:
6
- metadata.gz: 8ea78f5026638811c223906318f257b27728768c0afea888cacfda3bcfead1fadf4c71c065fd61c723608686ba194d60046a728197c730aa57d37a11d5cc942c
7
- data.tar.gz: 5c4782a9dc46a68ee159ac6283622bb03036c6cc8b23f2d4a39032b9a21034c5f2a9a72349ef6b654c0e771f809940a67c6c2fbd467c0662c4c0d059bfad0132
6
+ metadata.gz: e32b81edf3904a604996aa39ae9d54feac74e607fe87be3bbeefb8f2092af353633298ec8cfbca280016899510c78f77ed09aef6eacd32e0f1a588ed5128238b
7
+ data.tar.gz: c93e7e46ffde7f0f00c72182a958a657b00510db11a30df77059c95e8df87a23f935eb37e993ce1aeccf0117b3b727a8414b996218f5307d3e6d0fb11987966d
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
 
4
4
 
5
+ ## 0.9.17
6
+
7
+ * Log comment creation to activity feed.
8
+ * Little reformating of individual comment partial called from admin panel.
9
+ * Nil proofed the calling of a comment commentable name or title.
10
+ * Debugged comment feed. Was referencing the comment page instead of the polymorphic commentable association.
11
+
12
+
5
13
  ## 0.9.16
6
14
 
7
15
  * Comments are now polymorphic. rake 'tkh_content:update' and 'rake db:migrate' commands needed.
@@ -22,6 +22,7 @@ class CommentsController < ApplicationController
22
22
  @comment.locale = I18n.locale.to_s
23
23
  @comment.status = 'pending' # translation not done with globalize3 but with locale files upon showing status to user
24
24
  if @comment.save
25
+ Activity.create doer_id: current_user.id, message: "left a comment attached to: #{view_context.link_to (@comment.commentable.try(:name) || @comment.commentable.try(:title) || 'unknown'), @comment.commentable}."
25
26
  redirect_to @comment.commentable, notice: t('comments.create.notice')
26
27
  else
27
28
  flash[:warning] = t('comments.create.warning')
@@ -2,7 +2,9 @@
2
2
  <td class='text-center'>
3
3
  <% model_name = comment.commentable.class.name.underscore %>
4
4
  <% p = model_name.to_s + '_path' %>
5
- <%= comment.author.name %> - <%= link_to (comment.commentable.try(:title) || comment.commentable.try(:name)), comment.commentable %> (<%= comment.locale %>). <%= link_to l(comment.created_at, format: :tkh_default), p(comment.commentable, anchor: "comment-#{comment.id}") %>
5
+ by <%= link_to comment.author.name, detail_path(comment.author) %><br />
6
+ on <%= link_to (comment.commentable.try(:title) || comment.commentable.try(:name)), comment.commentable %> (<%= comment.locale %>).<br />
7
+ <%= link_to l(comment.created_at, format: :tkh_default), p(comment.commentable, anchor: "comment-#{comment.id}") %>
6
8
  <br /><br />
7
9
  <p class="admin-comment-body"><%= sanitize comment.body.gsub(/\r\n?/, "<br>"), :tags => %w(br), :attributes => %w() %></p>
8
10
  <strong><%= t("comments.status.#{comment.status}") %></strong><br />
@@ -1,16 +1,12 @@
1
1
  <%= simple_form_for @comment, :html => { class: 'form-horizontal' } do |f| %>
2
2
  <%= f.error_notification %>
3
3
 
4
- <div class="form-inputs">
5
4
  <%= @comment.author.name %><br />
6
- <%= link_to (@comment.commentable.title || @comment.commentable.name), @comment.commentable %><br />
5
+ <%= link_to (@comment.commentable.try(:title) || @comment.commentable.try(:name)), @comment.commentable %><br />
7
6
  <%#= f.input :short_title, hint: 'ideally one word only, used for the menu' %><br />
8
7
  <%= render 'comments/status_buttons', comment: @comment %><br />
9
- <%= f.input :body, :input_html => { :rows => 3 } %>
10
- </div>
11
-
12
- <div class="form-actions">
8
+ <%= f.input :body, :input_html => { rows: 3, cols: 55 } %>
9
+ <br />
13
10
  <%= f.button :submit, :class => 'btn btn-primary' %>
14
- </div>
15
11
 
16
12
  <% end %>
@@ -2,15 +2,15 @@ atom_feed(:language => I18n.locale.to_s) do |feed|
2
2
  feed.title "#{Setting.first.site_name}. #{t('activerecord.models.comments').capitalize}"
3
3
  feed.updated @comments.maximum(:updated_at)
4
4
  feed.language I18n.locale.to_s
5
-
5
+
6
6
  @comments.each do |comment|
7
- feed.entry comment, url: page_url(comment.page, anchor: "comment-#{comment.id}") do |entry|
7
+ feed.entry comment, url: page_url(comment.commentable, anchor: "comment-#{comment.id}") do |entry|
8
8
  entry.title truncate comment.body, length: 30, separator: ' ...'
9
- entry.url page_url(comment.page, anchor: "comment-#{comment.id}")
9
+ entry.url page_url(comment.commentable, anchor: "comment-#{comment.id}")
10
10
  entry.content comment.body
11
11
  entry.author do |author|
12
12
  author.name comment.author.name
13
13
  end
14
14
  end
15
15
  end
16
- end
16
+ end
data/lib/tkh_content.rb CHANGED
@@ -6,6 +6,7 @@ require 'stringex'
6
6
  require 'globalize'
7
7
  require 'will_paginate'
8
8
  require 'ckeditor_rails'
9
+ require 'tkh_activity_feeds'
9
10
 
10
11
  module TkhContent
11
12
  class Engine < ::Rails::Engine
@@ -1,3 +1,3 @@
1
1
  module TkhContent
2
- VERSION = "0.9.16"
2
+ VERSION = "0.9.17"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tkh_content
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.16
4
+ version: 0.9.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swami Atma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-08 00:00:00.000000000 Z
11
+ date: 2014-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: 4.2.2
111
+ - !ruby/object:Gem::Dependency
112
+ name: tkh_activity_feeds
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: sqlite3
113
127
  requirement: !ruby/object:Gem::Requirement