Sha256: 33e290f95d10737ca26012153427b8110d3cfb165734d771725c406d2a722967

Contents?: true

Size: 1.71 KB

Versions: 42

Compression:

Stored size: 1.71 KB

Contents

- url = @image.new_record? ? admin_images_path : admin_image_path(@image)

.spacer

.row
  .col-md-6.col-md-offset-3
    .panel.panel-default
      .panel-heading
        %h3.panel-title Image
      .panel-body
        = simple_form_for @image, url: url do |f|
          - if @image.image.present?
            .form-group
              %label
                Image preview

              = link_to @image.image.url, class: 'image-preview-wrap' do
                = image_tag @image.image.url, class: 'image-preview'


          = f.input :name, label: 'Image name', hint: "This is the 'short' name that you will use to reference this image in the post editor"

          - unless @image.persisted?
            = f.input :image, label: "Image file"

          = f.input :alt_text
          = f.input :description
          = f.input :credit, label: "Credit (optional, can include HTML)", as: :string

          - if @image.persisted?
            .help-box
              %h3.title Embed this image
              %p.description You can use the following shortcode to embed this image in a post or page:
              %code
                = "[image name=\"#{@image.name}\" caption=\"Your caption text\"]"
              %p.description
                To embed this image without a caption, use the shortcode:
              %code
                = "[image name=\"#{@image.name}\"]"

          - if @image.persisted?
            = link_to admin_image_path(@image), class: 'delete-link pull-left', data: {method: :delete, confirm: "Are you sure you want to delete this image?"} do
              %i.fa.fa-trash-o
              Delete Image

          = f.button :submit, "Save Image", class: 'btn btn-inverse pull-right', data: {disable_with: 'Loading'}

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
virgo-0.3.17 app/views/virgo/admin/images/_form.haml
virgo-0.3.16 app/views/virgo/admin/images/_form.haml
virgo-0.3.15 app/views/virgo/admin/images/_form.haml
virgo-0.3.14 app/views/virgo/admin/images/_form.haml
virgo-0.3.13 app/views/virgo/admin/images/_form.haml
virgo-0.3.12 app/views/virgo/admin/images/_form.haml
virgo-0.3.11 app/views/virgo/admin/images/_form.haml
virgo-0.3.10 app/views/virgo/admin/images/_form.haml
virgo-0.3.9 app/views/virgo/admin/images/_form.haml
virgo-0.3.8 app/views/virgo/admin/images/_form.haml
virgo-0.3.7 app/views/virgo/admin/images/_form.haml
virgo-0.3.6 app/views/virgo/admin/images/_form.haml
virgo-0.3.4 app/views/virgo/admin/images/_form.haml
virgo-0.3.3 app/views/virgo/admin/images/_form.haml
virgo-0.3.2 app/views/virgo/admin/images/_form.haml
virgo-0.3.1 app/views/virgo/admin/images/_form.haml
virgo-0.3 app/views/virgo/admin/images/_form.haml
virgo-0.2.9 app/views/virgo/admin/images/_form.haml
virgo-0.2.8 app/views/virgo/admin/images/_form.haml
virgo-0.2.7 app/views/virgo/admin/images/_form.haml