-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Differentiate between different cases of editor voucher redemption
- Loading branch information
1 parent
2538684
commit 0e728d4
Showing
3 changed files
with
24 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 %> | ||
<%= cancel_voucher_button %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters