Commit 575c695e7d06a08bc3c2c242dca39a635bde0876
1 parent
61b44f06
Exists in
master
and in
29 other branches
[tolerance-time] Moving method to ApplicationHelper
Showing
2 changed files
with
16 additions
and
16 deletions
Show diff stats
app/helpers/application_helper.rb
... | ... | @@ -1365,4 +1365,20 @@ module ApplicationHelper |
1365 | 1365 | :style => 'margin-top: 1em' |
1366 | 1366 | ) |
1367 | 1367 | end |
1368 | + | |
1369 | + def expirable_content_reference(content, action, text, url, options = {}) | |
1370 | + reason = @plugins.dispatch("content_expire_#{action.to_s}", content).first | |
1371 | + options[:title] = reason | |
1372 | + expirable_link_to reason.present?, text, url, options | |
1373 | + end | |
1374 | + | |
1375 | + def expirable_button(content, action, text, url, options = {}) | |
1376 | + options[:class] = "button with-text icon-#{action.to_s}" | |
1377 | + expirable_content_reference content, action, text, url, options | |
1378 | + end | |
1379 | + | |
1380 | + def expirable_comment_link(content, action, text, url, options = {}) | |
1381 | + options[:class] = "comment-footer comment-footer-link comment-footer-hide" | |
1382 | + expirable_content_reference content, action, text, url, options | |
1383 | + end | |
1368 | 1384 | end | ... | ... |
app/helpers/content_viewer_helper.rb
... | ... | @@ -68,20 +68,4 @@ module ContentViewerHelper |
68 | 68 | end |
69 | 69 | end |
70 | 70 | |
71 | - def expirable_content_reference(content, action, text, url, options = {}) | |
72 | - reason = @plugins.dispatch("content_expire_#{action.to_s}", content).first | |
73 | - options[:title] = reason | |
74 | - expirable_link_to reason.present?, text, url, options | |
75 | - end | |
76 | - | |
77 | - def expirable_button(content, action, text, url, options = {}) | |
78 | - options[:class] = "button with-text icon-#{action.to_s}" | |
79 | - expirable_content_reference content, action, text, url, options | |
80 | - end | |
81 | - | |
82 | - def expirable_comment_link(content, action, text, url, options = {}) | |
83 | - options[:class] = "comment-footer comment-footer-link comment-footer-hide" | |
84 | - expirable_content_reference content, action, text, url, options | |
85 | - end | |
86 | - | |
87 | 71 | end | ... | ... |