radiant-comments-extension 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  .DS_Store
2
- .svn
3
- *.gem
2
+ .sass-cache
3
+ *.gem
4
+ Gemfile.lock
@@ -1,26 +1,12 @@
1
- %tr{:id => dom_id(comment), :class => "comment comment-#{comment.ap_status}"}
2
- %td.content{:title => comment.content.size >= 70 ? t('click_to_toggle') : "" }
3
- %blockquote.short= escape_once(truncate(comment.content, :length => 70))
4
- - if comment.content.size >= 70
5
- %blockquote.expanded{:style => "display:none"}
6
- = escape_once(comment.content)
7
- %td.date-column
8
- = comment.created_at.strftime("%b %e, %Y at %I:%M%p")
9
- %td.author-column
10
- = escape_once(comment.author)
11
- - unless comment.author_email.blank?
12
- = mail_to(comment.author_email, image_tag("admin/email.png"))
13
- - unless comment.author_url.blank?
14
- = link_to(image_tag("admin/link.png"), comment.author_url)
1
+ %tr.comment_row
2
+ %td.name= link_to escape_once(truncate(comment.content, :length => 70)), edit_admin_comment_path(comment)
15
3
  - unless @page
16
- %td.page-column
17
- = link_to truncate(comment.page.title, :length => 40), comment.page.url, :class => 'view-page'
18
- = link_to image_tag("admin/page_white_edit.png"), edit_admin_page_path(comment.page), :title => t('edit_page')
19
- %td.controls-column
4
+ %td.page= truncate comment.page.title, :length => 40
5
+ %td.date= comment.created_at.strftime("%D")
6
+ %td.author= mail_to comment.author_email, escape_once(comment.author)
7
+ %td.actions
20
8
  - if comment.approved?
21
- = link_to(image_tag('admin/error.png'), unapprove_admin_comment_path(comment), :method => :put, :title => t('unapprove_comment'))
9
+ = link_to image("error") + " " + "Unapprove", unapprove_admin_comment_path(comment), :method => :put, :class => :action
22
10
  - else
23
- = link_to(image_tag('admin/accept.png'), approve_admin_comment_path(comment), :title => t('approve_comment'), :method => :put)
24
-
25
- = link_to image_tag("admin/delete.png"), admin_comment_path(comment), :method => :delete, :confirm => t('are_you_sure_you_want_to_delete_this_comment'), :title => t('delete_comment')
26
- = link_to image_tag("admin/comment_edit.png"), edit_admin_comment_path(comment), :title => t('edit_comment')
11
+ = link_to image("accept") + " " + "Approve", approve_admin_comment_path(comment), :method => :put, :class => "action approve"
12
+ = link_to image('minus') + ' ' + t('remove'), admin_comment_path(comment), :method => :delete, :confirm => t('are_you_sure_you_want_to_delete_this_comment'), :class => :action
@@ -3,35 +3,56 @@
3
3
  = f.hidden_field :spam_answer, :value => "hemidemisemiquaver"
4
4
  = f.hidden_field :valid_spam_answer, :value => Digest::MD5.hexdigest("hemidemisemiquaver")
5
5
 
6
- #comment_form_container.form-area
7
- .set
8
- %p.title
9
- = f.label :author, t('author')
10
- = f.text_field :author
11
- %p
12
- = f.label :author_url, t('url')
13
- = f.text_field :author_url
14
- %p
15
- = f.label :author_email, t('email')
16
- = f.text_field :author_email
17
- %p
18
- %label{:for => "comment_content"}= t('comment')
19
- %br/
20
- = f.text_area :content, :rows => 10, :cols => 72, :class => "textarea"
21
- %p
22
- %label{:for => "comment_filter_id"}= t('filter')
23
- = f.select :filter_id, [['<none>', '']] + TextFilter.descendants.map { |s| s.filter_name }.sort
24
- %p
25
- Referred by:
26
- = f.object.referrer
27
- %p
28
- Browser:
29
- = f.object.user_agent
30
- %p
31
- Author's IP Address:
32
- = f.object.author_ip
6
+ %p.title
7
+ = f.label :author, t('author')
8
+ = f.text_field :author, :class => :textbox
33
9
 
