debian-mirror-gitlab/app/views/admin/broadcast_messages/_form.html.haml
2020-01-01 13:55:28 +05:30

62 lines
2.3 KiB
Text

.broadcast-message-preview{ style: broadcast_message_style(@broadcast_message) }
= sprite_icon('bullhorn', size: 16, css_class:'vertical-align-text-top mr-2')
.js-broadcast-message-preview
- if @broadcast_message.message.present?
= render_broadcast_message(@broadcast_message)
- else
Your message here
= form_for [:admin, @broadcast_message], html: { class: 'broadcast-message-form js-quick-submit js-requires-input'} do |f|
= form_errors(@broadcast_message)
.form-group.row
.col-sm-2.col-form-label
= f.label :message
.col-sm-10
= f.text_area :message, class: "form-control js-autosize",
required: true,
dir: 'auto',
data: { preview_path: preview_admin_broadcast_messages_path }
.form-group.row
.col-sm-2.col-form-label
= f.label :color, _("Background color")
.col-sm-10
.input-group
.input-group-prepend
.input-group-text.label-color-preview{ :style => 'background-color: ' + @broadcast_message.color + '; color: ' + @broadcast_message.font }
= ' '.html_safe
= f.text_field :color, class: "form-control"
.form-text.text-muted
= _('Choose any color.')
%br
= _("Or you can choose one of the suggested colors below")
= render_suggested_colors
.form-group.row.js-toggle-colors-container.toggle-colors.hide
.col-sm-2.col-form-label
= f.label :font, "Font Color"
.col-sm-10
= f.color_field :font, class: "form-control text-font-color"
.form-group.row
.col-sm-2.col-form-label
= f.label :target_path, _('Target Path')
.col-sm-10
= f.text_field :target_path, class: "form-control"
.form-text.text-muted
= _('Paths can contain wildcards, like */welcome')
.form-group.row
.col-sm-2.col-form-label
= f.label :starts_at, _("Starts at (UTC)")
.col-sm-10.datetime-controls
= f.datetime_select :starts_at, {}, class: 'form-control form-control-inline'
.form-group.row
.col-sm-2.col-form-label
= f.label :ends_at, _("Ends at (UTC)")
.col-sm-10.datetime-controls
= f.datetime_select :ends_at, {}, class: 'form-control form-control-inline'
.form-actions
- if @broadcast_message.persisted?
= f.submit "Update broadcast message", class: "btn btn-success"
- else
= f.submit "Add broadcast message", class: "btn btn-success"