Sha256: b8f90d9a3b5919b2525f8375ae42d824f57bf4945899e250eb255711c0870b38

Contents?: true

Size: 1.98 KB

Versions: 16

Compression:

Stored size: 1.98 KB

Contents

- old_current_form = self.current_form
= form_for file, :url => send(:"lolita_#{resource_class.model_name.singular}_upload_path", "#{resource_class.model_name.singular}_id" => (resource.nil? || resource.new_record?) ? 0 : resource.id, :association => tab.association.name, :id=>file.id), :html => {:method=>:put,:remote=>true,:id=>"edit_#{tab.association.name}_#{file.id}", :class => "edit-file-form"} do |f|
  - self.current_form = f
  .file-editor
    - unless flash[:notice].blank?
      %p.notice= flash[:notice]
    - unless flash[:error].blank?
      %p.error= flash[:error]
    - url = file.send(tab.uploader).normalized.blank? ? file.send(tab.uploader).url : file.send(tab.uploader).normalized.url
    = image_tag url, :class => "editable-image"
    - if file.class.respond_to?(:translations_configuration)
      = render_component :"/lolita/configuration/tab/files", :language_switch, :tab => tab
    .fields 
      - if file.class.respond_to?(:translations_configuration)
        = render_component :"/lolita/configuration/tab/files", :translatable_fields, :tab => tab, :file => file
      - else
        = render_component :"/lolita/configuration/tab/files", :fields, :tab => tab, :file => file
    %br
    .action-links
      .navigation
        = link_to t("lolita.tabs.images.back"), send(:"lolita_#{tab.dbi.klass.model_name.singular}_uploads_path"), :remote => true, :class => "back"
        - #= link_to t("lolita.tabs.images.previous"), "#", :class => "previous" 
        - #= link_to t("lolita.tabs.images.next"), "#", :class => "next" 
      .actions
        = link_to t("lolita.tabs.images.delete"), send(:"lolita_#{tab.dbi.klass.model_name.singular}_upload_path", "#{tab.dbi.klass.model_name.singular}_id" => (resource.nil? || resource.new_record?) ? 0 : resource.id, :association => tab.association.name, :id=>file.id),:method=>:delete,:remote=>true,:confirm=>"Are you sure?", :class => "delete"
        = link_to t("lolita.tabs.images.save"), "#", :class => "save"
- self.current_form = old_current_form

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
lolita-file-upload-1.0.5 app/views/components/lolita/configuration/tab/files/_form.html.haml
lolita-file-upload-1.0.4 app/views/components/lolita/configuration/tab/files/_form.html.haml
lolita-file-upload-1.0.3 app/views/components/lolita/configuration/tab/files/_form.html.haml
lolita-file-upload-1.0.2 app/views/components/lolita/configuration/tab/files/_form.html.haml
lolita-file-upload-1.0.1 app/views/components/lolita/configuration/tab/files/_form.html.haml
lolita-file-upload-1.0.0 app/views/components/lolita/configuration/tab/files/_form.html.haml
lolita-file-upload-0.8.3 app/views/components/lolita/configuration/tab/files/_form.html.haml
lolita-file-upload-0.8.2 app/views/components/lolita/configuration/tab/files/_form.html.haml
lolita-file-upload-0.8.1 app/views/components/lolita/configuration/tab/files/_form.html.haml
lolita-file-upload-0.8.0 app/views/components/lolita/configuration/tab/files/_form.html.haml
lolita-file-upload-0.7.3 app/views/components/lolita/configuration/tab/files/_form.html.haml
lolita-file-upload-0.7.2 app/views/components/lolita/configuration/tab/files/_form.html.haml
lolita-file-upload-0.7.1 app/views/components/lolita/configuration/tab/files/_form.html.haml
lolita-file-upload-0.6.2 app/views/components/lolita/configuration/tab/files/_form.html.haml
lolita-file-upload-0.6.1 app/views/components/lolita/configuration/tab/files/_form.html.haml
lolita-file-upload-0.6.0 app/views/components/lolita/configuration/tab/files/_form.html.haml