tryzealot/zealot

View on GitHub
app/views/releases/sidebar/_debug_file.html.slim

Summary

Maintainability
Test Coverage
- if debug_file.present?
  ruby:
    metadat_size = debug_file.metadata.count
    multi_dsym = debug_file.multi_object?
  .card
    .card-header
      h3.card-title
        i.icon.fas.fa-bug
        = t('releases.show.debug_file', type: debug_file_type(debug_file))
        span.badge.badge-warning.ml-1 beta
      .card-tools
        button.btn.btn-tool data-card-widget="collapse"
          i.fas.fa-minus
    .card-body.p-0
      - debug_file.metadata.each_with_index do |metadata, index|
          - if metadata.type == 'proguard'
            - metadata.data['files'].each_with_index do |file, f_index|
              p.d-flex.flex-column.mb-0.pl-3.pb-2.pt-2 class="#{f_index == metadata.data['files'].size - 1 ? '' : 'border-bottom'}"
                span.font-weight-bold = file["name"]
                span.text-muted = number_to_human_size(file["size"])
          - else
            p.d-flex.flex-column.mb-0.pl-3.pb-2.pt-2 class="#{index == metadat_size - 1 ? '' : 'border-bottom'}"
              span.font-weight-bold
                - if multi_dsym && metadata.data['main_app'] == true
                  i.fa.fa-star.text-warning.pr-1
                = "#{metadata.object} (#{metadata.type})"
              span.text-muted = metadata.uuid
    .card-footer.p-0
      a.btn.btn-icon.btn-block.btn-default.btn-flat.p-2 href="#{debug_file.file_url}" target="_blank" style="border:none"
        i.icon.fas.fa-download
        = t('debug_files.show.download', size: number_to_human_size(debug_file.file.size))