diff --git a/app/assets/images/flags/FX.png b/app/assets/images/flags/FX.png
new file mode 100644
index 0000000..f27f411
Binary files /dev/null and b/app/assets/images/flags/FX.png differ
diff --git a/app/assets/images/flags/SU.png b/app/assets/images/flags/SU.png
new file mode 100644
index 0000000..d9624ca
Binary files /dev/null and b/app/assets/images/flags/SU.png differ
diff --git a/app/assets/images/flags/UK.png b/app/assets/images/flags/UK.png
new file mode 100644
index 0000000..02fa2a1
Binary files /dev/null and b/app/assets/images/flags/UK.png differ
diff --git a/app/assets/images/layout/forum-bg-pattern.png b/app/assets/images/layout/forum-bg-pattern.png
new file mode 100644
index 0000000..9b0f171
Binary files /dev/null and b/app/assets/images/layout/forum-bg-pattern.png differ
diff --git a/app/assets/images/layout/forum-bg-pattern@2x.png b/app/assets/images/layout/forum-bg-pattern@2x.png
new file mode 100644
index 0000000..cad04a3
Binary files /dev/null and b/app/assets/images/layout/forum-bg-pattern@2x.png differ
diff --git a/app/assets/stylesheets/_variables.scss b/app/assets/stylesheets/_variables.scss
index a0529f1..9ab65f4 100644
--- a/app/assets/stylesheets/_variables.scss
+++ b/app/assets/stylesheets/_variables.scss
@@ -24,11 +24,11 @@ $large-screen-up: new-breakpoint(min-width $large-screen 8);
*/
$open-sans: "Open Sans", sans-serif;
-$monserrat: "Montserrat", sans-serif;
+$montserrat: "Montserrat", sans-serif;
$sans-serif: $open-sans;
$base-font-family: $sans-serif;
-$header-font-family: $monserrat;
+$header-font-family: $montserrat;
/*
Sizes
diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss
index d926447..2f0d4e8 100644
--- a/app/assets/stylesheets/application.css.scss
+++ b/app/assets/stylesheets/application.css.scss
@@ -26,6 +26,7 @@
@import "components/gather";
@import "components/breadcrumbs";
@import "components/pagination";
+@import "components/tabs";
/*
Layout
@@ -46,3 +47,6 @@
@import "pages/news";
@import "pages/contests";
@import "pages/forums";
+@import "pages/teams";
+@import "pages/users";
+@import "pages/matches";
diff --git a/app/assets/stylesheets/components/_forms.scss b/app/assets/stylesheets/components/_forms.scss
index e2c9149..25c04ac 100644
--- a/app/assets/stylesheets/components/_forms.scss
+++ b/app/assets/stylesheets/components/_forms.scss
@@ -138,3 +138,24 @@ form.square {
@include shift(3);
}
}
+
+form.search {
+
+ .query {
+ @include span-columns(9);
+
+ input {
+ width: 100%;
+ }
+ }
+
+ .controls {
+ @include span-columns(3);
+ @include shift(0);
+ @include omega;
+
+ input {
+ width: 100%;
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/assets/stylesheets/components/_tabs.scss b/app/assets/stylesheets/components/_tabs.scss
new file mode 100644
index 0000000..3843abc
--- /dev/null
+++ b/app/assets/stylesheets/components/_tabs.scss
@@ -0,0 +1,56 @@
+/*
+ Breadcrumbs
+*/
+
+.tabbed {
+ $tabs-border-width: em(1);
+ $tabs-padding-vertical: em(8);
+ $tabs-padding-horizontal: em(16);
+
+ ul.tabs {
+ @include span-columns(12);
+ display: block;
+ font-family: $montserrat;
+ height: em(40);
+ max-height: em(40);
+ position: relative;
+
+ li {
+ float: left;
+ display: block;
+ background-color: $background-primary;
+
+ a {
+ border: $tabs-border-width solid $navbar-border;
+ padding: $tabs-padding-vertical $tabs-padding-horizontal;
+ float: left;
+ display: block;
+ color: white;
+ }
+
+ &.activeli {
+ z-index: 100;
+ background-color: $blue;
+
+ a {
+ padding-bottom: $tabs-padding-vertical + $tabs-border-width;
+ border-bottom: 0;
+ }
+ }
+ }
+ }
+
+ .tabbed-contents {
+ @include span-columns(12);
+ border: $tabs-border-width solid $navbar-border;
+ padding: em(20);
+ }
+
+ @for $i from 1 through $grid-columns {
+ ul.tabs-#{$i} {
+ li {
+ @include span-columns($i);
+ }
+ }
+ }
+}
diff --git a/app/assets/stylesheets/layout/_body.scss b/app/assets/stylesheets/layout/_body.scss
index 39a496a..b6ad05b 100644
--- a/app/assets/stylesheets/layout/_body.scss
+++ b/app/assets/stylesheets/layout/_body.scss
@@ -49,3 +49,35 @@ body {
@include span-columns(3);
@include omega();
}
+
+/*
+ Heading styles
+*/
+
+h1, h2, h3, h4, h5, h6 {
+
+ &.fancy {
+ text-align: center;
+ position: relative;
+ background-color: $light-blue;
+
+ &:before {
+ content: "";
+ display: block;
+ border-top: 2px solid $blue;
+ width: 100%;
+ height: 2px;
+ position: absolute;
+ top: 50%;
+ z-index: 1;
+ }
+
+ span {
+ background: inherit;
+ padding: 0 .5em;
+ position: relative;
+ display: inline-block;
+ z-index: 1;
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/assets/stylesheets/layout/_header.scss b/app/assets/stylesheets/layout/_header.scss
index 318efc3..90e557f 100644
--- a/app/assets/stylesheets/layout/_header.scss
+++ b/app/assets/stylesheets/layout/_header.scss
@@ -6,7 +6,7 @@ nav.top {
background-color: $navigation-background;
border-bottom: 1px solid $medium-gray;
- font-family: $monserrat;
+ font-family: $montserrat;
height: $navigation-height;
width: 100%;
z-index: 999;
@@ -23,7 +23,7 @@ nav.top {
cursor: pointer;
display: block;
float: right;
- font-family: $monserrat;
+ font-family: $montserrat;
font-weight: 700;
line-height: $navigation-height;
margin: 0;
diff --git a/app/assets/stylesheets/layout/_navigation.scss b/app/assets/stylesheets/layout/_navigation.scss
index 65f94da..fdb26d1 100644
--- a/app/assets/stylesheets/layout/_navigation.scss
+++ b/app/assets/stylesheets/layout/_navigation.scss
@@ -3,7 +3,7 @@
*/
#menu {
- font-family: "Montserrat", sans-serif;
+ font-family: $montserrat;
background-color: $background-primary;
height: em(60);
max-height: em(60);
diff --git a/app/assets/stylesheets/mixins/_buttons.scss b/app/assets/stylesheets/mixins/_buttons.scss
index ccd74f4..a5e8908 100644
--- a/app/assets/stylesheets/mixins/_buttons.scss
+++ b/app/assets/stylesheets/mixins/_buttons.scss
@@ -3,7 +3,7 @@
*/
@mixin button($background: $button-primary, $text: $button-text) {
- font-family: $monserrat;
+ font-family: $montserrat;
font-size: em(16);
background-color: $background;
color: $text;
diff --git a/app/assets/stylesheets/pages/_forums.scss b/app/assets/stylesheets/pages/_forums.scss
index 5c646ff..ebb9c3c 100644
--- a/app/assets/stylesheets/pages/_forums.scss
+++ b/app/assets/stylesheets/pages/_forums.scss
@@ -141,6 +141,7 @@ div#categories {
.content {
@include span-columns(9);
@include omega;
+ background: image-url('images/layout/forum-bg-pattern.png') top left;
.text,
.signature {
diff --git a/app/assets/stylesheets/pages/_matches.scss b/app/assets/stylesheets/pages/_matches.scss
new file mode 100644
index 0000000..b999667
--- /dev/null
+++ b/app/assets/stylesheets/pages/_matches.scss
@@ -0,0 +1,22 @@
+/*
+ Matches Listing
+*/
+
+#matches {
+ table-layout: auto;
+ margin-bottom: em(20);
+
+ .opponent {
+ width: 30%;
+ }
+
+ .date,
+ .maps {
+ width: 20%;
+ }
+
+ .score {
+ width: 10%;
+ text-align: right;
+ }
+}
\ No newline at end of file
diff --git a/app/assets/stylesheets/pages/_teams.scss b/app/assets/stylesheets/pages/_teams.scss
new file mode 100644
index 0000000..4b9c1bc
--- /dev/null
+++ b/app/assets/stylesheets/pages/_teams.scss
@@ -0,0 +1,94 @@
+/*
+ Teams Listing
+*/
+
+#teams {
+ table {
+ table-layout: auto;
+ }
+
+ .country {
+ width: 5%;
+ }
+
+ .name {
+ width: 45%;
+ }
+
+ .irc {
+ width: 20%;
+ }
+
+ .members {
+ width: 10%;
+ }
+
+ .actions {
+ width: 20%;
+ text-align: right;
+ }
+}
+
+/*
+ Team Profiles
+*/
+
+#team-profile {
+
+ .logo {
+ @include span-columns(12);
+ margin: em(20) 0;
+ text-align: center;
+
+ img {
+ display: inline-block;
+ float: none;
+ width: auto;
+ }
+ }
+
+ .controls {
+ @include span-columns(12);
+ margin: em(20) 0;
+ }
+}
+
+
+#members {
+ table-layout: auto;
+
+ .country,
+ .age {
+ width: 5%;
+ }
+
+ .member {
+ width: 20%;
+ }
+
+ .steamid {
+ width: 15%;
+ }
+
+ .rank {
+ width: 10%;
+ }
+
+ .note {
+ width: 30%;
+ }
+
+ .joined {
+ width: 10%;
+ }
+
+ .joined {
+ text-align: right;
+ }
+
+ &.short {
+ .rank {
+ width: 40%;
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/assets/stylesheets/pages/_users.scss b/app/assets/stylesheets/pages/_users.scss
new file mode 100644
index 0000000..557a12c
--- /dev/null
+++ b/app/assets/stylesheets/pages/_users.scss
@@ -0,0 +1,21 @@
+#users {
+ table-layout: auto;
+
+ .country,
+ .age {
+ width: 5%;
+ }
+
+ .username,
+ .name {
+ width: 25%;
+ }
+
+ .steamid {
+ width: 20%;
+ }
+
+ .actions {
+ text-align: right;
+ }
+}
\ No newline at end of file
diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb
index bb9d523..f066092 100644
--- a/app/controllers/comments_controller.rb
+++ b/app/controllers/comments_controller.rb
@@ -7,7 +7,7 @@ class CommentsController < ApplicationController
end
def show
- @comments = Comment.recent5.all conditions: {commentable_id: params[:id2], commentable_type: params[:id]}
+ @comments = Comment.recent5.all conditions: { commentable_id: params[:id2], commentable_type: params[:id] }
render partial: 'list', layout: false
end
diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb
index bf13ad8..09faf4f 100644
--- a/app/controllers/forums_controller.rb
+++ b/app/controllers/forums_controller.rb
@@ -8,7 +8,14 @@ class ForumsController < ApplicationController
def show
raise AccessError unless @forum.can_show? cuser
- @topics = @forum.topics.all
+
+ @topics = Topic.where(forum_id: @forum.id)
+ .joins(:posts, :user, :users_who_read)
+ .includes(:lock)
+ .group('topics.id')
+ .order('state DESC, posts.id DESC')
+ .paginate(page: params[:page], per_page: 30)
+
@forum.read_by! cuser if cuser
@nobody = true
end
diff --git a/app/models/concerns/extra.rb b/app/models/concerns/extra.rb
index 55093b9..be784b8 100644
--- a/app/models/concerns/extra.rb
+++ b/app/models/concerns/extra.rb
@@ -1,76 +1,76 @@
module Extra
- extend ActiveSupport::Concern
+ extend ActiveSupport::Concern
- CODING_HTML = 0
- CODING_BBCODE = 1
- CODING_MARKDOWN = 2
+ CODING_HTML = 0
+ CODING_BBCODE = 1
+ CODING_MARKDOWN = 2
included do
- def codings
- {
- CODING_HTML => "Plain HTML",
- CODING_BBCODE => "BBCode",
- CODING_MARKDOWN => "Markdown"
- }
- end
+ def codings
+ {
+ CODING_HTML => "Plain HTML",
+ CODING_BBCODE => "BBCode",
+ CODING_MARKDOWN => "Markdown"
+ }
+ end
- def check_params(params, filter)
- (params.instance_of?(Array) ? params : params.keys).each do |key|
- return false unless filter.include? key.to_sym
- end
- return true
- end
+ def check_params(params, filter)
+ (params.instance_of?(Array) ? params : params.keys).each do |key|
+ return false unless filter.include? key.to_sym
+ end
+ return true
+ end
- def error_messages
- self.errors.full_messages.uniq
- end
+ def error_messages
+ self.errors.full_messages.uniq
+ end
- def bbcode_to_html(text)
- Sanitize.clean(text.to_s).bbcode_to_html.gsub(/\n|\r\n/, "
").html_safe
- end
+ def bbcode_to_html(text)
+ Sanitize.clean(text.to_s).bbcode_to_html.gsub(/\n|\r\n/, "
").html_safe
+ end
- def move_up(scope, column = "position")
- n = 0
- objects = self.class.all(conditions: scope, order: column)
- binding.pry
- objects.each do |item|
- if item.id == id and n > 0
- old_position = item.read_attribute(:column)
- item.update_attribute(column, objects.fetch(n-1).read_attribute(:column))
- objects.fetch(n-1).update_attribute(column, old_position)
- end
- n = n + 1
- end
- end
+ def move_up(scope, column = "position")
+ n = 0
+ objects = self.class.all(conditions: scope, order: column)
+ binding.pry
+ objects.each do |item|
+ if item.id == id and n > 0
+ old_position = item.read_attribute(:column)
+ item.update_attribute(column, objects.fetch(n-1).read_attribute(:column))
+ objects.fetch(n-1).update_attribute(column, old_position)
+ end
+ n = n + 1
+ end
+ end
- def move_down(scope, column = "position")
- n = 0
- objects = self.class.all(conditions: scope, order: column)
- binding.pry
- objects.each do |item|
- if item.id == id and n < (objects.length-1)
- old_position = item.read_attribute(:column)
- item.update_attribute(column, objects.fetch(n+1).read_attribute(:column))
- objects.fetch(n+1).update_attribute(column, old_position)
- end
- n = n + 1
- end
- end
+ def move_down(scope, column = "position")
+ n = 0
+ objects = self.class.all(conditions: scope, order: column)
+ binding.pry
+ objects.each do |item|
+ if item.id == id and n < (objects.length-1)
+ old_position = item.read_attribute(:column)
+ item.update_attribute(column, objects.fetch(n+1).read_attribute(:column))
+ objects.fetch(n+1).update_attribute(column, old_position)
+ end
+ n = n + 1
+ end
+ end
- def can_show? cuser
- true
- end
+ def can_show? cuser
+ true
+ end
- def can_create? cuser
- true
- end
+ def can_create? cuser
+ true
+ end
- def can_update? cuser
- true
- end
+ def can_update? cuser
+ true
+ end
- def can_destroy? cuser
- true
- end
- end
+ def can_destroy? cuser
+ true
+ end
+ end
end
\ No newline at end of file
diff --git a/app/models/topic.rb b/app/models/topic.rb
index fc405ca..b13001f 100644
--- a/app/models/topic.rb
+++ b/app/models/topic.rb
@@ -57,7 +57,23 @@ class Topic < ActiveRecord::Base
end
def view_count
- self.view_counts.length
+ view_counts.length
+ end
+
+ def cache_key(key)
+ "/topics/#{id}/#{key}"
+ end
+
+ def cached_view_count
+ Rails.cache.fetch(cache_key('view_count'), expires_in: 24.hours) do
+ view_count
+ end
+ end
+
+ def cached_posts_count
+ Rails.cache.fetch(cache_key('posts'), expires_in: 12.hours) do
+ posts.count - 1
+ end
end
def make_post
diff --git a/app/models/user.rb b/app/models/user.rb
index 7190a16..e54396b 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -163,7 +163,11 @@ class User < ActiveRecord::Base
end
def from
- profile.town ? "#{profile.town}, #{country_s}" : "#{country_s}"
+ if profile.town.length > 0
+ "#{profile.town}, #{country_s}"
+ else
+ "#{country_s}"
+ end
end
def age
diff --git a/app/views/application/_header.html.erb b/app/views/application/_header.html.erb
index 6a73a1c..9576d02 100644
--- a/app/views/application/_header.html.erb
+++ b/app/views/application/_header.html.erb
@@ -34,7 +34,7 @@
- <%= image_tag "logo.png" %>
+ <%= link_to image_tag("logo.png"), root_path %>
<% if cuser %>
diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb
index 86f5a22..8ba7312 100644
--- a/app/views/forums/show.html.erb
+++ b/app/views/forums/show.html.erb
@@ -6,6 +6,8 @@
<%=h @forum.title %>
+<%= will_paginate @topics %>
+
Topic |
@@ -14,7 +16,7 @@
Views |
Last Post |
- <% @forum.topics.basic.ordered.each do |topic| %>
+ <% @topics.each do |topic| %>
@@ -36,8 +38,8 @@
<% end %>
|
<%= namelink(topic.user) %> |
- <%=h topic.posts.count-1 %> |
- <%=h topic.view_count %> |
+ <%=h topic.cached_posts_count %> |
+ <%=h topic.cached_view_count %> |
<%= link_to lastpost(topic) do %>
<%=h topic.posts.last.user %>
@@ -48,4 +50,6 @@
<% end %>
|
+<%= will_paginate @topics %>
+
<%= render partial: 'controls', locals: { forum: @forum } %>
diff --git a/app/views/matches/_list.html.erb b/app/views/matches/_list.html.erb
index 08b4c48..109bdd1 100644
--- a/app/views/matches/_list.html.erb
+++ b/app/views/matches/_list.html.erb
@@ -1,18 +1,18 @@
-
+
<% if contest %>
- Contest |
- Opponent |
+ Contest |
+ Opponent |
<% else %>
- Opponent |
+ Opponent |
<% end %>
- Date |
+ Date |
<% unless defined? exclude_maps %>
- Maps |
+ Maps |
<% end %>
- Score |
+ Score |
<% if matches.first and matches.first.contest.contest_type == Contest::TYPE_LADDER %>
- Points |
+ Points |
<% end %>
@@ -35,21 +35,21 @@
<%= match.map1 %>, <%= match.map2 %>
<% end %>
-
+ |
<%= link_to match, :class => "bold #{match.score_color}" do %>
<% if friendly == match.contester1.team %>
- <%= h match.score1 %> - <%= h match.score2 %>
+ <%=h match.score1 %> - <%=h match.score2 %>
<% else %>
- <%= h match.score2 %> - <%= h match.score1 %>
+ <%=h match.score2 %> - <%=h match.score1 %>
<% end %>
<% end %>
|
<% if match.contest.contest_type == Contest::TYPE_LADDER %>
<% if match.get_friendly(:points) > 0 %>
- <%= image_tag "icons/up.gif" %>
+ <%= icon 'chevron-up' %>
<% elsif match.get_friendly(:points) < 0 %>
- <%= image_tag "icons/down.gif" %>
+ <%= icon 'chevron-down' %>
<% end %>
<%= match.get_friendly(:points) %>
|
diff --git a/app/views/posts/_post.html.erb b/app/views/posts/_post.html.erb
index 3e388a4..7c2adb9 100644
--- a/app/views/posts/_post.html.erb
+++ b/app/views/posts/_post.html.erb
@@ -9,10 +9,17 @@
<% if post.user.team %>
- <%= namelink post.user.team %>
+ <%= namelink post.user.team %>
<% end %>
- <%= cascade post.user, [["Posts", "posts.count"], "from", "joined"] %>
+
+ - Posts
+ - <%= post.user.posts.count %>
+ - Location
+ - <%= post.user.from %>
+ - Joined
+ - <%= post.user.joined %>
+
diff --git a/app/views/teamers/_list.html.erb b/app/views/teamers/_list.html.erb
index 69f009c..8ed86c0 100644
--- a/app/views/teamers/_list.html.erb
+++ b/app/views/teamers/_list.html.erb
@@ -1,38 +1,30 @@
-
+
diff --git a/app/views/teams/_list.html.erb b/app/views/teams/_list.html.erb
index 6394ef8..3e3dc23 100644
--- a/app/views/teams/_list.html.erb
+++ b/app/views/teams/_list.html.erb
@@ -1,28 +1,34 @@
-
+
- |
- Name |
- Irc |
- Members |
+ |
+ Name |
+ IRC |
+ Members |
<% if cuser and cuser.admin? %>
- Options |
+ |
<% end %>
<% for team in teams %>
<% if team.teamers_num > 0 %>
-
+
<%= flag team.country %> |
<%= namelink team %> |
- <%= h team.irc[0,15] if team.irc %> |
+ <%= h team.irc if team.irc %> |
<%= h team.teamers_num %> |
<% if cuser and cuser.admin? %>
-
- <%= link_to 'Edit', edit_team_path(team) %>
+ |
+ <%= link_to edit_team_path(team) do %>
+ <%= icon 'pencil' %> Edit
+ <% end %>
<% if team.active %>
- <%= link_to 'Destroy', team, :confirm => 'Are you sure?', :method => :delete %>
+ <%= link_to team, confirm: 'Are you sure?', method: :delete do %>
+ <%= icon 'times' %> Delete
+ <% end %>
<% else %>
- <%= link_to 'Recover', :action => "recover", :id => team %>
+ <%= link_to action: "recover", id: team do %>
+ <%= icon 'save' %>
+ <% end %>
<% end %>
|
<% end %>
diff --git a/app/views/teams/index.html.erb b/app/views/teams/index.html.erb
index af2f79e..3ca5627 100644
--- a/app/views/teams/index.html.erb
+++ b/app/views/teams/index.html.erb
@@ -1,9 +1,10 @@
-Listing teams
Teams with 0 members are not displayed.
+Listing teams
+Teams with no current members are not displayed.
-
- <%= render :partial => "list", :locals => {:teams => @teams} %>
+
+ <%= render partial: 'list', locals: { teams: @teams } %>
diff --git a/app/views/teams/show.html.erb b/app/views/teams/show.html.erb
index d5241ec..42bd0bc 100644
--- a/app/views/teams/show.html.erb
+++ b/app/views/teams/show.html.erb
@@ -1,108 +1,89 @@
-
- <%= h @team.name %>
-
+
+
+ <%=h @team.name %>
+
-<% if @team.logo %>
- <%= image_tag @team.logo.url, :class => "centered" %>
-<% end %>
-
-
-
-
-
-
-
-
-
-
- Irc: |
- <%= h @team.irc %> |
-
-
-
- Web: |
- <%= h @team.web %> |
-
-
-
- Tag: |
- <%= h @team.tag %> |
-
-
-
- Country: |
- <%= h @team.country %> |
-
-
-
- Founder: |
- <%= namelink @team.founder %> |
-
-
-
- Comment: |
- <%= h @team.comment %> |
-
-
- <% if @team.recruiting %>
-
- Recruiting: |
- <%= h @team.recruiting %> |
-
- <% end %>
-
-
-
- <%= link_to "Send a message", :controller => "messages", :action => "new", :id => "Team", :id2 => @team %>
-
+ <% if @team.logo %>
+
+ <%= image_tag @team.logo.url, class: 'logo' %>
+ <% end %>
-
-
- Current Members
-
+
+
- <%= render :partial => "teamers/list", :locals => {:teamers => @team.teamers.active.ordered.distinct, :blacklist => false, :comment => true } %>
+
+
+
+ - Irc:
+ - <%= h @team.irc %>
+ - Web:
+ - <%= h @team.web %>
+ - Tag:
+ - <%= h @team.tag %>
+ - Country:
+ - <%= h @team.country %>
+ - Founder:
+ - <%= namelink @team.founder %>
+ - Comment:
+ - <%= h @team.comment %>
+ <% if @team.recruiting %>
+ - Recruiting:
+ - <%= h @team.recruiting %>
+ <% end %>
+
-
- Past Members
-
+ <%= link_to "Send a message", { controller: "messages", action: "new", id: "Team", id2: @team }, { class: 'button tiny' } %>
+
- <%= render :partial => "teamers/list", :locals => {:teamers => @team.teamers.past.distinct, :blacklist => @team.teamers.active.ordered.distinct, :comment => false} %>
-
+
+
Current Members
+ <%= render partial: "teamers/list", locals: { teamers: @team.teamers.active.ordered.distinct, blacklist: false, comment: true } %>
-
- <% @team.contesters.chronological.each do |contester| %>
- <% next if Match.finished.ordered.of_contester(contester).count == 0 %>
-
- <%= link_to contester.contest, contester.contest, :name => "contest_#{contester.contest.id}" %>
-
+ Past Members
+ <%= render partial: "teamers/list", locals: { teamers: @team.teamers.past.distinct, blacklist: @team.teamers.active.ordered.distinct, comment: false } %>
+
- <%= render :partial => "matches/list",
- :locals => {:matches => Match.finished.ordered.of_contester(contester), :friendly => contester.team, :contest => false} %>
- <% end %>
-
+
+ <% @team.contesters.chronological.each do |contester| %>
+ <% next if Match.finished.ordered.of_contester(contester).count == 0 %>
+
+ <%= link_to contester.contest, contester.contest, :name => "contest_#{contester.contest.id}" %>
+
+ <%= render partial: "matches/list", locals: { matches: Match.finished.ordered.of_contester(contester), friendly: contester.team, contest: false } %>
+ <% end %>
+
-
-
- Matches: <%= @team.matches_finished.count %> played / <%= @team.matches.count %> total
- - Won: <%= @team.matches_won.count %> (<%= 100.0*@team.matches_won.count/@team.matches_finished.count %> %)
- - Lost: <%= @team.matches_lost.count %> (<%= 100.0*@team.matches_lost.count/@team.matches_finished.count %> %)
- - Draw: <%= @team.matches_draw.count %> (<%= 100.0*@team.matches_draw.count/@team.matches_finished.count %> %)
-
+
+
+ - Matches:
+ - <%= @team.matches_finished.count %> dllayed / <%= @team.matches.count %> total
+ - Won:
+ - <%= @team.matches_won.count %> (<%= 100.0*@team.matches_won.count/@team.matches_finished.count %> %)
+ - Lost:
+ - <%= @team.matches_lost.count %> (<%= 100.0*@team.matches_lost.count/@team.matches_finished.count %> %)
+ - Draw:
+ - <%= @team.matches_draw.count %> (<%= 100.0*@team.matches_draw.count/@team.matches_finished.count %> %)
+
+
+
+
+
+ <% if cuser and @team.can_update? cuser %>
+
+ <%= link_to 'Edit Team', edit_team_path(@team), class: 'button' %>
+
+ <% end %>
-
-
-
-<% if cuser and @team.can_update? cuser %>
- <%= link_to 'Edit', edit_team_path(@team) %>
-<% end %>
diff --git a/app/views/topics/show.html.erb b/app/views/topics/show.html.erb
index a65041b..77a7a7a 100644
--- a/app/views/topics/show.html.erb
+++ b/app/views/topics/show.html.erb
@@ -22,9 +22,13 @@
<% end %>
<% if @newpost.errors.count > 0 %>
- <% @newpost.error_messages.each do |m| %>
- <%= h m %>
- <% end %>
+
+
+ <% @newpost.error_messages.each do |m| %>
+ - <%= h m %>
+ <% end %>
+
+
<% end %>
@@ -46,7 +50,7 @@
<%= will_paginate @posts %>
-
+
<% if @newpost.can_create? cuser %>
<%= link_to_function 'Fast Reply', "$('#reply').fadeIn('slow')", class: 'button' %>
<%= link_to 'Reply', new_post_path(@newpost, id: @topic), class: 'button' %>
diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb
index 118a43b..55bb571 100644
--- a/app/views/users/edit.html.erb
+++ b/app/views/users/edit.html.erb
@@ -2,8 +2,8 @@
<%= form_for @user, :html => { :multipart => true } do |f| %>
<% f.fields_for :profile do |p| %>
-
-
+
+
-
+
<% if @user.errors.any? %>
@@ -286,5 +286,7 @@
<% end %>
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
index 5b7137c..c11bba2 100644
--- a/app/views/users/index.html.erb
+++ b/app/views/users/index.html.erb
@@ -1,55 +1,47 @@
-
Listing users
+
Listing Users
-<%= form_tag users_path, :method => 'get' do %>
+<%= form_tag(users_path, method: 'get', class: 'square search') do %>
<%= hidden_field_tag :direction, params[:direction] %>
<%= hidden_field_tag :sort, params[:sort] %>
-
+
<%= text_field_tag :search, params[:search] %>
- <%= submit_tag "Search", :name => nil %>
-
+
+
+ <%= submit_tag "Search", name: nil %>
+
<% end %>
-
+
-
- Country
- |
-
- Username
- |
-
- Real name
- |
-
- Steam ID
- |
-
- Age
- |
+ |
+ Username |
+ Name |
+ Steam ID |
+ Age |
<% if cuser and cuser.admin? %>
-
- Options
- |
+ |
<% end %>
<% @users.each do |user| %>
-
+
<%= flag user.country %> |
<%= link_to (h user.username), user %> |
<%= h user.firstname %> <%=h user.lastname %> |
<%= h user.steamid %> |
<%= user.age %> |
<% if cuser and cuser.admin? %>
-
- <%= link_to 'Edit', edit_user_path(user) %>
- <%= link_to 'Delete', user, :confirm => "Proceed to delete?", :method => :delete %>
+ |
+ <%= link_to edit_user_path(user) do %>
+ <%= icon 'pencil' %> Edit
+ <% end %>
+ <%= link_to user, confirm: "Proceed to delete?", method: :delete do %>
+ <%= icon 'times' %> Delete
+ <% end %>
|
<% end %>
<% end %>
-
- <%= will_paginate @users %>
-
+<%= will_paginate @users %>
diff --git a/config/application.rb b/config/application.rb
index 8e08714..5fe9a48 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -12,12 +12,11 @@ module Ensl
# Custom directories with classes and modules you want to be autoloadable.
config.autoload_paths += Dir["#{config.root}/app/services/**/", "#{config.root}/app/models/concerns/"]
- # Only load the plugins named here, in the order given (default is alphabetical).
- # :all can be used as a placeholder for all plugins nowt explicitly named.
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
+ # Load secrets from .env
+ config.secret_token = ENV['APP_SECRET']
- # Activate observers that should always be running.
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
+ # Use cookies
+ config.session_store :cookie_store, :key => '_ENSL_session_key', :expire_after => 30.days.to_i
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
diff --git a/config/deploy/staging.rb b/config/deploy/staging.rb
index 58c65d4..6f04ccb 100644
--- a/config/deploy/staging.rb
+++ b/config/deploy/staging.rb
@@ -1,4 +1,4 @@
-set :branch, 'develop'
+set :branch, 'feature-redesign'
set :deploy_to, '/var/www/virtual/ensl.org/staging/rails'
set :rails_env, 'staging'
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 42d5820..6a8fbf4 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -27,4 +27,10 @@ Ensl::Application.configure do
# Expands the lines which load the assets
config.assets.debug = true
+
+ # Use a different cache store
+ config.cache_store = :dalli_store
+
+ # Enable threaded mode
+ config.threadsafe!
end
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 980ff81..f607881 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -53,7 +53,7 @@ Ensl::Application.configure do
config.action_mailer.raise_delivery_errors = true
# Enable threaded mode
- # config.threadsafe!
+ config.threadsafe!
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found)
diff --git a/config/environments/staging.rb b/config/environments/staging.rb
index 1bf7d89..797adaa 100644
--- a/config/environments/staging.rb
+++ b/config/environments/staging.rb
@@ -53,7 +53,7 @@ Ensl::Application.configure do
config.action_mailer.raise_delivery_errors = true
# Enable threaded mode
- # config.threadsafe!
+ config.threadsafe!
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found)
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 46393fe..d099083 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -11,14 +11,14 @@ Ensl::Application.configure do
config.whiny_nils = true
# Show full error reports and disable caching
- config.consider_all_requests_local = true
+ config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Raise exceptions instead of rendering exception templates
config.action_dispatch.show_exceptions = false
# Disable request forgery protection in test environment
- config.action_controller.allow_forgery_protection = false
+ config.action_controller.allow_forgery_protection = false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
@@ -32,4 +32,7 @@ Ensl::Application.configure do
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
+
+ # Enable threaded mode
+ config.threadsafe!
end
diff --git a/config/initializers/phpcookies.rb b/config/initializers/phpcookies.rb
deleted file mode 100644
index f5c799f..0000000
--- a/config/initializers/phpcookies.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-module ActionDispatch
- class Cookies
- class SignedCookieJar
- def initialize(parent_jar, secret)
- ensure_secret_secure(secret)
- @parent_jar = parent_jar
- @verifier = MessageVerifier.new(secret,:serializer=>YAML)
- end
- end
- end
-end
diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb
deleted file mode 100644
index 7a11632..0000000
--- a/config/initializers/secret_token.rb
+++ /dev/null
@@ -1 +0,0 @@
-Ensl::Application.config.secret_token = ENV['APP_SECRET']
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
deleted file mode 100644
index 324191f..0000000
--- a/config/initializers/session_store.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-Ensl::Application.config.session_store :active_record_store,
- :key => '_ENSL_session_key',
- :expire_after => 30.days.to_i
-
\ No newline at end of file