Dalphi/dalphi

View on GitHub
app/views/annotation_documents/index.slim

Summary

Maintainability
Test Coverage
.container.annotation-documents
  = render 'shared/project_header',
           project: @project,
           active_label: :annotation_documents

  .row
    .col-xs-12
      - if @annotation_documents.any?
        = render 'shared/annotation_documents',
                 project: @project,
                 annotation_documents: @annotation_documents
      - elsif @project.raw_data.any?
        = render 'shared/blank_slates/annotation_documents',
                 project: @project
      - else
        = render 'shared/blank_slates/raw_data',
                 project: @project
        .row.btn-row
          .col-xs-12
             = render 'shared/button', type: 'back'

  - if @annotation_documents.any?
    .row.btn-row
      .col-xs-12
         = render 'shared/button', type: 'back'
         = render 'shared/button',
                  group: [{ label: t('annotation-documents.delete-all'),
                            href: project_annotation_documents_path(@project),
                            icon: 'trash',
                            type: 'danger',
                            confirm: t('delete-confirm'),
                            method: 'delete' }]
         = render 'shared/button',
                  group: [{ label: t('projects.annotate.title'),
                            tooltip: t('projects.annotate.tooltip'),
                            icon: 'tags',
                            type: 'primary',
                            turbolinks: false,
                            href: project_annotate_path(@project) },
                          { label: t('projects.merge.title'),
                            tooltip: t('projects.merge.tooltip'),
                            icon: 'compress',
                            type: 'submit',
                            href: project_merge_path(@project),
                            method: 'post' },
                          { label: t('annotation-documents.blank-slate.admin.index.button-label'),
                            icon: 'plus',
                            type: 'submit',
                            href: project_iterate_path(@project),
                            method: 'post' }]