diff --git a/app/views/vouchers/_redeem_editor_voucher.html.erb b/app/views/vouchers/_redeem_editor_voucher.html.erb index 7e830b500..3df3bb9ad 100644 --- a/app/views/vouchers/_redeem_editor_voucher.html.erb +++ b/app/views/vouchers/_redeem_editor_voucher.html.erb @@ -1,9 +1,11 @@ <%= t('profile.become_editor', lecture: voucher.lecture.title) %> -<%= link_to redeem_voucher_path(params: { secure_hash: voucher.secure_hash }), - class: 'btn btn-primary', - method: :post, - remote: true do %> - <%= t('profile.redeem_voucher') %> + +<% if current_user == voucher.lecture.teacher %> + <%= t('profile.teacher_cant_become_editor') %> +<% elsif current_user.in?(voucher.lecture.editors_by_redemption) %> + <%= t('profile.already_editor_by_redemption') %> +<% else %> + <%= redeem_voucher_button(voucher) %> <% end %> -<%= link_to t('buttons.cancel'), cancel_voucher_path, - class: "btn btn-secondary ms-2", remote: true %> \ No newline at end of file + +<%= cancel_voucher_button %> \ No newline at end of file diff --git a/config/locales/de.yml b/config/locales/de.yml index 4a06fe5ff..50f2982b5 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -2213,8 +2213,14 @@ de: already_tutor_by_redemption: > Du hast bereits einen Gutschein eingelöst, um TutorInnenstatus zu erhalten. become_editor: > - Mit diesem Gutschein kannst Du EditorInnenrechte für die Veranstaltung - %{lecture} übernehmen. + Mit diesem Gutschein erhältst Du EditorInnenstatus für die Veranstaltung + %{lecture}. + already_editor_by_redemption: > + Du hast bereits einen Gutschein eingelöst, um EditorInnenstatus zu + erhalten. + teacher_cant_become_editor: > + Du kannst nicht zusätzlich EditorInnenstatus in einer Veranstaltung + erhalten, in der Du bereits DozentIn bist. mampf_news: title: 'MaMpf-News' check_notifications: 'Alle erledigen' diff --git a/config/locales/en.yml b/config/locales/en.yml index f4f392f4d..6423dfe1f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2064,7 +2064,7 @@ en: We have received your request and will send you your data as soon as possible. redeem_voucher: Redeeem Voucher become_tutor: > - With this voucher, you can obatin tutor status for the %{lecture}. + With this voucher, you can obtain tutor status for %{lecture}. With that, editors for the event series can assign you tutorials. If applicable, you can select the tutorials you will be responsible for right here. @@ -2085,7 +2085,12 @@ en: already_tutor_by_redemption: > You have already redeemed a tutor voucher for this event series. become_editor: > - With this voucher, you can become an editor in the event series %{lecture}. + With this voucher, you can obtain editor status for %{lecture}. + already_editor_by_redemption: > + You have already redeemed an editor voucher for this event series. + teacher_cant_become_editor: > + You are already a teacher for this event series. Therefore, you cannot + redeem an editor voucher. mampf_news: title: 'MaMpf News' check_notifications: 'Clear all'