mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-25 12:01:03 +00:00
Improves gathers and article pages/forms styling
This commit is contained in:
parent
38c22734d5
commit
59bb60da9f
9 changed files with 211 additions and 144 deletions
|
@ -102,27 +102,40 @@
|
|||
|
||||
#gather-area {
|
||||
@include span-columns(12);
|
||||
margin-top: em(20);
|
||||
|
||||
$column-border-width: em(15);
|
||||
$column-border-radius: em(5);
|
||||
|
||||
.gather-columns {
|
||||
@include span-columns(12);
|
||||
@include row(table);
|
||||
margin-bottom: em(20);
|
||||
margin-left: - $column-border-width;
|
||||
width: $max-width - ($column-border-width*2);
|
||||
}
|
||||
|
||||
.data {
|
||||
@include span-columns(4);
|
||||
@include pad;
|
||||
border-radius: $column-border-width + $column-border-radius;
|
||||
overflow-y: scroll;
|
||||
padding-bottom: em(20);
|
||||
background: $light-gray;
|
||||
padding: em(20);
|
||||
border: $column-border-width solid white;
|
||||
|
||||
h4 {
|
||||
padding-bottom: em(20);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&:nth-child(3) {
|
||||
@include reset-display;
|
||||
@include omega;
|
||||
}
|
||||
|
||||
ul {
|
||||
margin-bottom: em(10);
|
||||
|
||||
li {
|
||||
margin-bottom: em(5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -142,6 +155,8 @@
|
|||
|
||||
#gather-stats {
|
||||
@include span-columns(12);
|
||||
display: block;
|
||||
clear: both;
|
||||
padding: em(20) 0;
|
||||
margin: em(20) 0;
|
||||
border-top: em(2) solid $light-gray;
|
||||
|
@ -154,6 +169,10 @@
|
|||
margin: 0;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
p {
|
||||
@include clearfix;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -99,4 +99,41 @@ form.article {
|
|||
margin-bottom: em(20);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Articles Page
|
||||
*/
|
||||
|
||||
#articles {
|
||||
@include span-columns(12);
|
||||
|
||||
h3 {
|
||||
@include span-columns(12);
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.article-list {
|
||||
@include span-columns(12);
|
||||
margin-bottom: em(10);
|
||||
|
||||
.new {
|
||||
@extend .highlight;
|
||||
margin-right: em(10);
|
||||
}
|
||||
|
||||
.title {
|
||||
@include span-columns(6);
|
||||
}
|
||||
|
||||
.meta {
|
||||
@include span-columns(6);
|
||||
@include omega;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
.button.new {
|
||||
margin-top: em(20);
|
||||
}
|
||||
}
|
|
@ -1,26 +1,34 @@
|
|||
<h1>Articles</h1>
|
||||
<div id="articles">
|
||||
<h1>Articles</h1>
|
||||
|
||||
<% @categories.each do |category| %>
|
||||
<h3>
|
||||
<%= category.name %>
|
||||
</h3>
|
||||
<% @categories.each do |category| %>
|
||||
<h3 class="title"><%= category.name %></h3>
|
||||
|
||||
<% category.articles.nodrafts.ordered.each do |article| %>
|
||||
<div class="indented">
|
||||
<div class="left">
|
||||
<% if cuser and !article.read_by? cuser %>
|
||||
<span class="red bold">NEW</span>
|
||||
<% end %>
|
||||
<%= namelink article %>
|
||||
</div>
|
||||
<div class="right">
|
||||
(<%= namelink article.user %> on <%= longdate article.created_at %>)
|
||||
</div>
|
||||
<br class="clear" />
|
||||
<div class="category">
|
||||
<% category.articles.nodrafts.ordered.each do |article| %>
|
||||
<div class="article-list">
|
||||
<div class="title">
|
||||
<% if cuser and !article.read_by? cuser %>
|
||||
<span class="new">NEW</span>
|
||||
<% end %>
|
||||
|
||||
<%= namelink article %>
|
||||
</div>
|
||||
<div class="meta">
|
||||
<span class="author">
|
||||
<%= namelink article.user %>
|
||||
</span>
|
||||
<span class="date">
|
||||
on <%= longdate article.created_at %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if Article.new.can_create? cuser %>
|
||||
<%= link_to 'New Article', new_article_path, class: 'button' %>
|
||||
<% end %>
|
||||
<% if Article.new.can_create? cuser %>
|
||||
<%= link_to 'New Article', new_article_path, class: 'button new' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
@ -1,13 +1,15 @@
|
|||
<div class="data players">
|
||||
<%= render partial: "gatherers/list", locals: { team: nil } %>
|
||||
</div>
|
||||
<div class="gather-columns">
|
||||
<div class="data players">
|
||||
<%= render partial: "gatherers/list", locals: { team: nil } %>
|
||||
</div>
|
||||
|
||||
<div class="data players">
|
||||
<%= render partial: "gatherers/list", locals: { team: 1 } %>
|
||||
</div>
|
||||
<div class="data players">
|
||||
<%= render partial: "gatherers/list", locals: { team: 1 } %>
|
||||
</div>
|
||||
|
||||
<div class="data players">
|
||||
<%= render partial: "gatherers/list", locals: { team: 2 } %>
|
||||
<div class="data players">
|
||||
<%= render partial: "gatherers/list", locals: { team: 2 } %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render partial: "status" %>
|
||||
|
|
|
@ -1,21 +1,25 @@
|
|||
<div class="data players">
|
||||
<h4>Signed Up</h4>
|
||||
<div class="gather-columns">
|
||||
<div class="data players">
|
||||
<h4>Signed Up</h4>
|
||||
|
||||
|
||||
<ul id="gatherers">
|
||||
<% @gather.gatherers.each do |gatherer| %>
|
||||
<li>
|
||||
<%= flag gatherer.user.country %>
|
||||
<%= namelink gatherer.user %>
|
||||
<% if cuser and cuser.admin? %>
|
||||
<%= link_to gatherer, method: :delete, class: 'delete' do %>
|
||||
<%= icon 'times' %>
|
||||
<ul id="gatherers">
|
||||
<% @gather.gatherers.each do |gatherer| %>
|
||||
<li>
|
||||
<%= flag gatherer.user.country %>
|
||||
<%= namelink gatherer.user %>
|
||||
<% if cuser and cuser.admin? %>
|
||||
<%= link_to gatherer, method: :delete, class: 'delete' do %>
|
||||
<%= icon 'times' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<%= render partial: 'votes' %>
|
||||
</div>
|
||||
|
||||
<%= render partial: 'votes' %>
|
||||
<%= render partial: 'status' %>
|
||||
|
|
@ -48,18 +48,22 @@
|
|||
</p>
|
||||
|
||||
<% elsif @gather.status == Gather::STATE_FINISHED and @gather.server %>
|
||||
Gather finished, join the
|
||||
<% if @gather.server and @gather.server.ip and @gather.server.password %>
|
||||
<%= link_to "Server", "steam://run/4920//connect #{@gather.server.ip} #{@gather.server.password}" %>
|
||||
<% else %>
|
||||
Server
|
||||
<% end %>
|
||||
and TS3. <br>
|
||||
<p>Gather finished, join the Server and TeamSpeak 3.</p>
|
||||
|
||||
Maps: <%= namelink @gather.map1.map if @gather.map1 %>, <%= (namelink @gather.map2.map) if @gather.map2 %> <br>
|
||||
Server: <% if @gather.server %>
|
||||
<%= @gather.server %>
|
||||
(<%= @gather.server.ip %>:<%= @gather.server.port %> ; password = <%= if @gather.server.password then @gather.server.password else "<Password not specified>" end %>)
|
||||
<p>
|
||||
<strong>Maps</strong>: <%= namelink @gather.map1.map if @gather.map1 %>, <%= (namelink @gather.map2.map) if @gather.map2 %> <br>
|
||||
<strong>Server</strong>:
|
||||
<% if @gather.server %>
|
||||
<%= @gather.server %>
|
||||
(<%= @gather.server.ip %>:<%= @gather.server.port %> ;
|
||||
password = <%= if @gather.server.password then @gather.server.password else "<Password not specified>" end %>)
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<% if @gather.server and @gather.server.ip and @gather.server.password %>
|
||||
<p>
|
||||
<%= link_to "Click to join Server", "steam://run/4920//connect #{@gather.server.ip} #{@gather.server.password}", class: 'join button tiny' %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -1,29 +1,32 @@
|
|||
<div class="data">
|
||||
<h4>Vote Captains</h4>
|
||||
<div class="gather-columns">
|
||||
<div class="data">
|
||||
<h4>Vote Captains</h4>
|
||||
|
||||
<table id="gatherers">
|
||||
<% @gather.gatherers.most_voted.each do |gatherer| %>
|
||||
<tr>
|
||||
<td><%= flag gatherer.user.country %></td>
|
||||
<td>
|
||||
(<%= gatherer.votes %>)
|
||||
<% if @gatherer and gatherer.real_votes.build(user: cuser).can_create? cuser %>
|
||||
<%= link_to (h gatherer.user),
|
||||
controller: "votes", action: "create",
|
||||
vote: { votable_id: gatherer.id, votable_type: "Gatherer"},
|
||||
method: "post" %>
|
||||
<% else %>
|
||||
<%= namelink gatherer.user %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<table id="gatherers">
|
||||
<% @gather.gatherers.most_voted.each do |gatherer| %>
|
||||
<tr>
|
||||
<td><%= flag gatherer.user.country %></td>
|
||||
<td>
|
||||
(<%= gatherer.votes %>)
|
||||
<% if @gatherer and gatherer.real_votes.build(user: cuser).can_create? cuser %>
|
||||
<%= link_to (h gatherer.user),
|
||||
controller: "votes", action: "create",
|
||||
vote: { votable_id: gatherer.id, votable_type: "Gatherer"},
|
||||
method: "post" %>
|
||||
<% else %>
|
||||
<%= namelink gatherer.user %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<% if @gatherer %>
|
||||
<p>Click to vote for captain.</p>
|
||||
<% end %>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<% if @gatherer %>
|
||||
<p>Click to vote for captain.</p>
|
||||
<% end %>
|
||||
<%= render partial: 'votes' %>
|
||||
</div>
|
||||
|
||||
<%= render partial: 'votes' %>
|
||||
<%= render partial: 'status' %>
|
||||
|
|
|
@ -1,84 +1,73 @@
|
|||
<h1>
|
||||
Gather admin page for gather #<%= @gather.id %>
|
||||
</h1>
|
||||
<h1>Gather Admin: #<%= @gather.id %></h1>
|
||||
|
||||
<div class="wide box">
|
||||
<h3>
|
||||
Gather Restart
|
||||
</h3>
|
||||
<%= form_for(@gather) do |f| %>
|
||||
<ul>
|
||||
<% @gather.errors.full_messages.each do |msg| %>
|
||||
<li><%= msg %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div class="restart">
|
||||
<h3>Restart Gather</h3>
|
||||
|
||||
<%= form_for(@gather, html: { class: 'square' }) do |f| %>
|
||||
<%= render 'shared/errors', messages: @gather.errors.full_messages %>
|
||||
|
||||
<%= f.hidden_field :admin %>
|
||||
<p>
|
||||
<%= f.label :captain1 %><br />
|
||||
|
||||
<div class="fields horizontal">
|
||||
<%= f.label :captain1 %>
|
||||
<%= f.select :captain1_id, @gather.gatherers.collect{|c| [c, c.id]} %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.label :captain2 %><br />
|
||||
</div>
|
||||
<div class="fields horizontal">
|
||||
<%= f.label :captain2 %>
|
||||
<%= f.select :captain2_id, @gather.gatherers.collect{|c| [c, c.id]} %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.submit 'Restart gather' %>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="controls">
|
||||
<%= f.submit 'Restart Gather' %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="wide box">
|
||||
<h3>
|
||||
Turn change
|
||||
</h3>
|
||||
<%= form_for(@gather) do |f| %>
|
||||
<ul>
|
||||
<% @gather.errors.full_messages.each do |msg| %>
|
||||
<li><%= msg %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<p>
|
||||
<%= f.label :turn %><br />
|
||||
<%= f.select :turn, ['1', '2'] %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.submit 'Change turn' %>
|
||||
</p>
|
||||
<div class="turns">
|
||||
<h3>Change Turns</h3>
|
||||
|
||||
<%= form_for(@gather, html: { class: 'square' }) do |f| %>
|
||||
<%= render 'shared/errors', messages: @gather.errors.full_messages %>
|
||||
|
||||
<div class="fields horizontal">
|
||||
<%= f.label :turn %>
|
||||
<%= f.select :turn, ['Team 1', 'Team 2'] %>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<%= f.submit 'Change Turn' %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="wide box">
|
||||
<h3>
|
||||
Replace players
|
||||
</h3>
|
||||
<div class="replace">
|
||||
<h3>Replace Players</h3>
|
||||
|
||||
<% if @gather.gatherers.first %>
|
||||
<%= form_for(@gather.gatherers.first) do |f| %>
|
||||
<p>
|
||||
Select player: <br />
|
||||
<%= form_for(@gather.gatherers.first, html: { class: 'square' }) do |f| %>
|
||||
<div class="fields horizontal">
|
||||
<%= f.label :id, "Select Player" %>
|
||||
<%= f.select :id, @gather.gatherers.collect{|g| [g.user, g.id]} %>
|
||||
</p>
|
||||
<p>
|
||||
Replace with <%= link_to_function 'user', "findUser('username')" %>:
|
||||
</div>
|
||||
<div class="fields horizontal">
|
||||
<%= f.label :username, "Replace with:" %>
|
||||
<%= f.text_field :username %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.submit 'Replace player' %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<%= f.submit 'Replace Player' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="wide box">
|
||||
<h3>
|
||||
Start new
|
||||
</h3>
|
||||
<%= form_for(Gather.new) do |f| %>
|
||||
<div class="restart">
|
||||
<h3>Start New</h3>
|
||||
<%= form_for Gather.new do |f| %>
|
||||
<% f.object.category = @gather.category %>
|
||||
<%= f.hidden_field :category_id %>
|
||||
<p>
|
||||
<%= f.submit "Start next (#{f.object.category})" %>
|
||||
</p>
|
||||
|
||||
<div class="controls">
|
||||
<%= f.submit "Start New Gather (#{f.object.category})" %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -20,6 +20,7 @@ en:
|
|||
contests_contester_update: "Contester was successfully updated."
|
||||
gather_create: "New Gather was started successfully."
|
||||
gathers_join: "You have joined the Gather."
|
||||
gatherers_update: "Gather player successfully updated."
|
||||
files_create: "File was successfully created."
|
||||
files_update: "File was successfully updated."
|
||||
directories_create: "Directory was successfully created."
|
||||
|
|
Loading…
Reference in a new issue