1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
- parsed_with_gfm = (_("Content parsed with %{link}.") % { link: link_to('GitLab Flavored Markdown', help_page_path('user/markdown'), target: '_blank') }).html_safe
= gitlab_ui_form_for @appearance, url: admin_application_settings_appearances_path, html: { class: 'gl-mt-3' } do |f|
= form_errors(@appearance)
.row
.col-lg-4
%h4.gl-mt-0= _('Navigation bar')
.col-lg-8
.form-group
= f.label :header_logo, _('Header logo'), class: 'col-form-label gl-pt-0'
%p
- if @appearance.header_logo?
= image_tag @appearance.header_logo_path, class: 'appearance-light-logo-preview'
- if @appearance.persisted?
%br
= render Pajamas::ButtonComponent.new(variant: :danger, category: :secondary, size: :small, method: :delete, href: header_logos_admin_application_settings_appearances_path, button_options: { data: { confirm: _("Header logo will be removed. Are you sure?"), confirm_btn_variant: "danger" }, aria: { label: _('Remove header logo') } }) do
= _('Remove header logo')
%hr
= f.hidden_field :header_logo_cache
= f.file_field :header_logo, class: "", accept: 'image/*'
.form-text.text-muted
= _('Maximum file size is 1MB. Pages are optimized for a 24px tall header logo')
%hr
.row
.col-lg-4
%h4.gl-mt-0 Favicon
.col-lg-8
.form-group
= f.label :favicon, _('Favicon'), class: 'col-form-label gl-pt-0'
%p
- if @appearance.favicon?
= image_tag @appearance.favicon_path, class: 'appearance-light-logo-preview'
- if @appearance.persisted?
%br
= render Pajamas::ButtonComponent.new(variant: :danger, category: :secondary, size: :small, method: :delete, href: favicon_admin_application_settings_appearances_path, button_options: { data: { confirm: _("Favicon will be removed. Are you sure?"), confirm_btn_variant: "danger" }, aria: { label: _('Remove favicon') } }) do
= _('Remove favicon')
%hr
= f.hidden_field :favicon_cache
= f.file_field :favicon, class: '', accept: 'image/*'
.form-text.text-muted
= _("Maximum file size is 1 MB. Image size must be 32 x 32 pixels. Allowed image formats are %{favicon_extension_allowlist}.") % { favicon_extension_allowlist: favicon_extension_allowlist }
%br
= _("Images with incorrect dimensions are not resized automatically, and may result in unexpected behavior.")
= render partial: 'admin/application_settings/appearances/system_header_footer_form', locals: { form: f }
%hr
.row
.col-lg-4
%h4.gl-mt-0= _('Sign in/Sign up pages')
.col-lg-8
.form-group
= f.label :title, class: 'col-form-label'
= f.text_field :title, class: "form-control gl-form-input"
.form-group
= f.label :description, class: 'col-form-label'
= f.text_area :description, class: "form-control gl-form-input", rows: 10
.form-text.text-muted
= parsed_with_gfm
.form-group
= f.label :logo, class: 'col-form-label gl-pt-0'
%p
- if @appearance.logo?
= image_tag @appearance.logo_path, class: 'appearance-logo-preview'
- if @appearance.persisted?
%br
= render Pajamas::ButtonComponent.new(variant: :danger, category: :secondary, size: :small, method: :delete, href: logo_admin_application_settings_appearances_path, button_options: { data: { confirm: _("Logo will be removed. Are you sure?"), confirm_btn_variant: "danger" }, aria: { label: _('Remove logo') } }) do
= _('Remove logo')
%hr
= f.hidden_field :logo_cache
= f.file_field :logo, class: "", accept: 'image/*'
.form-text.text-muted
= _('Maximum file size is 1 MB. Pages are optimized for a 128x128 px logo.')
%hr
.row
.col-lg-4
%h4.gl-mt-0= _('Progressive Web App (PWA)')
.col-lg-8
.form-group
= f.label _("Name"), class: 'col-form-label'
= f.text_field :pwa_name, class: "form-control gl-form-input"
.form-group
= f.label _("Short name"), class: 'col-form-label'
= f.text_field :pwa_short_name, class: "form-control gl-form-input"
.form-group
= f.label _("Description"), class: 'col-form-label'
= f.text_area :pwa_description, class: "form-control gl-form-input", rows: 10
.form-text.text-muted
= parsed_with_gfm
.form-group
= f.label :pwa_icon, class: 'col-form-label gl-pt-0'
%p
- if @appearance.pwa_icon?
= image_tag @appearance.pwa_icon_path, class: 'appearance-pwa-icon-preview'
- if @appearance.persisted?
%br
= render Pajamas::ButtonComponent.new(variant: :danger, category: :secondary, size: :small, method: :delete, href: pwa_icon_admin_application_settings_appearances_path, button_options: { data: { confirm: _("Icon will be removed. Are you sure?"), confirm_btn_variant: "danger" }, aria: { label: _('Remove icon') } }) do
= _('Remove icon')
%hr
= f.hidden_field :pwa_icon_cache
= f.file_field :pwa_icon, class: "", accept: 'image/*'
.form-text.text-muted
= _('Maximum file size is 1MB.')
%hr
.row
.col-lg-4
%h4.gl-mt-0= _('New project pages')
.col-lg-8
.form-group
= f.label :new_project_guidelines, class: 'col-form-label'
%p
= f.text_area :new_project_guidelines, class: "form-control gl-form-input", rows: 10
.form-text.text-muted
= parsed_with_gfm
%hr
.row
.col-lg-4
%h4.gl-mt-0= _('Profile image guideline')
.col-lg-8
.form-group
= f.label :profile_image_guidelines, class: 'col-form-label'
%p
= f.text_area :profile_image_guidelines, class: "form-control gl-form-input", rows: 10
.form-text.text-muted
= parsed_with_gfm
.gl-mt-3.gl-mb-3
= f.submit _('Update appearance settings'), pajamas_button: true
- if @appearance.persisted? || @appearance.updated_at
.mt-4
- if @appearance.persisted?
Preview last save:
= link_to _('Sign-in page'), preview_sign_in_admin_application_settings_appearances_path, class: 'btn', target: '_blank', rel: 'noopener noreferrer'
= link_to _('New project page'), new_project_path, class: 'btn', target: '_blank', rel: 'noopener noreferrer'
- if @appearance.updated_at
%span.float-right
Last edit #{time_ago_with_tooltip(@appearance.updated_at)}
|