Sha256: 66214ea68e36194b57c7d1c70eab4f9c29d369e3a9a27cea9f0c45b1fc0f739c

Contents?: true

Size: 1.94 KB

Versions: 1

Compression:

Stored size: 1.94 KB

Contents

.helena-admin
  - if @sessions.empty?
    .alert.alert-warning
      = t '.empty'
  - else
    .actions
      = link_to admin_survey_sessions_path(@survey, format: :csv) do
        = image_tag('helena/icons/export.svg', class: :icon)
        = t('.export_sessions_csv')
      = link_to admin_survey_sessions_path(@survey, format: :json) do
        = t('.export_sessions_json')
    %h2
      = Helena::Session.model_name.human(count: 2)
      = "(#{@sessions.count})"
    .table-responsive
      %table.table.sessions
        %thead
          %tr
            %th.updated_at= Helena::Session.human_attribute_name(:updated_at)
            %th.token= Helena::Session.human_attribute_name(:token)
            %th.completed= Helena::Session.human_attribute_name(:completed)
            %th.version= Helena::Session.human_attribute_name(:version)
            %th.answers= Helena::Session.human_attribute_name(:answers)
            %th
        %tbody
          - @sessions.each do |session|
            %tr[session]
              %td.updated_at
                = time_ago_in_words(session.updated_at)
              %td.token
                = session.token
              %td.completed
                .label{class: "label-#{session.completed? ? 'success' : 'danger'}"}
                  = t ".#{session.completed}"
              %td.version
                = @survey.versions.find(session.version_id).version if session.version_id
              %td.answers
                = session.answers.count

              %td
                .btn-group
                  - if session.completed?
                    = link_to t('shared.show'), session_path(session.view_token), class: 'btn btn-primary'
                  = link_to t('shared.edit'), edit_session_path(session.token), class: 'btn btn-success'
                  = link_to t('shared.delete'), admin_survey_session_path(@survey, session),
                    method: :delete, class: 'btn btn-danger', data: { confirm: t('shared.delete_question') }

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
helena-0.3.3 app/views/helena/admin/sessions/index.html.haml