Sha256: 0060fff0b272949b9adc02bff5eb296a0d34e2ed848d704faf3f5c9eb7d7b1a6

Contents?: true

Size: 1.55 KB

Versions: 40

Compression:

Stored size: 1.55 KB

Contents

= effective_form_with(model: [:admin, event_notification], engine: true) do |f|
  - if inline_datatable?
    = f.hidden_field :event_id
  - else
    = f.select :event_id, Effective::Event.sorted.all

  = f.select :category, Effective::EventNotification::CATEGORIES,
    label: 'Send an email notification'

  - # Render email templates
  - Effective::EventNotification::CATEGORIES.each do |category|
    - template = 'event_' + category.parameterize.underscore

    = f.show_if :category, category do
      = render "/admin/event_notifications/form_#{template}", f: f

      - if f.object.category == category && f.object.persisted?
        = f.text_field :from
        = f.text_field :subject
        = f.text_area :body, rows: 10

      - elsif EffectiveEvents.use_effective_email_templates == false
        = f.text_field :from, value: EffectiveResources.mailer_sender
        = f.text_field :subject, value: ''
        = f.text_area :body, rows: 10, value: ''

      - else
        - email_template = Effective::EmailTemplate.where(template_name: template).first!

        = f.text_field :from, value: email_template.from
        = f.text_field :subject, value: email_template.subject
        = f.text_area :body, rows: 10, value: email_template.body

      - if EffectiveEvents.use_effective_email_templates

        %p The available variables are:

        %ul
          - Effective::EventNotification::EMAIL_TEMPLATE_VARIABLES.each do |variable|
            %li {{ #{variable} }}

        %small.text-muted Only a developer can add additional variables

  = effective_submit(f)

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
effective_events-0.7.4 app/views/admin/event_notifications/_form.html.haml
effective_events-0.7.3 app/views/admin/event_notifications/_form.html.haml
effective_events-0.7.2 app/views/admin/event_notifications/_form.html.haml
effective_events-0.7.1 app/views/admin/event_notifications/_form.html.haml
effective_events-0.7.0 app/views/admin/event_notifications/_form.html.haml
effective_events-0.6.13 app/views/admin/event_notifications/_form.html.haml
effective_events-0.6.12 app/views/admin/event_notifications/_form.html.haml
effective_events-0.6.11 app/views/admin/event_notifications/_form.html.haml
effective_events-0.6.10 app/views/admin/event_notifications/_form.html.haml
effective_events-0.6.9 app/views/admin/event_notifications/_form.html.haml
effective_events-0.6.8 app/views/admin/event_notifications/_form.html.haml
effective_events-0.6.7 app/views/admin/event_notifications/_form.html.haml
effective_events-0.6.6 app/views/admin/event_notifications/_form.html.haml
effective_events-0.6.5 app/views/admin/event_notifications/_form.html.haml
effective_events-0.6.4 app/views/admin/event_notifications/_form.html.haml
effective_events-0.6.3 app/views/admin/event_notifications/_form.html.haml
effective_events-0.6.2 app/views/admin/event_notifications/_form.html.haml
effective_events-0.6.1 app/views/admin/event_notifications/_form.html.haml
effective_events-0.6.0 app/views/admin/event_notifications/_form.html.haml
effective_events-0.5.6 app/views/admin/event_notifications/_form.html.haml