OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/app/views/common/list_attachments.json.erb

8 lines
611 B

<%= attachments.select { |a| a.readable? and a.visible? }
.map { |a| { :content_type => CGI::escape_html(a.content_type),
:filename => CGI::escape_html(a.filename),
:description => CGI::escape_html(a.description),
:url => url_for(:controller => 'attachments', :action => 'show', :id => a, :filename => a.filename),
:is_image => !!a.image? # doing the !! as image? for whatever reason returns null or a number
}
}.to_json.html_safe %>