pushtype/push_type

View on GitHub
admin/app/views/push_type/admin/assets/index.html.haml

Summary

Maintainability
Test Coverage
- title 'Media'

%asset-index{ assets: assets_array(@assets).to_json, :'inline-template' => true }
  %div
    .large-8.columns
      - if @assets.empty?
        .empty-default{ :'v-show' => 'assets.length == 0' }
          %h2 No uploads
          %p Upload images, documents, videos. Get started by uploading your first file.

      %section
        %ul.asset-list.small-block-grid-2.medium-block-grid-4
          %li{ :'v-for' => 'asset in assets' }
            %article.asset-list-item
              %a{ :'v-bind:href' => 'editUrl(asset)' }
                .preview
                  %img{ alt: '{{ asset.file_name }}', :'v-bind:src' => 'asset.preview_thumb_url' }
                .title {{ asset.description_or_file_name }}

    .large-4.columns
      .side-panel{ :'side-panel' => true }
        .padded
          .pagination-centered
            .pagination-stats {{ assets.length }} items - Page #{ @assets.current_page } of #{ [@assets.total_pages, 1].max }
            = paginate @assets
        .cta.text-center
          = link_to ficon(:plus, 'New upload'), push_type_admin.new_asset_path, class: 'button radius success'
          - if @assets.current_page == 1
            .asset-upload
              .dropzone{ :'v-asset-upload' => true, :maxfiles => 10 }
                .prompt Drag files to quickly upload them…
                .icon= ficon(:upload_cloud)
            .text-button
              = link_to ficon(:trash, 'Trash bin'), push_type_admin.trash_assets_path