Skip to content

Commit

Permalink
Do not show registration status in Single Contest
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien1018 committed Sep 14, 2023
1 parent f3d1132 commit fbeb41a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/controllers/contests_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def register
respond_to do |format|
begin
entry.save!
format.html { redirect_back fallback_location: root_path, notice: @contest.require_approval? ? 'Registration request sent, approval pending.' : 'Successfully registered.' }
format.html { redirect_back fallback_location: root_path, notice: @contest.require_approval? ? 'Registration request sent. Approval is pending.' : 'Successfully registered.' }
format.json { head :no_content }
rescue ActiveRecord::RecordNotUnique
format.html { redirect_back fallback_location: root_path, alert: 'Registration failed.' }
Expand Down
26 changes: 16 additions & 10 deletions app/views/contests/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</h4>

<div class="row">
<div class="col-sm-6 col-lg-3">
<div class="col-sm-6 <% if @layout == :single_contest %>col-lg-4<% else %>col-lg-3<% end %>">
<div class="panel panel-default">
<div class="panel-heading">
<h1 class="panel-title">Start / End</h1>
Expand All @@ -46,26 +46,32 @@
</div>
</div>
</div>
<div class="col-sm-6 col-lg-3">
<div class="<% if @layout == :single_contest %>col-sm-12 col-lg-4<% else %>col-sm-6 col-lg-3<% end %>">
<div class="panel panel-default">
<div class="panel-heading">
<h1 class="panel-title">Register Before</h1>
</div>
<div class="panel-body">
<%= @contest.effective_register_before.to_fs(:clean) %>
<% unless @layout == :single_contest %>
<br>
<%= register_mode_desc_map[@contest.register_mode] %>
<% end %>
</div>
</div>
</div>
<div class="col-sm-6 col-lg-2">
<div class="panel panel-default">
<div class="panel-heading">
<h1 class="panel-title">Registration Status</h1>
</div>
<div class="panel-body">
<%= render partial: 'register_status', locals: {status: @register_status, text: true} %>
<% unless @layout == :single_contest %>
<div class="col-sm-6 col-lg-2">
<div class="panel panel-default">
<div class="panel-heading">
<h1 class="panel-title">Registration Status</h1>
</div>
<div class="panel-body">
<%= render partial: 'register_status', locals: {status: @register_status, text: true} %>
</div>
</div>
</div>
</div>
<% end %>
</div>

<% if effective_admin? || !(@contest.is_started? && @contest.user_can_submit?(current_user)) %>
Expand Down

0 comments on commit fbeb41a

Please sign in to comment.