34
- %p.buttons
10
+ .drawer
11
+ #attributes.drawer_contents
12
+ %table.fieldset
13
+ %tr
14
+ %th.label
15
+ = f.label :author_url, t('url')
16
+ %td.field
17
+ = f.text_field :author_url, :class => :textbox
18
+ %tr
19
+ %th.label
20
+ = f.label :author_email, t('email')
21
+ %td.field
22
+ = f.text_field :author_email, :class => :textbox
23
+ %tr
24
+ %th.label
25
+ %label{ :for => :referrer }= t('referrer')
26
+ %td.field
27
+ %input.textbox{ :value => f.object.referrer }
28
+ %tr
29
+ %th.label
30
+ %label{ :for => :browser }= t('browser')
31
+ %td.field
32
+ %input.textbox{ :value => f.object.user_agent }
33
+ %tr
34
+ %th.label
35
+ %label{ :for => :ip }= t('ip')
36
+ %td.field
37
+ %input.textbox{ :value => f.object.author_ip }
38
+
39
+ .drawer_handle
40
+ %a.more.toggle{ :href => "#attributes", :rel => "toggle[attributes]" } More
41
+
42
+ #tab_control
43
+ .tabs
44
+ %a.tab.here{ :href => "#" }
45
+ %span= t("comment")
46
+ .pages
47
+ .page
48
+ .part
49
+ %p
50
+ %label{ :for => "comment_filter_id" }= t("filter")
51
+ = f.select :filter_id, [["<none>", ""]] + TextFilter.descendants.map { |s| s.filter_name }.sort
52
+ %div
53
+ = f.text_area :content, :class => "textarea large", :style => "width:100%"
54
+
55
+ .buttons
35
56
  = save_model_button(@comment)
36
57
  = t('or')
37
58
  = link_to t('cancel'), :back
@@ -1,57 +1,28 @@
1
- - content_for :page_scripts do
2
- :plain
3
- document.observe('dom:loaded', function(){
4
- Event.addBehavior({
5
- 'tr.comment td.content': function(event){
6
- $(this).observe('click', function(event){
7
- if($(this).down('blockquote.expanded')){
8
- $(this).down('blockquote.expanded').toggle();
9
- $(this).down('blockquote.short').toggle();
10
- }
11
- event.stop();
12
- });
13
- }
14
- });
15
- });
16
-
17
1
  - include_stylesheet 'admin/comments'
18
2
 
19
3
  .outset
20
- #filters
21
- %ul.comment-nav
22
- - if @page
23
- %li
24
- = "#{@page.comments.count.to_s} #{t("comment_states.#{params[:status]}")} " if params[:status]
25
- = "#{pluralize(@page.comments.count, 'Comment')} on #{link_to @page.title, edit_admin_page_path(@page)}"
26
- %li.all
27
- = link_or_span_unless_current(t('comment_states.all'), :status => 'all', :page_id => params[:page_id])
28
- %li.approved
29
- = link_or_span_unless_current(t('comment_states.approved'), :status => "approved", :page_id => params[:page_id])
30
- %li.unapproved
31
- = link_or_span_unless_current(t('comment_states.unapproved'), :status => "unapproved", :page_id => params[:page_id])
32
-
33
-
34
- #comments_table
35
- %table#comments.index
36
- %thead
37
- %tr
38
- %th= t('content')
39
- %th= t('date_string')
40
- %th= t('author')
41
- - unless @page
42
- %th= t('page')
43
- %th= t('actions')
44
- %tbody
45
- = render(:partial => "comment", :collection => @comments) || %Q[<tr><td class="note" colspan="#{@page ? 4 : 5}">No comments</td></tr>]
46
- %p
47
- %small.notice
48
- = Comment.spam_filter.message
49
-
4
+ %table#comments.index
5
+ %thead
6
+ %tr
7
+ %th= t('comment')
8
+ - unless @page
9
+ %th= t('page')
10
+ %th= t('date_string')
11
+ %th= t('author')
12
+ %th.actions= t('actions')
13
+ %tbody
14
+ = render(:partial => "comment", :collection => @comments) || %Q[<tr><td class="note" colspan="#{@page ? 4 : 5}">No comments</td></tr>]
50
15
 
51
16
  #actions
52
17
  = will_paginate @comments
53
18
  %ul
19
+ %li.all
20
+ = link_to "#{image('comments')} #{t('comment_states.all')}", "/admin/comments/all"
21
+ %li.approved
22
+ = link_to "#{image('accept')} #{t('comment_states.approved')}", "/admin/comments/approved"
23
+ %li.unapproved
24
+ = link_to "#{image('error')} #{t('comment_states.unapproved')}", "/admin/comments/unapproved"
54
25
  %li
