Sha256: 9c1561b331c828b9bbe894c4e4403e74335ff8d1e4b6b5b1fca4bc2fb9d535a8

Contents?: true

Size: 1.09 KB

Versions: 20

Compression:

Stored size: 1.09 KB

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= cpd_score(resource.score)

          %td
            #{cpd_credits_label} out of #{cpd_score(resource.target_score)}
            - if resource.target_score_required_to_submit?
              required

        %tr
          %td
            %h4= cpd_score(last_3_scores)

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

    = cpd_cycle.sidebar_content.to_s

  .col-9
    .mb-3= yield

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
effective_cpd-1.7.2 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-1.7.1 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-1.7.0 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-1.6.5 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-1.6.4 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-1.6.3 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-1.6.2 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-1.6.1 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-1.6.0 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-1.5.1 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-1.5.0 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-1.4.8 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-1.4.7 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-1.4.6 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-1.4.5 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-1.4.4 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-1.4.3 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-1.4.2 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-1.4.1 app/views/effective/cpd_statements/_layout.html.haml
effective_cpd-1.4.0 app/views/effective/cpd_statements/_layout.html.haml