Skip to content

Commit fbeb41a

Browse files
committed
Do not show registration status in Single Contest
1 parent f3d1132 commit fbeb41a

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

app/controllers/contests_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def register
162162
respond_to do |format|
163163
begin
164164
entry.save!
165-
format.html { redirect_back fallback_location: root_path, notice: @contest.require_approval? ? 'Registration request sent, approval pending.' : 'Successfully registered.' }
165+
format.html { redirect_back fallback_location: root_path, notice: @contest.require_approval? ? 'Registration request sent. Approval is pending.' : 'Successfully registered.' }
166166
format.json { head :no_content }
167167
rescue ActiveRecord::RecordNotUnique
168168
format.html { redirect_back fallback_location: root_path, alert: 'Registration failed.' }

app/views/contests/show.html.erb

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</h4>
2121

2222
<div class="row">
23-
<div class="col-sm-6 col-lg-3">
23+
<div class="col-sm-6 <% if @layout == :single_contest %>col-lg-4<% else %>col-lg-3<% end %>">
2424
<div class="panel panel-default">
2525
<div class="panel-heading">
2626
<h1 class="panel-title">Start / End</h1>
@@ -46,26 +46,32 @@
4646
</div>
4747
</div>
4848
</div>
49-
<div class="col-sm-6 col-lg-3">
49+
<div class="<% if @layout == :single_contest %>col-sm-12 col-lg-4<% else %>col-sm-6 col-lg-3<% end %>">
5050
<div class="panel panel-default">
5151
<div class="panel-heading">
5252
<h1 class="panel-title">Register Before</h1>
5353
</div>
5454
<div class="panel-body">
5555
<%= @contest.effective_register_before.to_fs(:clean) %>
56+
<% unless @layout == :single_contest %>
57+
<br>
58+
<%= register_mode_desc_map[@contest.register_mode] %>
59+
<% end %>
5660
</div>
5761
</div>
5862
</div>
59-
<div class="col-sm-6 col-lg-2">
60-
<div class="panel panel-default">
61-
<div class="panel-heading">
62-
<h1 class="panel-title">Registration Status</h1>
63-
</div>
64-
<div class="panel-body">
65-
<%= render partial: 'register_status', locals: {status: @register_status, text: true} %>
63+
<% unless @layout == :single_contest %>
64+
<div class="col-sm-6 col-lg-2">
65+
<div class="panel panel-default">
66+
<div class="panel-heading">
67+
<h1 class="panel-title">Registration Status</h1>
68+
</div>
69+
<div class="panel-body">
70+
<%= render partial: 'register_status', locals: {status: @register_status, text: true} %>
71+
</div>
6672
</div>
6773
</div>
68-
</div>
74+
<% end %>
6975
</div>
7076

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

0 commit comments

Comments
 (0)