55
- = link_to "#{image('table_save')} #{t('download_csv')}", :format => :csv
26
+ = link_to "#{image('comments_delete')} #{t('delete_unapproved')}", destroy_unapproved_admin_comments_url, :class => 'delete-unapproved', :method => :delete, :confirm => 'Delete all unapproved comments?'
56
27
  %li
57
- = link_to "#{image('comments_delete')} #{t('delete_unapproved')}", destroy_unapproved_admin_comments_url, :class => 'delete-unapproved', :method => :delete, :confirm => 'Is it OK to delete ALL Unapproved Comments?'
28
+ = link_to "#{image('table_save')} #{t('download_csv')}", :format => :csv
@@ -1,7 +1,14 @@
1
- %p{:style => "clear:left"}
2
- %label{:for => "page_enable_comments"}
1
+ - include_stylesheet 'admin/comments/page_field'
2
+
3
+ %tr.comments
4
+ %th.label= t("comments")
5
+ %td
3
6
  = check_box "page", "enable_comments"
4
- = t('allow_comments_on_page')
5
- - unless @page.new_record? or @page.comments_count < 1
6
- %small
7
- = link_to t('currently_x_view_comments', :count => @page.comments_count), admin_page_comments_path(:page_id => @page.id)
7
+ %label{ :for => "page_enable_comments" }
8
+ = t("allow_comments_on_page")
9
+
10
+ - if @page.comments_count > 0
11
+ %tr.comments
12
+ %th.label= t("moderate")
13
+ %td
14
+ = link_to t('moderate_comments'), admin_page_comments_path(:page_id => @page.id)
@@ -17,9 +17,7 @@ class CommentsExtension < Radiant::Extension
17
17
  end
18
18
 
19
19
  if admin.respond_to? :page
20
- admin.page.edit.add :parts_bottom, "edit_comments_enabled", :before => "edit_timestamp"
21
- admin.page.index.add :sitemap_head, "index_head_view_comments"
22
- admin.page.index.add :node, "index_view_comments"
20
+ admin.page.edit.add :extended_metadata, "edit_comments_enabled"
23
21
  end
24
22
 
25
23
  tab "Content" do
@@ -4,6 +4,7 @@ en:
4
4
  author: Author
5
5
  approve_comment: Approve comment
6
6
  are_you_sure_you_want_to_delete_this_comment: Are you sure you want to delete this comment?
7
+ browser: Browser
7
8
  click_to_toggle: Click to toggle complete text
8
9
  currently_x_view_comments: Currently {{count}} - show reactions
9
10
  comment: Comment
@@ -19,8 +20,12 @@ en:
19
20
  download_csv: Download CSV
20
21
  edit_comment: Edit comment
21
22
  edit_comment_on: Edit comment on
22
- email: E-mail
23
+ email: Email
24
+ ip: Address
23
25
  message_unsure: Please type the letters that you see to prove that you are not a spambot
26
+ moderate: Moderate
27
+ moderate_comments: View comments for this page
28
+ referrer: Referrer
24
29
  unapprove_comment: Unapprove comment
25
30
  url: URL
