Commit d2256300 authored by Alexis Reigel's avatar Alexis Reigel

hint the allowed image formats on favicon upload

parent cb564d58
module FaviconHelper
def favicon_extension_whitelist
FaviconUploader::EXTENSION_WHITELIST
.map { |extension| "'.#{extension}'"}
.to_sentence
end
end
class FaviconUploader < AttachmentUploader
EXTENSION_WHITELIST = %w[png ico].freeze
include CarrierWave::MiniMagick
version :favicon_main do
......@@ -11,7 +13,7 @@ class FaviconUploader < AttachmentUploader
end
def extension_whitelist
%w[png ico]
EXTENSION_WHITELIST
end
private
......
......@@ -70,7 +70,9 @@
= f.hidden_field :favicon_cache
= f.file_field :favicon, class: ''
.hint
Maximum file size is 1MB. The resulting favicons will be cropped to be square and scaled down to a size of 32x32 px.
Maximum file size is 1MB. Allowed image formats are #{favicon_extension_whitelist}.
%br
The resulting favicons will be cropped to be square and scaled down to a size of 32x32 px.
.form-actions
= f.submit 'Save', class: 'btn btn-save append-right-10'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment