added logic to hide the show/hide autosaves feature for users without permission to view detailed_statistics

This commit is contained in:
Janis4411
2022-07-20 16:47:37 +02:00
committed by Sebastian Serth
parent 184c9cba6d
commit 66d9a2b22a

View File

@ -38,17 +38,18 @@ h1
option data-submission=submission
=index
- index += 1
.bg-light.w-100.p-2.mb-4.align-items-center.d-flex.justify-content-between
- if @show_autosaves
span.pl-1.pb-1
i.fa.fa-info-circle.align-middle
small.mr-5.ml-1 = t('.toggle_status_on')
= link_to t('.toggle_autosave_off'), statistics_external_user_exercise_path(show_autosaves: false), class: "btn btn-outline-dark float-right btn-sm"
- else
span.pl-1.pb-1
i.fa.fa-info-circle.align-middle
small.mr-5.ml-1 = t('.toggle_status_off')
= link_to t('.toggle_autosave_on'), statistics_external_user_exercise_path(show_autosaves: true), class: "btn btn-outline-dark float-right btn-sm"
- if policy(@exercise).detailed_statistics?
.bg-light.w-100.p-2.mb-4.align-items-center.d-flex.justify-content-between
- if @show_autosaves
span.pl-1.pb-1
i.fa.fa-info-circle.align-middle
small.mr-5.ml-1 = t('.toggle_status_on')
= link_to t('.toggle_autosave_off'), statistics_external_user_exercise_path(show_autosaves: false), class: "btn btn-outline-dark float-right btn-sm"
- else
span.pl-1.pb-1
i.fa.fa-info-circle.align-middle
small.mr-5.ml-1 = t('.toggle_status_off')
= link_to t('.toggle_autosave_on'), statistics_external_user_exercise_path(show_autosaves: true), class: "btn btn-outline-dark float-right btn-sm"
#timeline
.table-responsive
table.table