mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-26 04:21:36 +00:00
Added basic teams pages styling
This commit is contained in:
parent
775f5682a4
commit
0112ef9005
42 changed files with 547 additions and 288 deletions
BIN
app/assets/images/flags/FX.png
Normal file
BIN
app/assets/images/flags/FX.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 851 B |
BIN
app/assets/images/flags/SU.png
Normal file
BIN
app/assets/images/flags/SU.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 520 B |
BIN
app/assets/images/flags/UK.png
Normal file
BIN
app/assets/images/flags/UK.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
app/assets/images/layout/forum-bg-pattern.png
Normal file
BIN
app/assets/images/layout/forum-bg-pattern.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.3 KiB |
BIN
app/assets/images/layout/forum-bg-pattern@2x.png
Normal file
BIN
app/assets/images/layout/forum-bg-pattern@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.8 KiB |
|
@ -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
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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%;
|
||||
}
|
||||
}
|
||||
}
|
56
app/assets/stylesheets/components/_tabs.scss
Normal file
56
app/assets/stylesheets/components/_tabs.scss
Normal file
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
|
||||
#menu {
|
||||
font-family: "Montserrat", sans-serif;
|
||||
font-family: $montserrat;
|
||||
background-color: $background-primary;
|
||||
height: em(60);
|
||||
max-height: em(60);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
22
app/assets/stylesheets/pages/_matches.scss
Normal file
22
app/assets/stylesheets/pages/_matches.scss
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
94
app/assets/stylesheets/pages/_teams.scss
Normal file
94
app/assets/stylesheets/pages/_teams.scss
Normal file
|
@ -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%;
|
||||
}
|
||||
}
|
||||
}
|
21
app/assets/stylesheets/pages/_users.scss
Normal file
21
app/assets/stylesheets/pages/_users.scss
Normal file
|
@ -0,0 +1,21 @@
|
|||
#users {
|
||||
table-layout: auto;
|
||||
|
||||
.country,
|
||||
.age {
|
||||
width: 5%;
|
||||
}
|
||||
|
||||
.username,
|
||||
.name {
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.steamid {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.actions {
|
||||
text-align: right;
|
||||
}
|
||||
}
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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/, "<br>").html_safe
|
||||
end
|
||||
def bbcode_to_html(text)
|
||||
Sanitize.clean(text.to_s).bbcode_to_html.gsub(/\n|\r\n/, "<br>").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
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
</nav>
|
||||
<div class="wrapper banner">
|
||||
<div id="logo">
|
||||
<%= image_tag "logo.png" %>
|
||||
<%= link_to image_tag("logo.png"), root_path %>
|
||||
</div>
|
||||
<div id="authentication">
|
||||
<% if cuser %>
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
<h2><%=h @forum.title %></h2>
|
||||
|
||||
<%= will_paginate @topics %>
|
||||
|
||||
<table id="topics">
|
||||
<tr>
|
||||
<th class="topic">Topic</th>
|
||||
|
@ -14,7 +16,7 @@
|
|||
<th class="views">Views</th>
|
||||
<th class="last">Last Post</th>
|
||||
</tr>
|
||||
<% @forum.topics.basic.ordered.each do |topic| %>
|
||||
<% @topics.each do |topic| %>
|
||||
<tr>
|
||||
<td>
|
||||
<h5>
|
||||
|
@ -36,8 +38,8 @@
|
|||
<% end %>
|
||||
</td>
|
||||
<td><%= namelink(topic.user) %></td>
|
||||
<td><%=h topic.posts.count-1 %></td>
|
||||
<td><%=h topic.view_count %></td>
|
||||
<td><%=h topic.cached_posts_count %></td>
|
||||
<td><%=h topic.cached_view_count %></td>
|
||||
<td>
|
||||
<%= link_to lastpost(topic) do %>
|
||||
<%=h topic.posts.last.user %><br>
|
||||
|
@ -48,4 +50,6 @@
|
|||
<% end %>
|
||||
</table>
|
||||
|
||||
<%= will_paginate @topics %>
|
||||
|
||||
<%= render partial: 'controls', locals: { forum: @forum } %>
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
<table class="data">
|
||||
<table id="matches" class="<%= 'contest' if contest %>">
|
||||
<tr>
|
||||
<% if contest %>
|
||||
<th width="20%">Contest</th>
|
||||
<th width="20%">Opponent</th>
|
||||
<th class="contest">Contest</th>
|
||||
<th class="opponent">Opponent</th>
|
||||
<% else %>
|
||||
<th width="30%">Opponent</th>
|
||||
<th class="opponent">Opponent</th>
|
||||
<% end %>
|
||||
<th width="20%">Date</th>
|
||||
<th class="date">Date</th>
|
||||
<% unless defined? exclude_maps %>
|
||||
<th width="20%">Maps</th>
|
||||
<th class="maps">Maps</th>
|
||||
<% end %>
|
||||
<th width="5%">Score</th>
|
||||
<th class="score">Score</th>
|
||||
<% if matches.first and matches.first.contest.contest_type == Contest::TYPE_LADDER %>
|
||||
<th width="5%">Points</th>
|
||||
<th class="points">Points</th>
|
||||
<% end %>
|
||||
</tr>
|
||||
|
||||
|
@ -35,21 +35,21 @@
|
|||
<%= match.map1 %>, <%= match.map2 %>
|
||||
</td>
|
||||
<% end %>
|
||||
<td>
|
||||
<td class="score">
|
||||
<%= 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 %>
|
||||
</td>
|
||||
<% if match.contest.contest_type == Contest::TYPE_LADDER %>
|
||||
<td>
|
||||
<% 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) %>
|
||||
</td>
|
||||
|
|
|
@ -9,10 +9,17 @@
|
|||
</div>
|
||||
|
||||
<% if post.user.team %>
|
||||
<%= namelink post.user.team %>
|
||||
<strong><%= namelink post.user.team %></strong>
|
||||
<% end %>
|
||||
|
||||
<%= cascade post.user, [["Posts", "posts.count"], "from", "joined"] %>
|
||||
<dl>
|
||||
<dt>Posts</dt>
|
||||
<dd><%= post.user.posts.count %></dd>
|
||||
<dt>Location</dt>
|
||||
<dd><%= post.user.from %></dd>
|
||||
<dt>Joined</dt>
|
||||
<dd><%= post.user.joined %></dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
|
|
|
@ -1,38 +1,30 @@
|
|||
<table class="data">
|
||||
<table id="members" class="<%= 'short' if !comment %>">
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th>Member</th>
|
||||
<% if cuser %>
|
||||
<th>Name</th>
|
||||
<% end %>
|
||||
<th>Age</th>
|
||||
<th>SteamID</th>
|
||||
<th>Rank</th>
|
||||
<th class="country"></th>
|
||||
<th class="member">Member</th>
|
||||
<th class="steamid">SteamID</th>
|
||||
<th class="rank">Rank</th>
|
||||
<% if comment %>
|
||||
<th>Comment</th>
|
||||
<th class="note">Comment</th>
|
||||
<% end %>
|
||||
<th>Joined</th>
|
||||
<th class="joined">Joined</th>
|
||||
</tr>
|
||||
<% teamers.each do |member| %>
|
||||
<% next if blacklist and blacklist.exists? :user_id => member.user_id %>
|
||||
<% next if blacklist and blacklist.exists? user_id: member.user_id %>
|
||||
<% next if member.user.nil? %>
|
||||
<tr class="<%= cycle('even', 'odd') %>">
|
||||
<tr>
|
||||
<td><%= flag member.user.country %></td>
|
||||
<td><%= namelink member.user %></td>
|
||||
<% if cuser %>
|
||||
<td><%= h member.user.realname %></td>
|
||||
<% end %>
|
||||
<td><%= h member.user.age %></td>
|
||||
<td><%= h member.user.steamid %></td>
|
||||
<td><%=h member.user.steamid %></td>
|
||||
<% if member.rank == Teamer::RANK_REMOVED %>
|
||||
<td>Ex-Member</td>
|
||||
<% else %>
|
||||
<td><%= member.ranks[member.rank] %></td>
|
||||
<% end %>
|
||||
<% if comment %>
|
||||
<td><%= h member.comment %></td>
|
||||
<td><%=h member.comment %></td>
|
||||
<% end %>
|
||||
<td><%= shortdate member.created_at %></td>
|
||||
<td class="joined"><%= shortdate member.created_at %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
|
|
@ -1,28 +1,34 @@
|
|||
<table class="data">
|
||||
<table>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Name</th>
|
||||
<th>Irc</th>
|
||||
<th>Members</th>
|
||||
<th class="country"></th>
|
||||
<th class="name">Name</th>
|
||||
<th class="irc">IRC</th>
|
||||
<th class="members">Members</th>
|
||||
<% if cuser and cuser.admin? %>
|
||||
<th>Options</th>
|
||||
<th class="actions"></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
|
||||
<% for team in teams %>
|
||||
<% if team.teamers_num > 0 %>
|
||||
<tr class="<%= cycle('even', 'odd') %>">
|
||||
<tr>
|
||||
<td><%= flag team.country %></td>
|
||||
<td><%= namelink team %></td>
|
||||
<td><%= h team.irc[0,15] if team.irc %></td>
|
||||
<td><%= h team.irc if team.irc %></td>
|
||||
<td><%= h team.teamers_num %></td>
|
||||
<% if cuser and cuser.admin? %>
|
||||
<td>
|
||||
<%= link_to 'Edit', edit_team_path(team) %>
|
||||
<td class="actions">
|
||||
<%= 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 %>
|
||||
</td>
|
||||
<% end %>
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<h1>Listing teams</h1> <h4>Teams with 0 members are not displayed.</h4>
|
||||
<h1>Listing teams</h1>
|
||||
<p>Teams with no current members are not displayed.</p>
|
||||
|
||||
<div id="box">
|
||||
<%= render :partial => "list", :locals => {:teams => @teams} %>
|
||||
<div id="teams">
|
||||
<%= render partial: 'list', locals: { teams: @teams } %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var tabber1 = new Yetii({id: 'teamsTab'});
|
||||
new Yetii({id: 'teamsTab'});
|
||||
</script>
|
||||
|
|
|
@ -1,108 +1,89 @@
|
|||
<h1 class="center">
|
||||
<%= h @team.name %>
|
||||
</h1>
|
||||
<div id="team-profile">
|
||||
<h1 class="fancy">
|
||||
<span><%=h @team.name %></span>
|
||||
</h1>
|
||||
|
||||
<% if @team.logo %>
|
||||
<%= image_tag @team.logo.url, :class => "centered" %>
|
||||
<% end %>
|
||||
|
||||
<br />
|
||||
|
||||
<div id="teamTab">
|
||||
<ul id="teamTab-nav" class="tabs">
|
||||
<li><a href="#general">General</a></li>
|
||||
<li><a href="#members">Members</a></li>
|
||||
<li><a href="#matches">Matches</a></li>
|
||||
<li><a href="#statistics">Statistics</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="box wide tabs">
|
||||
<div class="tab" id="general">
|
||||
<table class="split">
|
||||
<tr>
|
||||
<th>Irc:</th>
|
||||
<td><%= h @team.irc %></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Web:</th>
|
||||
<td><%= h @team.web %></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Tag:</th>
|
||||
<td><%= h @team.tag %></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Country:</th>
|
||||
<td><%= h @team.country %></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Founder:</th>
|
||||
<td><%= namelink @team.founder %></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Comment:</th>
|
||||
<td><%= h @team.comment %></td>
|
||||
</tr>
|
||||
|
||||
<% if @team.recruiting %>
|
||||
<tr>
|
||||
<th>Recruiting:</th>
|
||||
<td><%= h @team.recruiting %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<p class="center">
|
||||
<%= link_to "Send a message", :controller => "messages", :action => "new", :id => "Team", :id2 => @team %>
|
||||
</p>
|
||||
<% if @team.logo %>
|
||||
<div class="logo">
|
||||
<%= image_tag @team.logo.url, class: 'logo' %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="tab" id="members">
|
||||
<h3 class="center">
|
||||
Current Members
|
||||
</h3>
|
||||
<div id="team" class="tabbed">
|
||||
<ul id="team-nav" class="tabs">
|
||||
<li><a href="#general">General</a></li>
|
||||
<li><a href="#members">Members</a></li>
|
||||
<li><a href="#matches">Matches</a></li>
|
||||
<li><a href="#statistics">Statistics</a></li>
|
||||
</ul>
|
||||
|
||||
<%= render :partial => "teamers/list", :locals => {:teamers => @team.teamers.active.ordered.distinct, :blacklist => false, :comment => true } %>
|
||||
<div class="tabbed-contents">
|
||||
<div class="tab" id="general">
|
||||
<dl>
|
||||
<dt>Irc:</dt>
|
||||
<dd><%= h @team.irc %></dd>
|
||||
<dt>Web:</dt>
|
||||
<dd><%= h @team.web %></dd>
|
||||
<dt>Tag:</dt>
|
||||
<dd><%= h @team.tag %></dd>
|
||||
<dt>Country:</dt>
|
||||
<dd><%= h @team.country %></dd>
|
||||
<dt>Founder:</dt>
|
||||
<dd><%= namelink @team.founder %></dd>
|
||||
<dt>Comment:</dt>
|
||||
<dd><%= h @team.comment %></dd>
|
||||
<% if @team.recruiting %>
|
||||
<dt>Recruiting:</dt>
|
||||
<dd><%= h @team.recruiting %></dd>
|
||||
<% end %>
|
||||
</dl>
|
||||
|
||||
<h3 class="center">
|
||||
Past Members
|
||||
</h3>
|
||||
<%= link_to "Send a message", { controller: "messages", action: "new", id: "Team", id2: @team }, { class: 'button tiny' } %>
|
||||
</div>
|
||||
|
||||
<%= render :partial => "teamers/list", :locals => {:teamers => @team.teamers.past.distinct, :blacklist => @team.teamers.active.ordered.distinct, :comment => false} %>
|
||||
</div>
|
||||
<div class="tab" id="members">
|
||||
<h3>Current Members</h3>
|
||||
<%= render partial: "teamers/list", locals: { teamers: @team.teamers.active.ordered.distinct, blacklist: false, comment: true } %>
|
||||
|
||||
<div class="tab" id="matches">
|
||||
<% @team.contesters.chronological.each do |contester| %>
|
||||
<% next if Match.finished.ordered.of_contester(contester).count == 0 %>
|
||||
<h3>
|
||||
<%= link_to contester.contest, contester.contest, :name => "contest_#{contester.contest.id}" %>
|
||||
</h3>
|
||||
<h3>Past Members</h3>
|
||||
<%= render partial: "teamers/list", locals: { teamers: @team.teamers.past.distinct, blacklist: @team.teamers.active.ordered.distinct, comment: false } %>
|
||||
</div>
|
||||
|
||||
<%= render :partial => "matches/list",
|
||||
:locals => {:matches => Match.finished.ordered.of_contester(contester), :friendly => contester.team, :contest => false} %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="tab" id="matches">
|
||||
<% @team.contesters.chronological.each do |contester| %>
|
||||
<% next if Match.finished.ordered.of_contester(contester).count == 0 %>
|
||||
<h3>
|
||||
<%= link_to contester.contest, contester.contest, :name => "contest_#{contester.contest.id}" %>
|
||||
</h3>
|
||||
<%= render partial: "matches/list", locals: { matches: Match.finished.ordered.of_contester(contester), friendly: contester.team, contest: false } %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="tab" id="matches">
|
||||
<p>
|
||||
<b>Matches:</b> <%= @team.matches_finished.count %> played / <%= @team.matches.count %> total<br />
|
||||
- <b>Won:</b> <%= @team.matches_won.count %> (<%= 100.0*@team.matches_won.count/@team.matches_finished.count %> %) <br />
|
||||
- <b>Lost:</b> <%= @team.matches_lost.count %> (<%= 100.0*@team.matches_lost.count/@team.matches_finished.count %> %) <br />
|
||||
- <b>Draw:</b> <%= @team.matches_draw.count %> (<%= 100.0*@team.matches_draw.count/@team.matches_finished.count %> %) <br />
|
||||
</p>
|
||||
<div class="tab" id="matches">
|
||||
<dl>
|
||||
<dt>Matches:</dt>
|
||||
<dd><%= @team.matches_finished.count %> dllayed / <%= @team.matches.count %> total</dd>
|
||||
<dt>Won:</dt>
|
||||
<dd><%= @team.matches_won.count %> (<%= 100.0*@team.matches_won.count/@team.matches_finished.count %> %)</dd>
|
||||
<dt>Lost:</dt>
|
||||
<dd><%= @team.matches_lost.count %> (<%= 100.0*@team.matches_lost.count/@team.matches_finished.count %> %)</dd>
|
||||
<dt>Draw:</dt>
|
||||
<dd><%= @team.matches_draw.count %> (<%= 100.0*@team.matches_draw.count/@team.matches_finished.count %> %)</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
new Yetii({
|
||||
id: 'team',
|
||||
active: 2
|
||||
});
|
||||
</script>
|
||||
|
||||
<% if cuser and @team.can_update? cuser %>
|
||||
<div class="controls">
|
||||
<%= link_to 'Edit Team', edit_team_path(@team), class: 'button' %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var tabber1 = new Yetii({id: 'teamTab', active: 2});
|
||||
</script>
|
||||
|
||||
<% if cuser and @team.can_update? cuser %>
|
||||
<%= link_to 'Edit', edit_team_path(@team) %>
|
||||
<% end %>
|
||||
|
|
|
@ -22,9 +22,13 @@
|
|||
<% end %>
|
||||
|
||||
<% if @newpost.errors.count > 0 %>
|
||||
<% @newpost.error_messages.each do |m| %>
|
||||
<%= h m %><br>
|
||||
<% end %>
|
||||
<div class="flash warning">
|
||||
<ul>
|
||||
<% @newpost.error_messages.each do |m| %>
|
||||
<li><%= h m %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
@ -46,7 +50,7 @@
|
|||
|
||||
<%= will_paginate @posts %>
|
||||
|
||||
<div class="right minitext">
|
||||
<div>
|
||||
<% 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' %>
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
<%= form_for @user, :html => { :multipart => true } do |f| %>
|
||||
<% f.fields_for :profile do |p| %>
|
||||
<div id="userTab">
|
||||
<ul id="userTab-nav" class="tabs">
|
||||
<div id="user" class="tabbed">
|
||||
<ul id="user-nav" class="tabs">
|
||||
<li><a href="#userTabGeneral">General</a></li>
|
||||
<li><a href="#userTabContact">Contact</a></li>
|
||||
<li><a href="#userTabCountry"><%= t('profile.locals') %></a></li>
|
||||
|
@ -14,7 +14,7 @@
|
|||
<li><a href="#notifications">Notify</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="box wide tabs">
|
||||
<div class="tabbed-contents">
|
||||
<div class="tab" id="userTabGeneral">
|
||||
<% if @user.errors.any? %>
|
||||
<div id="error_explanation">
|
||||
|
@ -286,5 +286,7 @@
|
|||
<% end %>
|
||||
|
||||
<script type="text/javascript">
|
||||
var tabber1 = new Yetii({id: 'userTab'});
|
||||
new Yetii({
|
||||
id: 'user'
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -1,55 +1,47 @@
|
|||
<h1>Listing users</h1>
|
||||
<h1>Listing Users</h1>
|
||||
|
||||
<%= 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] %>
|
||||
<p>
|
||||
<div class="fields query">
|
||||
<%= text_field_tag :search, params[:search] %>
|
||||
<%= submit_tag "Search", :name => nil %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<%= submit_tag "Search", name: nil %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<table id="usersTable" class="data">
|
||||
<table id="users">
|
||||
<tr>
|
||||
<th>
|
||||
Country
|
||||
</th>
|
||||
<th>
|
||||
Username
|
||||
</th>
|
||||
<th>
|
||||
Real name
|
||||
</th>
|
||||
<th>
|
||||
Steam ID
|
||||
</th>
|
||||
<th>
|
||||
Age
|
||||
</th>
|
||||
<th class="country"></th>
|
||||
<th class="username">Username</th>
|
||||
<th class="name">Name</th>
|
||||
<th class="steamid">Steam ID</th>
|
||||
<th class="age">Age</th>
|
||||
<% if cuser and cuser.admin? %>
|
||||
<th>
|
||||
Options
|
||||
</th>
|
||||
<th class="actions"></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
|
||||
<% @users.each do |user| %>
|
||||
<tr class="<%= cycle('even', 'odd') %>">
|
||||
<tr>
|
||||
<td><%= flag user.country %></td>
|
||||
<td><%= link_to (h user.username), user %></td>
|
||||
<td><%= h user.firstname %> <%=h user.lastname %></td>
|
||||
<td><%= h user.steamid %></td>
|
||||
<td><%= user.age %></td>
|
||||
<% if cuser and cuser.admin? %>
|
||||
<td>
|
||||
<%= link_to 'Edit', edit_user_path(user) %>
|
||||
<%= link_to 'Delete', user, :confirm => "Proceed to delete?", :method => :delete %>
|
||||
<td class="actions">
|
||||
<%= 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 %>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
<%= will_paginate @users %>
|
||||
</p>
|
||||
<%= will_paginate @users %>
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -1 +0,0 @@
|
|||
Ensl::Application.config.secret_token = ENV['APP_SECRET']
|
|
@ -1,4 +0,0 @@
|
|||
Ensl::Application.config.session_store :active_record_store,
|
||||
:key => '_ENSL_session_key',
|
||||
:expire_after => 30.days.to_i
|
||||
|
Loading…
Reference in a new issue