Sha256: 00bd02bd3b0d8a95e25dfa959c70d81e7797279f739c312cfc4fe71a68361c3f

Contents?: true

Size: 1014 Bytes

Versions: 17

Compression:

Stored size: 1014 Bytes

Contents

.row
  .col-3
    = render_wizard_sidebar(resource)

    - cpd_cycle = resource.cpd_cycle
    - start_at = cpd_cycle.start_at
    - end_at = cpd_cycle.end_at
    - last_3_cycles = Effective::CpdCycle.sorted.where('start_at <= ?', start_at).last(3)
    - last_3_scores = Effective::CpdStatement.where(cpd_cycle: last_3_cycles, user: resource.user).sum(&:score)

    %table.table.mt-4
      %tbody
        - if end_at.present? && !resource.completed?
          %tr{title: "#{cpd_cycle} is available #{cpd_cycle.available_date}"}
            %td
              %h4= ((end_at - Time.zone.now) / 1.day).to_i

            %td days left to submit

        %tr
          %td
            %h4= resource.score.to_i

          %td
            #{cpd_credits_label} out of #{resource.required_score} required

        %tr
          %td
            %h4= last_3_scores.to_i

          %td #{cpd_credits_label} in last 3 #{cpd_cycles_label} (including this #{cpd_cycle_label})

    = cpd_cycle.sidebar_content

  .col-9
    = yield

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
effective_cpd-0.1.19 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-0.1.18 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-0.1.17 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-0.1.16 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-0.1.15 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-0.1.14 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-0.1.13 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-0.1.12 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-0.1.11 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-0.1.10 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-0.1.9 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-0.1.8 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-0.1.7 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-0.1.6 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-0.1.5 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-0.1.4 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-0.1.3 app/views/effective/cpd_statements/_layout.html.haml