Sha256: d9cb80c88b46f550728626372e493814e69eb73697502cb689443e50e9a75a76

Contents?: true

Size: 1.92 KB

Versions: 2

Compression:

Stored size: 1.92 KB

Contents

- # Split message "Download Type|Row Count|Button Label"
- message = notification&.to_notification&.params[:message]&.split("|")

- if message
  %tr
    %td
      = check_box_tag 'read', notification.read?, notification.read?,
    onchange: "this.setAttribute('data-params', this.name + '=' + this.checked*this.checked)",
    data: { remote: true, url: admin_notification_path(notification), method: :patch }
    %td
      %strong
        = message.length > 1 ? message[0] : "CSV"
        = t('dictionary.download')
    %td
      = message.length > 1 ? message[1] : message[0]
    %td
      - if notification.file.attached?
        = link_to rails_blob_path(notification.file.blob, disposition: "attachment"), { class: 'btn btn-primary btn-block' } do
          :plain
            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-cloud-download" viewBox="0 0 16 16">
              <path d="M4.406 1.342A5.53 5.53 0 0 1 8 0c2.69 0 4.923 2 5.166 4.579C14.758 4.804 16 6.137 16 7.773 16 9.569 14.502 11 12.687 11H10a.5.5 0 0 1 0-1h2.688C13.979 10 15 8.988 15 7.773c0-1.216-1.02-2.228-2.313-2.228h-.5v-.5C12.188 2.825 10.328 1 8 1a4.53 4.53 0 0 0-2.941 1.1c-.757.652-1.153 1.438-1.153 2.055v.448l-.445.049C2.064 4.805 1 5.952 1 7.318 1 8.785 2.23 10 3.781 10H6a.5.5 0 0 1 0 1H3.781C1.708 11 0 9.366 0 7.318c0-1.763 1.266-3.223 2.942-3.593.143-.863.698-1.723 1.464-2.383z"/>
              <path d="M7.646 15.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 14.293V5.5a.5.5 0 0 0-1 0v8.793l-2.146-2.147a.5.5 0 0 0-.708.708l3 3z"/>
            </svg>
          = message.length > 1 ? message[2] : "CSV"
          = "(#{number_to_human_size(notification.file.blob.byte_size)})"
      - else
        = 'N/A'
    %td
      %span.reldate{:data => {:asked_at => notification.created_at.to_json.gsub('"', '')}}
        = notification.created_at

    %td= link_to 'Destroy', admin_notification_path(notification), method: :delete

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
geoblacklight_admin-0.6.0 app/views/admin/notifications/_notification.html.haml
geoblacklight_admin-0.5.1 app/views/admin/notifications/_notification.html.haml