diff options
author | Alexis Reigel <mail@koffeinfrei.org> | 2017-09-26 10:54:32 +0300 |
---|---|---|
committer | Alexis Reigel <mail@koffeinfrei.org> | 2018-06-05 17:20:18 +0300 |
commit | ce6172e863f982c73fedc9f4a73877543c30cb1c (patch) | |
tree | c35bc83d94504d1aa55086d62ff2234d12fe62d4 /app/controllers | |
parent | c8a4d202c99c772822a2b9b09fa6da2c90b2ae81 (diff) |
allow uploading favicon in appearance settings
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/admin/appearances_controller.rb | 9 | ||||
-rw-r--r-- | app/controllers/concerns/uploads_actions.rb | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/app/controllers/admin/appearances_controller.rb b/app/controllers/admin/appearances_controller.rb index ea302f17d16..9aaec905734 100644 --- a/app/controllers/admin/appearances_controller.rb +++ b/app/controllers/admin/appearances_controller.rb @@ -41,6 +41,13 @@ class Admin::AppearancesController < Admin::ApplicationController redirect_to admin_appearances_path, notice: 'Header logo was succesfully removed.' end + def favicon + @appearance.remove_favicon! + @appearance.save + + redirect_to admin_appearances_path, notice: 'Favicon was succesfully removed.' + end + private # Use callbacks to share common setup or constraints between actions. @@ -61,6 +68,8 @@ class Admin::AppearancesController < Admin::ApplicationController logo_cache header_logo header_logo_cache + favicon + favicon_cache new_project_guidelines updated_by ] diff --git a/app/controllers/concerns/uploads_actions.rb b/app/controllers/concerns/uploads_actions.rb index b9b9b6e4e88..80049044124 100644 --- a/app/controllers/concerns/uploads_actions.rb +++ b/app/controllers/concerns/uploads_actions.rb @@ -2,7 +2,7 @@ module UploadsActions include Gitlab::Utils::StrongMemoize include SendFileUpload - UPLOAD_MOUNTS = %w(avatar attachment file logo header_logo).freeze + UPLOAD_MOUNTS = %w(avatar attachment file logo header_logo favicon).freeze def create link_to_file = UploadService.new(model, params[:file], uploader_class).execute |