summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/stylesheets/custom.css.scss15
-rw-r--r--app/assets/stylesheets/scaffolds.css.scss4
-rw-r--r--app/assets/stylesheets/tournaments.css.scss1
-rw-r--r--app/views/layouts/application.html.erb7
-rw-r--r--app/views/servers/_form.html.erb17
-rw-r--r--app/views/tournaments/_form.html.erb64
-rw-r--r--app/views/tournaments/standings.html.erb20
7 files changed, 87 insertions, 41 deletions
diff --git a/app/assets/stylesheets/custom.css.scss b/app/assets/stylesheets/custom.css.scss
index 6e54043..9e9e63a 100644
--- a/app/assets/stylesheets/custom.css.scss
+++ b/app/assets/stylesheets/custom.css.scss
@@ -24,6 +24,17 @@ header > nav {
}
}
+.btn-custom-orange {
+ color: white;
+ background-color: rgb(255, 69, 0);
+ border-color: rgb(255, 69, 0);
+}
+.btn-custom-foxtrot {
+ color: white;
+ background-color: hsl(0, 69%, 22%) !important;
+}
+
+
a, input[type="submit"] {
@extend .btn;
@@ -31,7 +42,9 @@ a, input[type="submit"] {
&.signup { @extend .btn-success; }
&.signin { @extend .btn-warning; }
&.signout { @extend .btn-danger; }
- &.server { @extend .btn-danger; }
+ &.server { @extend .btn-warning; }
+ &.create-alert {@extend .btn-custom-orange;}
+ &.alerts { @extend .navbar-right; @extend .glyphicon; @extend .glyphicon-exclamation-sign; @extend .btn-custom-foxtrot;}
font-weight: bold !important;
}
diff --git a/app/assets/stylesheets/scaffolds.css.scss b/app/assets/stylesheets/scaffolds.css.scss
index eb1f751..3c485b5 100644
--- a/app/assets/stylesheets/scaffolds.css.scss
+++ b/app/assets/stylesheets/scaffolds.css.scss
@@ -62,8 +62,8 @@ pre {
a {
color: $link-yellow;
&:hover {
- color: #FFEF00;
- text-decoration: none;
+ color: white;
+
}
}
diff --git a/app/assets/stylesheets/tournaments.css.scss b/app/assets/stylesheets/tournaments.css.scss
index cc55253..42afd38 100644
--- a/app/assets/stylesheets/tournaments.css.scss
+++ b/app/assets/stylesheets/tournaments.css.scss
@@ -30,6 +30,7 @@ span.default-explanation {
}
+
#tournament-users{
li {
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index cf55c18..9eea734 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -28,13 +28,16 @@
<% if signed_in? %>
<%= link_to current_user.user_name, current_user, :class => "user" %>
<%= link_to "Messages", pms_path, :class => "signup" %>
- <%= link_to "Sign out", session_path("current"), method: "delete", :class => "signout" %>
<% if current_user.can? :edit_server %>
<%= link_to "Server settings", edit_server_path, :class => "server" %>
<% end %>
<% if current_user.can? :create_alert %>
- <%= link_to "Create Alert", new_alert_path, :class => "signin" %>
+ <%= link_to "Create Alert", new_alert_path, :class => "create-alert" %>
<% end %>
+ <%= link_to "Sign out", session_path("current"), method: "delete", :class => "signout" %>
+ <%= link_to "", alerts_path, :class => "alerts"%>
+
+
<% else %>
<%= link_to "Log in", new_session_path, :class => "signin" %>
<%= link_to "Sign up", new_user_path, :class => "signup" %>
diff --git a/app/views/servers/_form.html.erb b/app/views/servers/_form.html.erb
index 1afde11..8853a80 100644
--- a/app/views/servers/_form.html.erb
+++ b/app/views/servers/_form.html.erb
@@ -1,18 +1,19 @@
<%= form_for(@server) do |f| %>
<%= render "common/error_messages", :target => @server %>
- <fieldset>
- <legend>Default permissions for new users</legend>
- <ul>
+ <fieldset style="color: rgb(221, 145, 37)">
+ <legend style="color: rgb(221, 145, 37); border-color: rgb(221, 145, 37)">Default permissions for new users</legend>
+ <ul >
<%= fields_for "server[default_user_abilities]", @server.default_user_abilities do |a| %>
<% @server.default_user_abilities.keys.each do |ability| %>
- <li><label><%= a.check_box(ability) %> <%= ability.to_s.humanize %></label></li>
+ <li ><label><%= a.check_box(ability) %> <%= ability.to_s.humanize %></label></li>
<% end %>
<% end %>
</ul>
</fieldset>
-
- <div class="actions">
- <%= f.submit %>
- </div>
+ <p>
+ <div class="actions">
+ <%= f.submit %>
+ </div>
+ </p>
<% end %>
diff --git a/app/views/tournaments/_form.html.erb b/app/views/tournaments/_form.html.erb
index cb4c175..2212515 100644
--- a/app/views/tournaments/_form.html.erb
+++ b/app/views/tournaments/_form.html.erb
@@ -3,7 +3,7 @@
method: (@tournament.game.nil? ? "get" : "post")) do |f| %>
<%= render "common/error_messages", :target => @tournament %>
- <fieldset><legend>Attributes</legend>
+ <fieldset><legend style="color:rgb(221, 145, 37)">Attributes</legend>
<p>
<%= f.label :game_id, "Select a game type" %>
<%= f.select(:game_id, Game.all.map{|game| [game.name, game.id]}) %>
@@ -18,23 +18,33 @@
<%= f.label :name %>
<%= f.text_field :name %>
</p>
-
- <table><tbody>
- <tr>
- <td></td>
- <th>Minimum</th>
- <th>Maximum</th></tr>
- <tr>
- <th>Players per team</th>
- <td><%= f.text_field(:min_players_per_team, type: :number, min: 1) %></td>
- <td><%= f.text_field(:max_players_per_team, type: :number, min: 1) %></td>
- </tr>
- <tr>
- <th>Teams per match</th>
- <td><%= f.text_field(:min_teams_per_match, type: :number, min: 1) %></td>
- <td><%= f.text_field(:max_teams_per_match, type: :number, min: 1) %></td>
- </tr>
- </tbody></table>
+ <div>
+ <p>
+ <table><tbody>
+ <tr>
+ <td></td>
+ <th style="padding:5px">Minimum</th>
+ <th style="padding:5px">Maximum</th></tr>
+ <tr>
+ <th>Players per team: </th>
+ <td style="padding:5px"><%= f.text_field(:min_players_per_team, type: :number, min: 1) %></td>
+ <td style="padding:5px"><%= f.text_field(:max_players_per_team, type: :number, min: 1) %></td>
+ </tr>
+ </tbody></table>
+ </p>
+ </div>
+
+ <div id="teams-table">
+ <p>
+ <table><tbody>
+ <tr>
+ <th>Teams per match: </th>
+ <td style="padding:5px"><%= f.text_field(:min_teams_per_match, type: :number, min: 1) %></td>
+ <td style="padding:5px"><%= f.text_field(:max_teams_per_match, type: :number, min: 1) %></td>
+ </tr>
+ </tbody></table>
+ </P>
+ </div>
<p>
<%= f.label :scoring_method %>
@@ -48,7 +58,7 @@
</fieldset>
- <fieldset><legend>Settings</legend>
+ <fieldset><legend style="color:rgb(221, 145, 37)">Settings</legend>
<%= f.fields_for :settings do |setting_fields| %>
<% (@tournament.settings.empty? ? @tournament.game.settings : @tournament.settings).each do |setting| %><p>
<% name = setting.name.parameterize.underscore %>
@@ -81,17 +91,19 @@
<% end %>
</fieldset>
- <%= f.fields_for :stages do |stages_fields| %><fieldset><legend>Stages</legend>
+ <%= f.fields_for :stages do |stages_fields| %><fieldset><legend style="color:rgb(221, 145, 37)">Stages</legend>
<label for="num_stages">Number of tournament stages</label>
<input type="number" name="num_stages" min="1" value="<%= params[:num_stages] ? params[:num_stages].to_i : 1 %>">
<%# submit_tag("Set Stages", :class => "btn") %>
<% for i in 1..(params[:num_stages].to_i) do %>
- <%= stages_fields.fields_for i.to_s do |stage_fields| %><fieldset><legend>Stage <%= i %></legend>
- <%= stage_fields.label :scheduling_method %>
- <%= stage_fields.select(:scheduling_method, @tournament.scheduling_methods.map{|method| [method.humanize, method]}) %>
- <%= stage_fields.label :seeding_method %>
- <%= stage_fields.select(:seeding_method, @tournament.seeding_methods.map{|method| [method.humanize, method]}) %>
- </fieldset><% end %>
+ <p>
+ <%= stages_fields.fields_for i.to_s do |stage_fields| %><fieldset><legend style="color:rgb(221, 145, 37)">Stage <%= i %></legend>
+ <%= stage_fields.label :scheduling_method %>
+ <%= stage_fields.select(:scheduling_method, @tournament.scheduling_methods.map{|method| [method.humanize, method]}) %>
+ <%= stage_fields.label :seeding_method %>
+ <%= stage_fields.select(:seeding_method, @tournament.seeding_methods.map{|method| [method.humanize, method]}) %>
+ </fieldset><% end %>
+ </p>
<% end %>
</fieldset><% end %>
diff --git a/app/views/tournaments/standings.html.erb b/app/views/tournaments/standings.html.erb
index 28d3c22..b8739de 100644
--- a/app/views/tournaments/standings.html.erb
+++ b/app/views/tournaments/standings.html.erb
@@ -1,4 +1,7 @@
-<% playerscores = @tournament.players.collect {|player| player => tournament.statistics.getStatistic(player.matches.last, player, :score) } %>
+<% playerscores = @tournament.players.collect {|player| player => @tournament.statistics.getStatistic(player.matches.last, player, :score) } %>
+<% teams = tournament_stage.matches.collect
+{ |match| match.teams.collect { |team| team.id => team.players.collect
+{ |player| player.user_name => @tournament.statistics.getStatistic(player.matches.last, player, :score } } } %>
<table>
<tr>
@@ -9,4 +12,17 @@
<% place += 1%>
<% end %>
</tr>
-</table> \ No newline at end of file
+</table>
+
+<% teams.each do |team| %>
+ <table>
+ <tr>
+ <td>Standings:</td>
+ <% place = 0 %>
+ <% team.values.sort {|player1, player2| playerscores[player1] <=> playerscores[player2] }.each |player| %>
+ <td><%= place.to_s + ":" %> <%= player.user_name %></td>
+ <% place += 1%>
+ <% end %>
+ </tr>
+ </table>
+<% end %> \ No newline at end of file