diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-02-09 14:44:08 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-02-09 14:44:08 +0300 |
commit | aacde42d55cb485413ced7eb64c396c47e58fa47 (patch) | |
tree | b67458e3113a43ab489b08fc63e163dd6df89d5f /app/views | |
parent | ceb342c71648d8055b1dc2c8909a563f82edfcef (diff) | |
parent | 89b3ddd609063d93f39a02279f0f3e23b8b6b364 (diff) |
Merge branch 'rs-broadcast-markdown' into 'master'
Allow limited Markdown in Broadcast Messages
Closes #11853
See merge request !2695
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/admin/broadcast_messages/_form.html.haml | 7 | ||||
-rw-r--r-- | app/views/admin/broadcast_messages/preview.js.haml | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/app/views/admin/broadcast_messages/_form.html.haml b/app/views/admin/broadcast_messages/_form.html.haml index 953b8b69368..5c9403fa0c2 100644 --- a/app/views/admin/broadcast_messages/_form.html.haml +++ b/app/views/admin/broadcast_messages/_form.html.haml @@ -1,6 +1,7 @@ .broadcast-message-preview{ style: broadcast_message_style(@broadcast_message) } = icon('bullhorn') - %span= @broadcast_message.message || "Your message here" + .js-broadcast-message-preview + = render_broadcast_message(@broadcast_message.message.presence || "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? @@ -10,7 +11,9 @@ .form-group = f.label :message, class: 'control-label' .col-sm-10 - = f.text_area :message, class: "form-control js-quick-submit", rows: 2, required: true + = f.text_area :message, class: "form-control js-quick-submit js-autosize", + required: true, + data: { preview_path: preview_admin_broadcast_messages_path } .form-group.js-toggle-colors-container .col-sm-10.col-sm-offset-2 = link_to 'Customize colors', '#', class: 'js-toggle-colors-link' diff --git a/app/views/admin/broadcast_messages/preview.js.haml b/app/views/admin/broadcast_messages/preview.js.haml new file mode 100644 index 00000000000..fbc9453c72e --- /dev/null +++ b/app/views/admin/broadcast_messages/preview.js.haml @@ -0,0 +1 @@ +$('.js-broadcast-message-preview').html("#{j(render_broadcast_message(@message))}"); |