2022-06-21 17:19:12 +05:30
|
|
|
#broadcast-message-preview
|
|
|
|
= render 'preview'
|
2016-01-19 16:12:03 +05:30
|
|
|
|
2022-05-07 20:08:51 +05:30
|
|
|
= gitlab_ui_form_for [:admin, @broadcast_message], html: { class: 'broadcast-message-form js-quick-submit js-requires-input'} do |f|
|
2016-06-02 11:05:42 +05:30
|
|
|
= form_errors(@broadcast_message)
|
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
.form-group.row.mt-4
|
2019-09-04 21:01:54 +05:30
|
|
|
.col-sm-2.col-form-label
|
|
|
|
= f.label :message
|
2016-01-19 16:12:03 +05:30
|
|
|
.col-sm-10
|
2021-03-11 19:13:27 +05:30
|
|
|
= f.text_area :message, class: "form-control gl-form-input js-autosize js-broadcast-message-message",
|
2016-04-02 18:10:28 +05:30
|
|
|
required: true,
|
2019-07-31 22:56:46 +05:30
|
|
|
dir: 'auto',
|
2016-04-02 18:10:28 +05:30
|
|
|
data: { preview_path: preview_admin_broadcast_messages_path }
|
2019-10-12 21:52:04 +05:30
|
|
|
.form-group.row
|
2020-03-13 15:44:24 +05:30
|
|
|
.col-sm-2.col-form-label
|
|
|
|
= f.label :broadcast_type, _('Type')
|
|
|
|
.col-sm-10
|
|
|
|
= f.select :broadcast_type, broadcast_type_options, {}, class: 'form-control js-broadcast-message-type'
|
|
|
|
.form-group.row.js-broadcast-message-background-color-form-group{ class: ('hidden' unless @broadcast_message.banner? ) }
|
2019-09-04 21:01:54 +05:30
|
|
|
.col-sm-2.col-form-label
|
2022-06-21 17:19:12 +05:30
|
|
|
= f.label :theme, _("Theme")
|
2016-01-19 16:12:03 +05:30
|
|
|
.col-sm-10
|
2019-10-12 21:52:04 +05:30
|
|
|
.input-group
|
2022-06-21 17:19:12 +05:30
|
|
|
= f.select :theme, broadcast_theme_options, {}, class: 'form-control js-broadcast-message-theme'
|
2019-10-12 21:52:04 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
.form-group.row.js-broadcast-message-dismissable-form-group{ class: ('hidden' unless @broadcast_message.banner? ) }
|
|
|
|
.col-sm-2.col-form-label.pt-0
|
|
|
|
= f.label :starts_at, _("Dismissable")
|
|
|
|
.col-sm-10
|
2022-05-07 20:08:51 +05:30
|
|
|
= f.gitlab_ui_checkbox_component :dismissable, _('Allow users to dismiss the broadcast message')
|
2022-07-16 23:28:13 +05:30
|
|
|
- if Feature.enabled?(:role_targeted_broadcast_messages)
|
2022-05-07 20:08:51 +05:30
|
|
|
.form-group.row
|
|
|
|
.col-sm-2.col-form-label
|
|
|
|
= f.label :target_access_levels, _('Target roles')
|
|
|
|
.col-sm-10
|
|
|
|
- target_access_level_options.each do |human_access_level, access_level|
|
|
|
|
= f.gitlab_ui_checkbox_component :target_access_levels, human_access_level, checked_value: access_level, unchecked_value: false, checkbox_options: { multiple: true }
|
|
|
|
.form-text.text-muted
|
|
|
|
= _('The broadcast message displays only to users in projects and groups who have these roles.')
|
2018-11-08 19:23:39 +05:30
|
|
|
.form-group.row.js-toggle-colors-container.toggle-colors.hide
|
2019-09-04 21:01:54 +05:30
|
|
|
.col-sm-2.col-form-label
|
2021-06-08 01:23:25 +05:30
|
|
|
= f.label :font, _("Font Color")
|
2016-01-19 16:12:03 +05:30
|
|
|
.col-sm-10
|
2021-03-11 19:13:27 +05:30
|
|
|
= f.color_field :font, class: "form-control gl-form-input text-font-color"
|
2020-01-01 13:55:28 +05:30
|
|
|
.form-group.row
|
|
|
|
.col-sm-2.col-form-label
|
|
|
|
= f.label :target_path, _('Target Path')
|
|
|
|
.col-sm-10
|
2021-03-11 19:13:27 +05:30
|
|
|
= f.text_field :target_path, class: "form-control gl-form-input"
|
2020-01-01 13:55:28 +05:30
|
|
|
.form-text.text-muted
|
|
|
|
= _('Paths can contain wildcards, like */welcome')
|
2018-11-08 19:23:39 +05:30
|
|
|
.form-group.row
|
2019-09-04 21:01:54 +05:30
|
|
|
.col-sm-2.col-form-label
|
|
|
|
= f.label :starts_at, _("Starts at (UTC)")
|
2016-01-19 16:12:03 +05:30
|
|
|
.col-sm-10.datetime-controls
|
|
|
|
= f.datetime_select :starts_at, {}, class: 'form-control form-control-inline'
|
2018-11-08 19:23:39 +05:30
|
|
|
.form-group.row
|
2019-09-04 21:01:54 +05:30
|
|
|
.col-sm-2.col-form-label
|
|
|
|
= f.label :ends_at, _("Ends at (UTC)")
|
2016-01-19 16:12:03 +05:30
|
|
|
.col-sm-10.datetime-controls
|
|
|
|
= f.datetime_select :ends_at, {}, class: 'form-control form-control-inline'
|
|
|
|
.form-actions
|
|
|
|
- if @broadcast_message.persisted?
|
2021-06-08 01:23:25 +05:30
|
|
|
= f.submit _("Update broadcast message"), class: "btn gl-button btn-confirm"
|
2016-01-19 16:12:03 +05:30
|
|
|
- else
|
2021-06-08 01:23:25 +05:30
|
|
|
= f.submit _("Add broadcast message"), class: "btn gl-button btn-confirm"
|