mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-26 04:21:36 +00:00
Improves contests, gather archive and brackets styling
This commit is contained in:
parent
0b145b84d6
commit
0ba4b034d1
10 changed files with 327 additions and 185 deletions
|
@ -188,3 +188,19 @@
|
|||
margin-left: - em(20);
|
||||
width: $max-width + $container-padding*2;
|
||||
}
|
||||
|
||||
/*
|
||||
Gather Archive
|
||||
*/
|
||||
|
||||
table.gathers {
|
||||
|
||||
.date {
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.team1,
|
||||
.team2 {
|
||||
width: 35%;
|
||||
}
|
||||
}
|
|
@ -129,6 +129,10 @@ table.brackets {
|
|||
table {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
> a {
|
||||
padding-left: em(10);
|
||||
}
|
||||
}
|
||||
|
||||
.bracket {
|
||||
|
@ -191,3 +195,141 @@ table.brackets {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Contest Form Page
|
||||
*/
|
||||
|
||||
#contest.contest-manage {
|
||||
|
||||
table.maps {
|
||||
|
||||
.name {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.download {
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.actions {
|
||||
width: 10%;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
table.brackets-list {
|
||||
width: 100%;
|
||||
|
||||
.bracket,
|
||||
.slots {
|
||||
width: 45%;
|
||||
}
|
||||
|
||||
.actions {
|
||||
width: 10%;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
table.weeks {
|
||||
|
||||
.name {
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.date,
|
||||
.map1,
|
||||
.map2 {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.actions {
|
||||
width: 10%;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
#matches {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
table.matches {
|
||||
|
||||
.team {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.date {
|
||||
text-align: left;
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.score {
|
||||
width: 10%;
|
||||
}
|
||||
|
||||
.actions {
|
||||
width: 15%;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Contest List
|
||||
*/
|
||||
|
||||
#contests {
|
||||
@include span-columns(12);
|
||||
|
||||
div.current {
|
||||
@include span-columns(12);
|
||||
margin-bottom: em(20);
|
||||
|
||||
table {
|
||||
|
||||
.name {
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.date {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.status {
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.actions {
|
||||
width: 10%;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
div.previous {
|
||||
@include span-columns(12);
|
||||
margin-bottom: em(20);
|
||||
|
||||
table {
|
||||
|
||||
.name {
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.date {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.winner {
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.actions {
|
||||
width: 10%;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ class BracketsController < ApplicationController
|
|||
|
||||
def edit
|
||||
raise AccessError unless @bracket.can_update? cuser
|
||||
render layout: 'full'
|
||||
end
|
||||
|
||||
def create
|
||||
|
|
|
@ -1,28 +1,18 @@
|
|||
<h1>
|
||||
Editing bracket
|
||||
</h1>
|
||||
<h1 class="title">Editing Bracket</h1>
|
||||
|
||||
<div class="wide box">
|
||||
<%= form_for(@bracket) do |f| %>
|
||||
<div id="error_explanation">
|
||||
<ul>
|
||||
<% @bracket.errors.full_messages.each do |msg| %>
|
||||
<li><%= msg %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<%= render 'shared/errors', messages: @bracket.errors.full_messages %>
|
||||
|
||||
<div class="fields">
|
||||
<%= f.label :slots %>
|
||||
<%= f.text_field :slots %>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<%= f.label :slots %><br />
|
||||
<%= f.text_field :slots %>
|
||||
</p>
|
||||
<%= render partial: "bracket", locals: { bracket: @bracket } %>
|
||||
|
||||
<%= render :partial => "bracket", :locals => {:bracket => @bracket} %>
|
||||
|
||||
<p>
|
||||
<div class="controls">
|
||||
<%= f.submit 'Update' %>
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= link_to 'Back', edit_contest_path(@bracket.contest) %>
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
</table>
|
||||
<% end %>
|
||||
|
||||
<%= render :partial => "brackets/bracket", :collection => contest.brackets %>
|
||||
<%= render partial: "brackets/bracket", collection: contest.brackets %>
|
||||
|
||||
<% if cuser and cuser.admin? and params[:action] != "historical" %>
|
||||
<%= link_to 'Edit', edit_contest_path(contest) %>
|
||||
<%= link_to 'Edit Brackets', edit_contest_path(contest), class: 'button' %>
|
||||
<% end %>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<h1 class="title">Editing Contest</h1>
|
||||
|
||||
<div id="contest" class="tabbed">
|
||||
<div id="contest" class="contest-manage tabbed">
|
||||
<ul id="contest-nav" class="tabs">
|
||||
<li><a href="#general">General</a></li>
|
||||
<% if @contest.contest_type == Contest::TYPE_BRACKET %>
|
||||
|
@ -85,18 +85,18 @@
|
|||
|
||||
<% if @contest.contest_type == Contest::TYPE_BRACKET %>
|
||||
<div class="tab" id="brackets">
|
||||
<table class="striped">
|
||||
<table class="brackets-list striped">
|
||||
<tr>
|
||||
<th>Bracket</th>
|
||||
<th>Slots</th>
|
||||
<th>Options</th>
|
||||
<th class="bracket">Bracket</th>
|
||||
<th class="slots">Slots</th>
|
||||
<th class="actions"></th>
|
||||
</tr>
|
||||
|
||||
<% @contest.brackets.each do |bracket| %>
|
||||
<tr>
|
||||
<td><%= namelink bracket %></td>
|
||||
<td><%= bracket.slots %></td>
|
||||
<td>
|
||||
<td class="actions">
|
||||
<%= link_to icon('pencil'), edit_bracket_path(bracket) %>
|
||||
<%= link_to icon('times'), bracket, confirm: 'Are you sure?', method: :delete %>
|
||||
</td>
|
||||
|
@ -121,18 +121,18 @@
|
|||
<% end %>
|
||||
|
||||
<div class="tab" id="maps">
|
||||
<table class="striped">
|
||||
<table class="maps striped">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Download</th>
|
||||
<th>Options</th>
|
||||
<th class="name">Name</th>
|
||||
<th class="download">Download</th>
|
||||
<th class="actions"></th>
|
||||
</tr>
|
||||
|
||||
<% @contest.maps.basic.each do |map| %>
|
||||
<tr>
|
||||
<td><%= namelink map %></td>
|
||||
<td><%= h map.download %></td>
|
||||
<td>
|
||||
<td class="actions">
|
||||
<%= link_to icon('pencil'), edit_map_path(map) %>
|
||||
<%= link_to icon('times'), action: "del_map", id: @contest.id, id2: map.id %>
|
||||
</td>
|
||||
|
@ -153,12 +153,12 @@
|
|||
</div>
|
||||
|
||||
<div class="tab" id="teams">
|
||||
<table class="striped">
|
||||
<table class="teams striped">
|
||||
<tr>
|
||||
<th>Team</th>
|
||||
<th>Score</th>
|
||||
<th>Status</th>
|
||||
<th>Actions</th>
|
||||
<th class="team">Team</th>
|
||||
<th class="score">Score</th>
|
||||
<th class="status">Status</th>
|
||||
<th class="actions"></th>
|
||||
</tr>
|
||||
|
||||
<% @contest.contesters.each do |contester| %>
|
||||
|
@ -166,7 +166,7 @@
|
|||
<td><%= link_to (h contester.team), contester %></td>
|
||||
<td><%= h contester.score %></td>
|
||||
<td><%= contester.statuses[contester.active] %></td>
|
||||
<td>
|
||||
<td class="actions">
|
||||
<% if contester.active %>
|
||||
<%= link_to icon('pencil'), edit_contester_path(contester) %>
|
||||
<%= link_to icon('times'), contester, confirm: 'Are you sure?', method: :delete %>
|
||||
|
@ -197,13 +197,13 @@
|
|||
</div>
|
||||
|
||||
<div class="tab" id="weeks">
|
||||
<table class="striped">
|
||||
<table class="weeks striped">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Start date</th>
|
||||
<th>Map1</th>
|
||||
<th>Map2</th>
|
||||
<th>Options</th>
|
||||
<th class="name">Name</th>
|
||||
<th class="date">Start date</th>
|
||||
<th class="map1">Map1</th>
|
||||
<th class="map2">Map2</th>
|
||||
<th class="actions"></th>
|
||||
</tr>
|
||||
|
||||
<% @contest.weeks.each do |week| %>
|
||||
|
@ -212,7 +212,7 @@
|
|||
<td><%= week.start_date.strftime("%d %B %y") %></td>
|
||||
<td><%= h week.map1 %></td>
|
||||
<td><%= h week.map2 %></td>
|
||||
<td>
|
||||
<td class="actions">
|
||||
<%= link_to icon('pencil'), edit_week_path(week) %>
|
||||
<%= link_to icon('times'), week, confirm: 'Are you sure?', method: :delete %>
|
||||
</td>
|
||||
|
@ -224,12 +224,12 @@
|
|||
</div>
|
||||
|
||||
<div class="tab" id="matches">
|
||||
<table class="striped">
|
||||
<table class="matches striped">
|
||||
<tr>
|
||||
<th>Teams</th>
|
||||
<th>Date</th>
|
||||
<th>Score</th>
|
||||
<th>Options</th>
|
||||
<th class="team">Teams</th>
|
||||
<th class="date">Date</th>
|
||||
<th class="score">Score</th>
|
||||
<th class="actions"></th>
|
||||
</tr>
|
||||
|
||||
<% @contest.matches.each do |match| %>
|
||||
|
@ -247,7 +247,7 @@
|
|||
<b><%= h match.score1 %> - <%= h match.score2 %></b>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<td class="actions">
|
||||
<%= link_to icon('flag-checkered'), controller: :matches, action: :ref, id: match %>
|
||||
<%= link_to icon('pencil'), edit_match_path(match) %>
|
||||
<%= link_to icon('times'), match, confirm: 'Are you sure?', method: :delete %>
|
||||
|
|
|
@ -1,82 +1,73 @@
|
|||
<h1>Listing Contests</h1>
|
||||
<h1 class="title">Listing Contests</h1>
|
||||
|
||||
<% if cuser and cuser.admin? %>
|
||||
<%= link_to 'New Contest', new_contest_path %>
|
||||
<%= link_to 'New Contest', new_contest_path, class: 'button' %>
|
||||
<% end %>
|
||||
|
||||
<h2>Current Contests</h2>
|
||||
<table class="data">
|
||||
<div id="contests">
|
||||
<div class="current">
|
||||
<h3 class="title">Current Contests</h3>
|
||||
|
||||
<table class="current striped">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Start</th>
|
||||
<th>End</th>
|
||||
<th>Rules</th>
|
||||
<th>Status</th>
|
||||
<th class="name">Name</th>
|
||||
<th class="date">Start</th>
|
||||
<th class="status">Status</th>
|
||||
<% if cuser and cuser.admin? %>
|
||||
<th>Options</th>
|
||||
<th class="actions"></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
|
||||
<% @contests_active.each do |contest| %>
|
||||
<tr class="<%= cycle('even', 'odd') %>">
|
||||
<tr>
|
||||
<td><%= link_to (h contest.name), contest %></td>
|
||||
<td><%= longtime contest.start %></td>
|
||||
<td><%= longtime contest.end %></td>
|
||||
<% if contest.rules and contest.rules.title then %>
|
||||
<td><%= link_to (h contest.rules.title), contest.rules %></td>
|
||||
<% else %>
|
||||
<td><%= "No ruleset specified" %></td>
|
||||
<% end %>
|
||||
<td><%= longdate contest.start %></td>
|
||||
<td><%= contest.statuses[contest.status] %></td>
|
||||
<% if cuser and cuser.admin? %>
|
||||
<td>
|
||||
<%= link_to 'Edit', edit_contest_path(contest) %>
|
||||
<%= link_to 'Destroy', contest, :confirm => 'Are you sure?', :method => :delete %>
|
||||
<td class="actions">
|
||||
<%= link_to icon('pencil'), edit_contest_path(contest) %>
|
||||
<%= link_to icon('times'), contest, confirm: 'Are you sure?', method: :delete %>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<h2>Previous Contests</h2>
|
||||
<table class="data">
|
||||
<div class="previous">
|
||||
<h3 class="title">Previous Contests</h3>
|
||||
|
||||
<table class="previous striped">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Start</th>
|
||||
<th>End</th>
|
||||
<th width="1%">Winner</th>
|
||||
<th></th>
|
||||
<th>Status</th>
|
||||
<th class="name">Name</th>
|
||||
<th class="date">Date</th>
|
||||
<th class="winner">Winner</th>
|
||||
<% if cuser and cuser.admin? %>
|
||||
<th>Options</th>
|
||||
<th class="actions"></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
|
||||
<% @contests_inactive.reverse_each do |contest| %>
|
||||
<tr class="<%= cycle('even', 'odd') %>" height="18">
|
||||
<tr>
|
||||
<td><%= link_to (h contest.name), contest %></td>
|
||||
<td><%= longtime contest.start %></td>
|
||||
<td><%= longtime contest.end %></td>
|
||||
<td><%= longdate contest.start %></td>
|
||||
<% if contest.winner then %>
|
||||
<td><%= flag contest.winner.team.country %></td>
|
||||
<td><%= link_to (h contest.winner.team.name), contest.winner %></td>
|
||||
<td><%= flag contest.winner.team.country %> <%= link_to (h contest.winner.team.name), contest.winner %></td>
|
||||
<% else %>
|
||||
<td><%= %></td>
|
||||
<td><%= %></td>
|
||||
<td></td>
|
||||
<% end %>
|
||||
<td><%= contest.statuses[contest.status] %></td>
|
||||
<% if cuser and cuser.admin? %>
|
||||
<td>
|
||||
<%= link_to 'Edit', edit_contest_path(contest) %>
|
||||
<%= link_to 'Destroy', contest, :confirm => 'Are you sure?', :method => :delete %>
|
||||
<td class="actions">
|
||||
<%= link_to icon('pencil'), edit_contest_path(contest) %>
|
||||
<%= link_to icon('times'), contest, confirm: 'Are you sure?', method: :delete %>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<% if cuser and cuser.admin? %>
|
||||
<%= link_to 'New Contest', new_contest_path %>
|
||||
<% end %>
|
||||
<% if cuser and cuser.admin? %>
|
||||
<%= link_to 'New Contest', new_contest_path, class: 'button' %>
|
||||
<% end %>
|
||||
</div>
|
|
@ -1,36 +1,33 @@
|
|||
<h1>New Contest</h1>
|
||||
|
||||
<div class="box wide">
|
||||
<%= form_for @contest do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<p>
|
||||
<%= f.label :name %><br />
|
||||
<%= f.text_field :name %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :contest_type %><br />
|
||||
<%= f.select :contest_type, @contest.types.invert %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :start %><br />
|
||||
<%= f.datetime_select :start %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :end %><br />
|
||||
<%= f.datetime_select :end %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :status %><br />
|
||||
<%= f.select :status, @contest.statuses.invert %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :default_time %><br />
|
||||
<%= f.time_select :default_time %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.submit 'Save' %>
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= form_for @contest, html: { class: 'square' } do |f| %>
|
||||
<%= render 'shared/errors', messages: @contest.errors.full_messages %>
|
||||
|
||||
<%= link_to 'Back', contests_path %>
|
||||
<div class="fields horizontal">
|
||||
<%= f.label :name %>
|
||||
<%= f.text_field :name %>
|
||||
</div>
|
||||
<div class="fields horizontal">
|
||||
<%= f.label :contest_type %>
|
||||
<%= f.select :contest_type, @contest.types.invert %>
|
||||
</div>
|
||||
<div class="fields horizontal">
|
||||
<%= f.label :start %>
|
||||
<%= f.datetime_select :start, datetime_separator: '', time_separator: '' %>
|
||||
</div>
|
||||
<div class="fields horizontal">
|
||||
<%= f.label :end %>
|
||||
<%= f.datetime_select :end, datetime_separator: '', time_separator: '' %>
|
||||
</div>
|
||||
<div class="fields horizontal">
|
||||
<%= f.label :status %>
|
||||
<%= f.select :status, @contest.statuses.invert %>
|
||||
</div>
|
||||
<div class="fields horizontal">
|
||||
<%= f.label :default_time %>
|
||||
<%= f.time_select :default_time, time_separator: '' %>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<%= f.submit 'Save' %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
@ -1,46 +1,50 @@
|
|||
<h1>Gather Archive</h1>
|
||||
<h3>Players in bold were captains for their respective teams.</h3>
|
||||
<h5 class="title">Players in bold were captains for their respective teams.</h5>
|
||||
|
||||
<table class="data">
|
||||
<table class="gathers striped">
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Team1</th>
|
||||
<th>Team2</th>
|
||||
<th>Map</th>
|
||||
<th>Server</th>
|
||||
<th class="date">Date</th>
|
||||
<th class="team1">Team 1</th>
|
||||
<th class="team2">Team 2</th>
|
||||
</tr>
|
||||
|
||||
<% @gathers.each do |gather| %>
|
||||
<tr class="<%= cycle('even', 'odd') %>">
|
||||
<td><%= link_to gather.updated_at.strftime("%Y/%m/%d %H:%M:%S"), gather %></td>
|
||||
<td>
|
||||
<ul>
|
||||
<% gather.gatherers.each do |gatherer| %>
|
||||
<li>
|
||||
<% if gatherer.team == 1 %>
|
||||
<% if gather.captain1 == gatherer %>
|
||||
<b>
|
||||
<strong>
|
||||
<% end %>
|
||||
<%= link_to gatherer.user.to_s, User.find_by_username(gatherer.user.to_s) %>
|
||||
<% if gather.captain1 == gatherer %>
|
||||
</b>
|
||||
</strong>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<% gather.gatherers.each do |gatherer| %>
|
||||
<li>
|
||||
<% if gatherer.team == 2 %>
|
||||
<% if gather.captain2 == gatherer %>
|
||||
<b>
|
||||
<strong>
|
||||
<% end %>
|
||||
<%= link_to gatherer.user.to_s, User.find_by_username(gatherer.user.to_s) %>
|
||||
<% if gather.captain2 == gatherer %>
|
||||
</b>
|
||||
</strong>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</td>
|
||||
<td><%= gather.map1 %></td>
|
||||
<td><%= gather.server %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
|
|
@ -3,6 +3,7 @@ en:
|
|||
articles_article_views: "Views"
|
||||
bans_create: "Ban was successfully created."
|
||||
bans_update: "Ban was successfully updated."
|
||||
brackets_update: "Bracket was successfully updated."
|
||||
articles_create: "Article was successfully created."
|
||||
articles_update: "Article was successfully updated."
|
||||
articles_revert: "Article reverted to version: {{version}}"
|
||||
|
|
Loading…
Reference in a new issue