From df1cda1faab97f4c424efdcf8b6822f98b73adb8 Mon Sep 17 00:00:00 2001
From: guntasgrewal
Date: Sun, 27 Apr 2014 20:47:31 -0400
Subject: Made some CSS changes all over the website. Added an alert icon.still
need ajax to work with it
---
app/assets/stylesheets/custom.css.scss | 15 ++++++-
app/assets/stylesheets/scaffolds.css.scss | 4 +-
app/assets/stylesheets/tournaments.css.scss | 1 +
app/views/layouts/application.html.erb | 7 +++-
app/views/servers/_form.html.erb | 17 ++++----
app/views/tournaments/_form.html.erb | 64 +++++++++++++++++------------
app/views/tournaments/standings.html.erb | 20 ++++++++-
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 %>
-
- Default permissions for new users
-
+
+ Default permissions for new users
+
<%= fields_for "server[default_user_abilities]", @server.default_user_abilities do |a| %>
<% @server.default_user_abilities.keys.each do |ability| %>
- <%= a.check_box(ability) %> <%= ability.to_s.humanize %>
+ <%= a.check_box(ability) %> <%= ability.to_s.humanize %>
<% end %>
<% end %>
-
-
- <%= f.submit %>
-
+
+
+ <%= f.submit %>
+
+
<% 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 %>
- Attributes
+ Attributes
<%= 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 %>
-
-
-
-
- Minimum
- Maximum
-
- Players per team
- <%= f.text_field(:min_players_per_team, type: :number, min: 1) %>
- <%= f.text_field(:max_players_per_team, type: :number, min: 1) %>
-
-
- Teams per match
- <%= f.text_field(:min_teams_per_match, type: :number, min: 1) %>
- <%= f.text_field(:max_teams_per_match, type: :number, min: 1) %>
-
-
+
+
+
+
+
+ Minimum
+ Maximum
+
+ Players per team:
+ <%= f.text_field(:min_players_per_team, type: :number, min: 1) %>
+ <%= f.text_field(:max_players_per_team, type: :number, min: 1) %>
+
+
+
+
+
+
+
+
+
+ Teams per match:
+ <%= f.text_field(:min_teams_per_match, type: :number, min: 1) %>
+ <%= f.text_field(:max_teams_per_match, type: :number, min: 1) %>
+
+
+
+
<%= f.label :scoring_method %>
@@ -48,7 +58,7 @@
- Settings
+ Settings
<%= f.fields_for :settings do |setting_fields| %>
<% (@tournament.settings.empty? ? @tournament.game.settings : @tournament.settings).each do |setting| %>
<% name = setting.name.parameterize.underscore %>
@@ -81,17 +91,19 @@
<% end %>
- <%= f.fields_for :stages do |stages_fields| %>Stages
+ <%= f.fields_for :stages do |stages_fields| %>Stages
Number of tournament stages
<%# 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| %>Stage <%= i %>
- <%= 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]}) %>
- <% end %>
+
+ <%= stages_fields.fields_for i.to_s do |stage_fields| %>
Stage <%= i %>
+ <%= 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]}) %>
+ <% end %>
+
<% end %>
<% 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 } } } %>
@@ -9,4 +12,17 @@
<% place += 1%>
<% end %>
-
\ No newline at end of file
+
+
+<% teams.each do |team| %>
+
+
+ Standings:
+ <% place = 0 %>
+ <% team.values.sort {|player1, player2| playerscores[player1] <=> playerscores[player2] }.each |player| %>
+ <%= place.to_s + ":" %> <%= player.user_name %>
+ <% place += 1%>
+ <% end %>
+
+
+<% end %>
\ No newline at end of file
--
cgit v1.2.3-54-g00ecf
From 12b9f96b4003ec384e1583e4d6d53fcb8d5f960c Mon Sep 17 00:00:00 2001
From: nfoy
Date: Sun, 27 Apr 2014 20:51:49 -0400
Subject: More tournament index stuff.
---
app/assets/images/hearthstone.png | Bin 0 -> 10229 bytes
app/assets/images/rock_paper_scissors.png | Bin 0 -> 4951 bytes
app/assets/images/rock_paper_scissors.svg | 108 +++++++++++++++++++++++++++++
app/views/common/_show_tournament.html.erb | 6 +-
app/views/users/index.html.erb | 2 +-
app/views/users/show.html.erb | 2 +-
6 files changed, 113 insertions(+), 5 deletions(-)
create mode 100644 app/assets/images/hearthstone.png
create mode 100644 app/assets/images/rock_paper_scissors.png
create mode 100644 app/assets/images/rock_paper_scissors.svg
diff --git a/app/assets/images/hearthstone.png b/app/assets/images/hearthstone.png
new file mode 100644
index 0000000..15d20b4
Binary files /dev/null and b/app/assets/images/hearthstone.png differ
diff --git a/app/assets/images/rock_paper_scissors.png b/app/assets/images/rock_paper_scissors.png
new file mode 100644
index 0000000..294916c
Binary files /dev/null and b/app/assets/images/rock_paper_scissors.png differ
diff --git a/app/assets/images/rock_paper_scissors.svg b/app/assets/images/rock_paper_scissors.svg
new file mode 100644
index 0000000..67bb6bd
--- /dev/null
+++ b/app/assets/images/rock_paper_scissors.svg
@@ -0,0 +1,108 @@
+
+
+ Rock Scissors Paper
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ image/svg+xml
+
+
+
+
+ Openclipart
+
+
+ Rock Scissors Paper
+ 2010-05-31T17:54:35
+ Rock Scissors Paper hand game depiction. Rock, scissors, and paper by Francesco 'Architetto' Rollandin from openclipart.org
+ http://openclipart.org/detail/63805/rock-scissors-paper-by-mazeo
+
+
+ mazeo
+
+
+
+
+ clip art
+ clipart
+ fingers
+ fist
+ hand
+ hands
+ paper
+ paper rock scissors
+ paper scissors rock
+ remix
+ rock
+ rock paper scissors
+ rock scissors paper
+ scissor
+ scissors
+ scissors paper rock
+ scissors rock paper
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/views/common/_show_tournament.html.erb b/app/views/common/_show_tournament.html.erb
index 280d59d..a1d01d2 100644
--- a/app/views/common/_show_tournament.html.erb
+++ b/app/views/common/_show_tournament.html.erb
@@ -1,6 +1,6 @@
- <%= image_tag(target.game.name.downcase.tr(" ", "_") + ".png", class: "t-image") %>
+ <%= image_tag(target.game.name.downcase.tr(" ", "_").tr(",", "") + ".png", class: "t-image") %>
<%= Game.find(target.game_id).name %>
@@ -8,8 +8,8 @@
<%= link_to(target) do %>
<%= target.name %> <% end %>
- Hosted by: <%= target.hosts.first.name %>
- <%= image_tag('http://www.gravatar.com/avatar/' + Digest::MD5.hexdigest(target.hosts.first.email) + '?s=45&d=identicon', class: "t-image") %>
+ <%= image_tag('http://www.gravatar.com/avatar/' + Digest::MD5.hexdigest(target.hosts.first.email) + '?s=45&d=identicon') %>
+ <%= target.hosts.first.name %>'s tournament
Players per team: <%= target.min_players_per_team %>
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
index 89e369a..e4251cd 100644
--- a/app/views/users/index.html.erb
+++ b/app/views/users/index.html.erb
@@ -16,7 +16,7 @@
<% @users.each do |user| %>
- <%= link_to("#{user.user_name}", user, nil) %>
+ <%= image_tag('http://www.gravatar.com/avatar/' + Digest::MD5.hexdigest(user.email) + '?s=30&d=identicon') %> <%= link_to("#{user.user_name}", user, nil) %>
<%= user.name %>
*******
<%= user.user_name %>
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index b408589..b247b7d 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -54,4 +54,4 @@
<%= link_to 'Edit', edit_user_path(@user) %> |
-<%= link_to 'Users', users_path %>
+<%= link_to 'All Users', users_path %>
--
cgit v1.2.3-54-g00ecf