diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-04-02 17:26:59 +0300 |
---|---|---|
committer | Alexandru Croitor <acroitor@gitlab.com> | 2019-02-21 18:55:51 +0300 |
commit | 28e1739a3fd8c93e4805fe0053faf820cec4e1bc (patch) | |
tree | e4f8e3e45155c2410d2e5fb9e3f02be4175acf37 /app/models/appearance.rb | |
parent | c8bf9f78f3e481cb7e74384fa45b46b864fa523a (diff) |
Port EE System Header And Footer feature to CE
remove EE specific code
remove EE licence checks
move migration from EE to CE folder structure
move specs from EE to CE folder structure
remove EE specific flag specs
Diffstat (limited to 'app/models/appearance.rb')
-rw-r--r-- | app/models/appearance.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/models/appearance.rb b/app/models/appearance.rb index ff1ecfda684..b9ad676ca47 100644 --- a/app/models/appearance.rb +++ b/app/models/appearance.rb @@ -8,12 +8,19 @@ class Appearance < ActiveRecord::Base cache_markdown_field :description cache_markdown_field :new_project_guidelines + cache_markdown_field :header_message, pipeline: :broadcast_message + cache_markdown_field :footer_message, pipeline: :broadcast_message validates :logo, file_size: { maximum: 1.megabyte } validates :header_logo, file_size: { maximum: 1.megabyte } + validates :message_background_color, allow_blank: true, color: true + validates :message_font_color, allow_blank: true, color: true validate :single_appearance_row, on: :create + default_value_for :message_background_color, '#E75E40' + default_value_for :message_font_color, '#FFFFFF' + mount_uploader :logo, AttachmentUploader mount_uploader :header_logo, AttachmentUploader mount_uploader :favicon, FaviconUploader @@ -41,6 +48,14 @@ class Appearance < ActiveRecord::Base logo_system_path(favicon, 'favicon') end + def show_header? + header_message.present? + end + + def show_footer? + footer_message.present? + end + private def logo_system_path(logo, mount_type) |