2020-03-09 13:42:32 +05:30
|
|
|
.broadcast-banner-message.js-broadcast-banner-message-preview.mt-2{ style: broadcast_message_style(@broadcast_message), class: ('hidden' unless @broadcast_message.banner? ) }
|
|
|
|
= sprite_icon('bullhorn', size: 16, css_class:'vertical-align-text-top')
|
2016-04-02 18:10:28 +05:30
|
|
|
.js-broadcast-message-preview
|
2016-11-03 12:29:30 +05:30
|
|
|
- if @broadcast_message.message.present?
|
|
|
|
= render_broadcast_message(@broadcast_message)
|
|
|
|
- else
|
2017-08-17 22:00:37 +05:30
|
|
|
Your message here
|
2020-03-09 13:42:32 +05:30
|
|
|
.d-flex.justify-content-center
|
|
|
|
.broadcast-notification-message.preview.js-broadcast-notification-message-preview.mt-2{ class: ('hidden' unless @broadcast_message.notification? ) }
|
|
|
|
= sprite_icon('bullhorn', size: 16, css_class:'vertical-align-text-top')
|
|
|
|
.js-broadcast-message-preview
|
|
|
|
- if @broadcast_message.message.present?
|
|
|
|
= render_broadcast_message(@broadcast_message)
|
|
|
|
- else
|
|
|
|
Your message here
|
2016-01-19 16:12:03 +05:30
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
= 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-09 13:42:32 +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
|
2020-03-09 13:42:32 +05:30
|
|
|
= f.text_area :message, class: "form-control 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-09 13:42:32 +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
|
2019-10-12 21:52:04 +05:30
|
|
|
= f.label :color, _("Background color")
|
2016-01-19 16:12:03 +05:30
|
|
|
.col-sm-10
|
2019-10-12 21:52:04 +05:30
|
|
|
.input-group
|
|
|
|
.input-group-prepend
|
|
|
|
.input-group-text.label-color-preview{ :style => 'background-color: ' + @broadcast_message.color + '; color: ' + @broadcast_message.font }
|
|
|
|
= ' '.html_safe
|
2020-03-09 13:42:32 +05:30
|
|
|
= f.text_field :color, class: "form-control js-broadcast-message-color"
|
2019-10-12 21:52:04 +05:30
|
|
|
.form-text.text-muted
|
|
|
|
= _('Choose any color.')
|
|
|
|
%br
|
|
|
|
= _("Or you can choose one of the suggested colors below")
|
|
|
|
|
|
|
|
= render_suggested_colors
|
|
|
|
|
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
|
|
|
|
= f.label :font, "Font Color"
|
2016-01-19 16:12:03 +05:30
|
|
|
.col-sm-10
|
2019-10-12 21:52:04 +05:30
|
|
|
= f.color_field :font, class: "form-control 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
|
|
|
|
= f.text_field :target_path, class: "form-control"
|
|
|
|
.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?
|
2018-12-05 23:21:45 +05:30
|
|
|
= f.submit "Update broadcast message", class: "btn btn-success"
|
2016-01-19 16:12:03 +05:30
|
|
|
- else
|
2018-12-05 23:21:45 +05:30
|
|
|
= f.submit "Add broadcast message", class: "btn btn-success"
|