diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-12-31 15:19:13 -0500 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-01-13 11:34:19 -0500 |
commit | 7e24c5c45afe1ada044a782f27d3f3413043b1e6 (patch) | |
tree | 131e62f3bdb00b9cc52aec9258003b94be59f2be /app/views/admin/broadcast_messages/_form.html.haml | |
parent | 1c7febc3e38053e8d01cf7a30d3da23b95f30808 (diff) | |
download | gitlab-ce-7e24c5c45afe1ada044a782f27d3f3413043b1e6.tar.gz |
Move broadcast message form to a partial
Diffstat (limited to 'app/views/admin/broadcast_messages/_form.html.haml')
-rw-r--r-- | app/views/admin/broadcast_messages/_form.html.haml | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/app/views/admin/broadcast_messages/_form.html.haml b/app/views/admin/broadcast_messages/_form.html.haml new file mode 100644 index 00000000000..0ca3be0bd54 --- /dev/null +++ b/app/views/admin/broadcast_messages/_form.html.haml @@ -0,0 +1,37 @@ +.broadcast-message-preview + = icon('bullhorn') + %span Your message here + += form_for [:admin, @broadcast_message], html: { class: 'broadcast-message-form form-horizontal js-requires-input'} do |f| + -if @broadcast_message.errors.any? + .alert.alert-danger + - @broadcast_message.errors.full_messages.each do |msg| + %p= msg + .form-group + = f.label :message, class: 'control-label' + .col-sm-10 + = f.text_area :message, class: "form-control", rows: 2, required: true + .form-group.js-toggle-colors-container + .col-sm-10.col-sm-offset-2 + = link_to 'Customize colors', '#', class: 'js-toggle-colors-link' + .form-group.js-toggle-colors-container.hide + = f.label :color, "Background Color", class: 'control-label' + .col-sm-10 + = f.color_field :color, value: "#E75E40", class: "form-control" + .form-group.js-toggle-colors-container.hide + = f.label :font, "Font Color", class: 'control-label' + .col-sm-10 + = f.color_field :font, value: "#FFFFFF", class: "form-control" + .form-group + = f.label :starts_at, class: 'control-label' + .col-sm-10.datetime-controls + = f.datetime_select :starts_at, {}, class: 'form-control form-control-inline' + .form-group + = f.label :ends_at, class: 'control-label' + .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-create" + - else + = f.submit "Add broadcast message", class: "btn btn-create" |