Sha256: 854dd954e3bb080ba63e9b17737f6ef9a98dde71f9e4a9749262bba53387ad9b

Contents?: true

Size: 1.92 KB

Versions: 23

Compression:

Stored size: 1.92 KB

Contents

.card-panel
  = simple_form_for(:printer) do |f|
    = f.error_notification

    .form-inputs
      -# - if current_user.admin? and params[:controller] =~ /service/
      -#   / %input{ name: 'parent_id', collection: policy_scope(Account), class: :validate}
      -# - else
      %input{ type: :hidden, name: 'parent', value: 'Account' }
      %input{ type: :hidden, name: 'parent_id', value: resource.id }

      .row
        = f.input :name

      .row
        = f.input :cups_printer, placeholder: t('.cups_printer'), required: true, disabled: @disabled

      .row
        = f.input :command, placeholder: t('.cups_cmd'), required: true, disabled: @disabled

      .row
        = f.input :paper, placeholder: t('.paper'), required: true, disabled: @disabled

      .row
        .input-field.col.s4
          %label{ style: "margin-top: -20px"}= t('.service_active')
          .switch
            %label
              = t(:passive)
              =f.check_box :active, disabled: @disabled
              %span.lever
              = t(:active)


      %br
      %br
      .row
        / = f.input :last_monitored_at, disabled: true


      %ul
        %li tidsstyring
        %li

    - unless @disabled
      .row
        .form-actions.right-align
          = f.button :submit, t('.account_printer_submit'), class: "printer_commit"

  :coffeescript

    $ ->
      $(document.body).on 'click', 'input.printer_commit', (e) ->
        e.preventDefault()
        e.stopPropagation()
        $form = $(e.target).closest('form')
        data = $form.serialize()
        jqxhr = $.ajax
          url: '/admin/printers.js',
          type: 'post',
          data: data,
          dataType: 'html'
        jqxhr.done (response) ->
          $('#account_printers').prepend(response)
          fadeItOut $('.message_container .alert-success')
        jqxhr.fail (response) ->
          $('body').append(response)
          fadeItOut $('.message_container .alert-danger'), 5000

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
oxen_printer-0.4.15 app/views/oxen/printers/_new.html.haml
oxen_printer-0.4.14 app/views/oxen/printers/_new.html.haml
oxen_printer-0.4.13 app/views/oxen/printers/_new.html.haml
oxen_printer-0.4.12 app/views/oxen/printers/_new.html.haml
oxen_printer-0.4.11 app/views/oxen/printers/_new.html.haml
oxen_printer-0.4.9 app/views/oxen/printers/_new.html.haml
oxen_printer-0.4.8 app/views/oxen/printers/_new.html.haml
oxen_printer-0.4.7 app/views/oxen/printers/_new.html.haml
oxen_printer-0.4.5 app/views/oxen/printers/_new.html.haml
oxen_printer-0.4.4 app/views/oxen/printers/_new.html.haml
oxen_printer-0.4.3 app/views/oxen/printers/_new.html.haml
oxen_printer-0.4.2 app/views/oxen/printers/_new.html.haml
oxen_printer-0.4.1 app/views/oxen/printers/_new.html.haml
oxen_printer-0.3.4 app/views/oxen/printers/_new.html.haml
oxen_printer-0.3.3 app/views/oxen/printers/_new.html.haml
oxen_printer-0.3.2 app/views/oxen/printers/_new.html.haml
oxen_printer-0.3.1 app/views/oxen/printers/_new.html.haml
oxen_printer-0.3.0 app/views/oxen/printers/_new.html.haml
oxen_printer-0.2.9 app/views/oxen/printers/_new.html.haml
oxen_printer-0.2.8 app/views/oxen/printers/_new.html.haml