diff options
author | Alexis Reigel <alexis.reigel.ext@siemens.com> | 2017-12-06 23:04:53 +0300 |
---|---|---|
committer | Alexis Reigel <mail@koffeinfrei.org> | 2018-06-05 17:20:21 +0300 |
commit | 9e14f437b6ed205744d916f5566ee2c11e52b734 (patch) | |
tree | 5c4bf1237cfc4a6cf73f30f942d25e0ab4f0973c /app/views/admin/appearances | |
parent | 5202c3f0c8da618e2d3821917f6f5d48ae8ae3c2 (diff) |
create favicon overlay on the client
the initial reason for this change was that graphicsmagick does not
support writing to ico files. this fact lead to a chain of changes:
1. use png instead of ico (browser support is good enough)
2. render the overlays on the client using the canvas API. this way we
only need to store the original favion and generate the overlay versions
dynamically.
this change also enables (next step) to simplify the handling of the
stock favicons as well, as we don't need to generate all the versions
upfront.
Diffstat (limited to 'app/views/admin/appearances')
-rw-r--r-- | app/views/admin/appearances/_form.html.haml | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/views/admin/appearances/_form.html.haml b/app/views/admin/appearances/_form.html.haml index 1119c75637c..f77e22bcc45 100644 --- a/app/views/admin/appearances/_form.html.haml +++ b/app/views/admin/appearances/_form.html.haml @@ -62,13 +62,12 @@ = f.label :favicon, 'Favicon', class: 'control-label' .col-sm-10 - if @appearance.favicon? - = image_tag @appearance.favicon.favicon_main.url, class: 'appearance-light-logo-preview' + = image_tag @appearance.favicon.favicon_main.url, class: 'appearance-light-logo-preview js-main-favicon' - if @appearance.favicon? - = f.label :favicon, 'Generated status icons', class: 'control-label' + = f.label :favicon, 'Status icons preview', class: 'control-label' .col-sm-10 - if @appearance.favicon? - - FaviconUploader::STATUS_ICON_NAMES.each do |status_name| - = image_tag @appearance.favicon.public_send(status_name).url, class: 'appearance-light-logo-preview' + .js-favicons{ data: { favicon: @appearance.favicon.favicon_main.url, status_overlays: Gitlab::Favicon.available_status_overlays } } - if @appearance.persisted? %br = link_to 'Remove favicon', favicon_admin_appearances_path, data: { confirm: "Favicon will be removed. Are you sure?"}, method: :delete, class: "btn btn-remove btn-sm remove-logo" |