Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 31 additions & 26 deletions app/views/admin/settings/attachments_settings/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,35 @@ See COPYRIGHT and LICENSE files for more details.
)
%>

<%= styled_form_tag(
admin_settings_attachments_path,
<%= settings_primer_form_with(
url: admin_settings_attachments_path,
scope: :settings,
method: :patch
) do %>
<section class="form--section">
<div class="form--field">
<%= setting_check_box :show_work_package_attachments, container_class: "-slim" %>
<div class="form--field-instructions">
<%= t("settings.attachments.show_work_package_attachments") %>
</div>
</div>
<div class="form--field">
<%= setting_text_field :attachment_max_size, size: 6, unit: t(:"number.human.storage_units.units.kb"), container_class: "-slim" %>
</div>
<div class="form--field">
<%= setting_text_area :attachment_whitelist, rows: 5, container_class: "-wide" %>
<div class="form--field-instructions">
<%= t(
"settings.attachments.whitelist_text_html",
ext_example: "*.jpg",
mime_example: "image/jpeg"
) %>
</div>
</div>
</section>
<%= styled_button_tag t(:button_save), class: "-primary -with-icon icon-checkmark" %>
<% end %>
) do |f|
render_inline_settings_form(f) do |form|
form.check_box(
name: :show_work_package_attachments,
caption: t("settings.attachments.show_work_package_attachments")
)

form.text_field(
name: :attachment_max_size,
size: 6,
input_width: :xsmall,
trailing_visual: { text: { text: t(:"number.human.storage_units.units.kb") } },
caption: (t("settings.attachments.attachment_max_size_env_caption") if form.setting_disabled?(:attachment_max_size))
)

form.text_area(
name: :attachment_whitelist,
caption: t(
"settings.attachments.whitelist_text_html",
ext_example: "*.jpg",
mime_example: "image/jpeg"
),
rows: 5
)

form.submit
end
end %>
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6138,6 +6138,7 @@ en:
You are being redirected to the quarantine page. Use this page to delete or override quarantined files.
title: "Virus scanning"
attachments:
attachment_max_size_env_caption: "You can edit this value via environment variables if you have access."
show_work_package_attachments: >
Deactivating this option will hide the attachments list on the work packages files tab for new projects. The
files attached in the description of a work package will still be uploaded in the internal attachments storage.
Expand Down
Loading