Sha256: 5234f43db264cf215b19c3c9cea8459fa4eb8609e88b9986d609cc6167e0d370

Contents?: true

Size: 1.99 KB

Versions: 24

Compression:

Stored size: 1.99 KB

Contents

- if @collective.nil?
  - resource = message.new_record? ? message_train.box_messages_path(@box) : message_train.box_message_path(@box, message)
- else
  - resource = message.new_record? ? message_train.collective_box_messages_path(@collective.path_part, @box) : message_train.collective_box_message_path(@collective.path_part, @box, message)
= bootstrap_form_for message, url: resource do |f|
  - if @collective.nil?
    = f.fields_for :recipients_to_save do |g|
      = g.text_field :users, label: :recipients.l, class: 'recipient-input'
    - add_footer_javascript do
      :javascript
        url = '/box/in/participants/users.json'
        var suggestions = new Bloodhound({
            prefetch: url,
            remote: {
                wildcard: '%QUERY',
                url: url + '?query=%QUERY',
                transform: function(response) {
                  return $.map(response.participants, function(val, i) {
                    return val.slug
                  });
                }
            },
            queryTokenizer: Bloodhound.tokenizers.whitespace,
            datumTokenizer: function(item) {
                return Bloodhound.tokenizers.whitespace(item.slug);
            }
        });
  - else
    = render partial: 'message_train/participants/prefilled_field', locals: { message: message, recipient: @collective }
  = f.text_field :subject
  = f.form_group :body, label: { text: MessageTrain::Message.human_attribute_name(:body) } do
    = f.cktext_area :body
  .links
    %h3
      = link_to_add_association(icon('plus'), f, :attachments, title: :add_attachment.l, class: 'btn btn-info', id: 'add-attachment', data: { association_insertion_method: 'append', association_insertion_node: '#attachments'})
      = :attachments.l
  #attachments
    = f.fields_for :attachments do |attachment|
      = render 'attachment_fields', f: attachment
  = f.submit :save_as_draft.l, name: 'message[draft]', id: 'save-as-draft'
  = f.submit :send.l, class: 'btn btn-primary', name: 'message[draft]', id: 'send'

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
message_train-0.7.6 app/views/message_train/messages/_form.html.haml
message_train-0.7.5 app/views/message_train/messages/_form.html.haml
message_train-0.7.3 app/views/message_train/messages/_form.html.haml
message_train-0.7.2 app/views/message_train/messages/_form.html.haml
message_train-0.7.1 app/views/message_train/messages/_form.html.haml
message_train-0.6.17 app/views/message_train/messages/_form.html.haml
message_train-0.6.16 app/views/message_train/messages/_form.html.haml
message_train-0.6.15 app/views/message_train/messages/_form.html.haml
message_train-0.6.14 app/views/message_train/messages/_form.html.haml
message_train-0.6.13 app/views/message_train/messages/_form.html.haml
message_train-0.6.12 app/views/message_train/messages/_form.html.haml
message_train-0.6.11 app/views/message_train/messages/_form.html.haml
message_train-0.6.10 app/views/message_train/messages/_form.html.haml
message_train-0.6.9 app/views/message_train/messages/_form.html.haml
message_train-0.6.8 app/views/message_train/messages/_form.html.haml
message_train-0.6.7 app/views/message_train/messages/_form.html.haml
message_train-0.6.6 app/views/message_train/messages/_form.html.haml
message_train-0.6.5 app/views/message_train/messages/_form.html.haml
message_train-0.6.4 app/views/message_train/messages/_form.html.haml
message_train-0.6.3 app/views/message_train/messages/_form.html.haml