provide render_label_sum
This commit is contained in:
parent
f0f440b8d4
commit
54023e3e95
1
Gemfile
1
Gemfile
@ -45,6 +45,7 @@ end
|
||||
if File.file? File.expand_path './.enable_test', __dir__
|
||||
group :development, :test do
|
||||
gem 'active_record_doctor', require: false
|
||||
gem 'rails_best_practices', require: false
|
||||
gem 'bullet'
|
||||
end
|
||||
group :test do
|
||||
|
@ -10,8 +10,5 @@ h1 = link_to h(title), entity_url
|
||||
fieldset.attachments
|
||||
legend = l :label_attachment_plural
|
||||
- entity.attachments.each do |attachment|
|
||||
= link_to_attachment attachment, download: true, only_path: false
|
||||
| (
|
||||
= number_to_human_size attachment.filesize
|
||||
| )
|
||||
= render_label_sum link_to_attachment(attachment, download: true, only_path: false), number_to_human_size(attachment.filesize)
|
||||
br
|
||||
|
@ -231,6 +231,11 @@ module Additionals
|
||||
end
|
||||
end
|
||||
|
||||
def render_label_sum(label, sum)
|
||||
name = label.is_a?(Symbol) ? l(label) : label
|
||||
"#{name} (#{sum})"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def additionals_already_loaded(scope, js_name)
|
||||
|
Loading…
Reference in New Issue
Block a user