diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-10-24 05:51:14 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-10-24 05:51:14 +0000 |
commit | 51cd2d451ae816c4b0dc36d7bf5d5dc919f7018d (patch) | |
tree | 4f2ade2a170a075d1f274cdcd9129a9d1bb10aa3 /app/helpers/journals_helper.rb | |
parent | 4714b310022d7c5da48686372a58e99d5368c9af (diff) | |
download | redmine-51cd2d451ae816c4b0dc36d7bf5d5dc919f7018d.tar.gz redmine-51cd2d451ae816c4b0dc36d7bf5d5dc919f7018d.zip |
Thumbnails in issue history (#13429).
git-svn-id: http://svn.redmine.org/redmine/trunk@14731 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/journals_helper.rb')
-rw-r--r-- | app/helpers/journals_helper.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/helpers/journals_helper.rb b/app/helpers/journals_helper.rb index dfe729506..d6d6ec4e9 100644 --- a/app/helpers/journals_helper.rb +++ b/app/helpers/journals_helper.rb @@ -18,6 +18,13 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. module JournalsHelper + + # Returns the attachments of a journal that are displayed as thumbnails + def journal_thumbnail_attachments(journal) + ids = journal.details.select {|d| d.property == 'attachment' && d.value.present?}.map(&:prop_key) + ids.any? ? Attachment.where(:id => ids).select(&:thumbnailable?) : [] + end + def render_notes(issue, journal, options={}) content = '' editable = User.current.logged? && (User.current.allowed_to?(:edit_issue_notes, issue.project) || (journal.user == User.current && User.current.allowed_to?(:edit_own_issue_notes, issue.project))) |