Skip to content

Commit

Permalink
Make register less prominent
Browse files Browse the repository at this point in the history
  • Loading branch information
jorg-vr committed Feb 12, 2024
1 parent 81d5ac2 commit b4e5e69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/helpers/courses_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ def registration_action_for(**args)

secret = args[:secret]
membership = args[:membership]
css_class = args[:class] || 'btn btn-filled'

if membership.nil? || membership.unsubscribed?
if course.open_for_user?(current_user) || current_user.nil?
Expand All @@ -13,13 +14,13 @@ def registration_action_for(**args)
subscribe_course_path(@course, secret: secret),
title: t('courses.registration.registration-tooltip'),
method: :post,
class: 'btn btn-filled'
class: css_class
else
link_to t('courses.show.subscribe'),
subscribe_course_path(@course, secret: secret),
title: t('courses.registration.registration-tooltip'),
method: :post,
class: 'btn btn-filled'
class: css_class
end
else
tag.p t("courses.show.registration-#{@course.registration}-info", institution: @course.institution&.name)
Expand Down
2 changes: 1 addition & 1 deletion app/views/courses/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<% if current_user&.member_of? @course %>
<%= button_to t('.unsubscribe'), unsubscribe_course_path(@course), class: 'btn btn-text', data: {confirm: t('general.are_you_sure')} %>
<% elsif @course.featured? and policy(@course).copy?%>
<%= registration_action_for course: @course, membership: @current_membership, secret: (@course.secret if @course.secret_required?(current_user)) %>
<%= registration_action_for course: @course, membership: @current_membership, secret: (@course.secret if @course.secret_required?(current_user)), class: 'btn btn-text' %>
<% end %>
<% if policy(@course).copy? or policy(@course).scoresheet? or policy(@course).download_submissions? %>
<a class="btn btn-icon dropdown-toggle hidden-print" data-bs-toggle="dropdown">
Expand Down

0 comments on commit b4e5e69

Please sign in to comment.