26
31
  your_name: Your Name (as you'd like it to appear on this comment)
@@ -1,4 +1,4 @@
1
- nl:
1
+ nl:
2
2
  actions: Acties
3
3
  allow_comments_on_page: Reacties toelaten?
4
4
  author: Auteur
@@ -21,6 +21,9 @@ nl:
21
21
  edit_comment_on: Wijzig reactie op
22
22
  email: E-mail
23
23
  message_unsure: Vul onderstaande CAPTCHA in om te bewijzen dat je geen spam-bot bent
24
+ moderate: Moderate
25
+ moderate_comments: View comments for this page
26
+ referrer: Referrer
24
27
  unapprove_comment: Reactie terug naar Te modereren
25
28
  url: URL
26
29
  your_name: Naam (die je bij deze reactie wilt tonen)
@@ -1,3 +1,3 @@
1
1
  module RadiantCommentsExtension
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
@@ -1,33 +1,8 @@
1
- .comment-nav {
2
- background: #ccc;
3
- border-top: 1px solid #ccc;
4
- border-bottom: 1px solid #ccc;
5
- list-style: none;
6
- margin: 0;
7
- padding: 10px; }
8
- .comment-nav li {
9
- display: inline;
10
- margin: 0 5px 0 0; }
11
- .comment-nav a, .comment-nav span {
12
- padding: 5px 5px 5px 25px;
13
- background-position: 5px center;
14
- background-repeat: no-repeat; }
15
- .comment-nav a, .comment-nav a:visited {
16
- color: black; }
17
- .comment-nav span {
18
- border: 1px solid #e8e8e8;
19
- background-color: #eee; }
20
- .all span, .all a {
21
- background-image: url(/images/admin/comments.png); }
22
- .approved span, .approved a {
23
- background-image: url(/images/admin/accept.png); }
24
- .unapproved span, .unapproved a {
25
- background-image: url(/images/admin/error.png); }
26
-
27
- #content .outset {
28
- margin-bottom: 40px;
29
- }
30
-
31
- .controls-column, .date-column, .author-column { white-space: nowrap }
32
- .comment-unapproved { background-color: #ffe; }
33
- .comment a, .comment a:visited { color: black; }
1
+ .comment_row td {
2
+ height: 31px; }
3
+ .comment_row td.page, .comment_row td.date {
4
+ font-size: 10px; }
5
+ .comment_row .actions .approve {
6
+ margin-right: 38px; }
7
+ .comment_row .actions .approve:hover, .comment_row .actions .approve:focus {
8
+ margin-right: 37px; }
@@ -0,0 +1 @@
1
+ tr.comments a{color:white}
@@ -0,0 +1,14 @@
1
+ .comment_row {
2
+ td {
3
+ height: 31px;
4
+ &.page, &.date {
5
+ font-size: 10px;
6
+ }
7
+ }
8
+ .actions .approve {
9
+ margin-right: 38px;
10
+ &:hover, &:focus {
11
+ margin-right: 37px;
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,5 @@
1
+ tr.comments {
2
+ a {
3
+ color: white;
4
+ }
5
+ }
metadata CHANGED
@@ -1,15 +1,10 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: radiant-comments-extension
3
- version: !ruby/object:Gem::Version
4
- hash: 23
3
+ version: !ruby/object:Gem::Version
5
4
  prerelease:
6
- segments:
7
- - 1
8
- - 0
9
- - 0
10
- version: 1.0.0
5
+ version: 1.0.1
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Jim Gay
14
9
  - Ryan Heneise
15
10
  - Sean Cribbs
@@ -28,68 +23,49 @@ authors:
28
23
  autorequire:
29
24
  bindir: bin
30
25
  cert_chain: []
31
-
32
- date: 2010-10-11 00:00:00 -05:00
33
- default_executable:
34
- dependencies:
35
- - !ruby/object:Gem::Dependency
26
+ date: 2010-10-11 00:00:00.000000000 Z
27
+ dependencies:
28
+ - !ruby/object:Gem::Dependency
36
29
  name: fastercsv
37
30
  prerelease: false
38
- requirement: &id001 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
31
+ version_requirements: &6968 !ruby/object:Gem::Requirement
32
+ requirements:
41
33
  - - ~>
42
- - !ruby/object:Gem::Version
43
- hash: 11
44
- segments:
45
- - 1
46
- - 5
47
- - 4
34
+ - !ruby/object:Gem::Version
48
35
  version: 1.5.4
36
+ none: false
37
+ requirement: *6968
49
38
  type: :runtime
50
- version_requirements: *id001
51
- - !ruby/object:Gem::Dependency
39
+ - !ruby/object:Gem::Dependency
52
40
  name: mollom
53
41
  prerelease: false
54
- requirement: &id002 !ruby/object:Gem::Requirement
55
- none: false
56
- requirements:
42
+ version_requirements: &7028 !ruby/object:Gem::Requirement
43
+ requirements:
57
44
  - - ~>
58
- - !ruby/object:Gem::Version
59
- hash: 17
60
- segments:
61
- - 0
62
- - 2
63
- - 3
45
+ - !ruby/object:Gem::Version
64
46
  version: 0.2.3
47
+ none: false
48
+ requirement: *7028
65
49
  type: :runtime
66
- version_requirements: *id002
67
- - !ruby/object:Gem::Dependency
50
+ - !ruby/object:Gem::Dependency
68
51
  name: sanitize
69
52
  prerelease: false
70
- requirement: &id003 !ruby/object:Gem::Requirement
71
- none: false
72
- requirements:
53
+ version_requirements: &7072 !ruby/object:Gem::Requirement
54
+ requirements:
73
55
  - - ~>
74
- - !ruby/object:Gem::Version
75
- hash: 9
76
- segments:
77
- - 2
78
- - 0
79
- - 3
56
+ - !ruby/object:Gem::Version
80
57
  version: 2.0.3
58
+ none: false
59
+ requirement: *7072
81
60
  type: :runtime
82
- version_requirements: *id003
83
61
  description: Adds blog-like comment functionality to Radiant.
84
62
  email: jim@saturnflyer.com
85
63
  executables: []
86
-
87
64
  extensions: []
88
-
89
- extra_rdoc_files:
65
+ extra_rdoc_files:
90
66
  - README.rdoc
91
67
  - TODO
92
- files:
68
+ files:
93
69
  - .gitignore
94
70
  - CHANGELOG
95
71
  - Gemfile
@@ -114,8 +90,6 @@ files:
114
90
  - app/views/admin/comments/index.html.haml
115
91
  - app/views/admin/pages/_comments.html.haml
116
92
  - app/views/admin/pages/_edit_comments_enabled.html.haml
117
- - app/views/admin/pages/_index_head_view_comments.html.haml
118
- - app/views/admin/pages/_index_view_comments.html.haml
119
93
  - app/views/comment_mailer/comment_notification.rhtml
120
94
  - autotest/discover.rb
121
95
  - comments_extension.rb
@@ -150,6 +124,9 @@ files:
150
124
  - public/images/admin/table_save.png
151
125
  - public/images/admin/tick.png
152
126
  - public/stylesheets/admin/comments.css
127
+ - public/stylesheets/admin/comments/page_field.css
128
+ - public/stylesheets/sass/admin/comments.scss
129
+ - public/stylesheets/sass/admin/comments/page_field.scss
153
130
  - radiant-comments-extension.gemspec
154
131
  - spec/controllers/admin/comments_controller_spec.rb
155
132
  - spec/controllers/admin/comments_routing_spec.rb
@@ -167,43 +144,32 @@ files:
167
144
  - test/integration/comment_enabling_test.rb
168
145
  - test/test_helper.rb
169
146
  - test/unit/comment_test.rb
170
- has_rdoc: true
171
147
  homepage: http://github.com/saturnflyer/radiant-comments-extension
172
148
  licenses: []
173
-
174
149
  post_install_message:
175
- rdoc_options:
150
+ rdoc_options:
176
151
  - --charset=UTF-8
177
- require_paths:
152
+ require_paths:
178
153
  - lib
179
- required_ruby_version: !ruby/object:Gem::Requirement
154
+ required_ruby_version: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - ! '>='
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
180
159
  none: false
181
- requirements:
182
- - - ">="
183
- - !ruby/object:Gem::Version
184
- hash: 3
185
- segments:
186
- - 0
187
- version: "0"
188
- required_rubygems_version: !ruby/object:Gem::Requirement
189
- none: false
190
- requirements:
191
- - - ">="
192
- - !ruby/object:Gem::Version
193
- hash: 23
194
- segments:
195
- - 1
196
- - 3
197
- - 6
160
+ required_rubygems_version: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - ! '>='
163
+ - !ruby/object:Gem::Version
198
164
  version: 1.3.6
165
+ none: false
199
166
  requirements: []
200
-
201
167
  rubyforge_project:
202
- rubygems_version: 1.3.9.3
168
+ rubygems_version: 1.8.10
203
169
  signing_key:
204
170
  specification_version: 3
205
171
  summary: Comments Extension for Radiant CMS
206
- test_files:
172
+ test_files:
207
173
  - spec/controllers/admin/comments_controller_spec.rb
208
174
  - spec/controllers/admin/comments_routing_spec.rb
209
175
  - spec/controllers/page_postback_spec.rb
@@ -1 +0,0 @@
1
- %th.comments= t('comments')
@@ -1,7 +0,0 @@
1
- %td.comment_link
2
- - if page.respond_to?('enable_comments')
3
- %small
4
- - if page.enable_comments
5
- = link_to "#{page.comments_count} comments", admin_page_comments_path(:page_id => page.id)
6
- - else
7
- = link_to "Enable", admin_page_enable_comments_path(:page_id => page.id), :method => :put