Added styling to servers pages

This commit is contained in:
Luke Barratt 2014-04-26 01:20:34 +01:00
parent ac0b47eca9
commit 38c22734d5
13 changed files with 153 additions and 173 deletions

View file

@ -55,3 +55,5 @@
@import "pages/matches";
@import "pages/files";
@import "pages/bans";
@import "pages/servers";

View file

@ -106,7 +106,6 @@
.data {
@include span-columns(4);
max-height: em(400);
overflow-y: scroll;
padding-bottom: em(20);

View file

@ -0,0 +1,51 @@
/*
Servers
*/
#servers {
@include span-columns(12);
margin-bottom: em(20);
div.server {
@include span-columns(12);
margin-bottom: em(20);
padding-bottom: em(20);
border-bottom: em(3) solid $light-gray;
position: relative;
.connect {
position: absolute;
top: 0;
right: 0;
margin: 0;
}
&:last-child {
margin-bottom: 0;
border-bottom: 0;
}
}
}
/*
Server Form
*/
form.server {
.inputs {
@include span-columns(12);
input {
max-width: 100%;
}
.ip {
@include span-columns(9);
}
.port {
@include span-columns(3);
}
}
}

View file

@ -87,6 +87,10 @@
}
}
.achievements {
margin-bottom: em(20);
}
tbody td {
&:first-child,
&:nth-child(2) {

View file

@ -32,7 +32,6 @@ module Extra
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)
@ -46,7 +45,6 @@ module Extra
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)

View file

@ -1,52 +1,52 @@
<div class="box wide">
<%= form_for @server do |f| %>
<%= form_for @server, html: { class: 'server square' } do |f| %>
<%= f.error_messages %>
<div class="left equal">
<p>
<%= f.label :dns %><br />
<div class="fields horizontal">
<%= f.label :dns %>
<%= f.text_field :dns %>
</p>
<p>
<%= f.label :ip %> :
<%= f.label :port %><br />
<%= f.text_field :ip, :size => 15 %>
<%= f.text_field :port, :size => 5 %>
</p>
<p>
<%= f.label :rcon %><br />
<%= f.text_field :rcon %>
</p>
<p>
<%= f.label :password %><br />
<%= f.text_field :password %>
</p>
</div>
<div class="right equal">
<p>
<%= f.label :name %><br />
<div class="fields horizontal">
<%= f.label :ip, "IP:Port" %>
<div class="inputs">
<div class="ip">
<%= f.text_field :ip %>
</div>
<div class="port">
<%= f.text_field :port %>
</div>
</div>
</div>
<div class="fields horizontal">
<%= f.label :rcon %>
<%= f.text_field :rcon %>
</div>
<div class="fields horizontal">
<%= f.label :password %>
<%= f.text_field :password %>
</div>
<div class="fields horizontal">
<%= f.label :name %>
<%= f.text_field :name %>
</p>
<p>
<%= f.label :description %><br />
</div>
<div class="fields horizontal">
<%= f.label :description %>
<%= f.text_field :description %>
</p>
<p>
<%= f.label :irc %><br />
</div>
<div class="fields horizontal">
<%= f.label :irc %>
<%= f.text_field :irc %>
</p>
<p>
<%= f.label :domain %><br />
</div>
<div class="fields horizontal">
<%= f.label :domain %>
<%= f.select :domain, @server.domains.invert %>
</p>
<p>
<%= f.label :official, "Available for ENSL officials?" %><br />
</div>
<div class="fields horizontal">
<%= f.label :official, "Available for officials?" %>
<%= f.check_box :official %>
</p>
<%= f.label :official, class: 'checkbox' %>
</div>
<p class="clear">
<div class="controls">
<%= f.submit 'Save' %>
</p>
<% end %>
</div>
</div>
<% end %>

View file

@ -1,48 +1,12 @@
<div class="wide sub box">
<div class="small2 left">
<h3 class="center">
<%= namelink server %>
</h3>
<% if m = Map.find_by_name(server.map) and m.picture %>
<%= image_tag m.picture.url, :width => 140, :height => 90, :class => "centered" %>
<% else %>
<b>Description: </b><%= server.description %>
<% end %>
</div>
<div class="small2 left">
<h3 class="center">
Details
</h3>
<div class="server">
<h3><%= namelink server %></h3>
<p>
<b>IP:</b>
<strong>IP:</strong>
<%= h server.ip %>:<%= h server.port %>
</p>
<%= cascade server, ["dns", "password", "irc", ["Owner", :user]] %>
<% if server.domain == Server::DOMAIN_HLDS or server.domain == Server::DOMAIN_HLTV %>
<%= link_to "Click to connect", "steam://connect/#{server.addr}" %>
<% else %>
<%= link_to "Click to connect", "steam://run/4920//connect #{server.ip} #{server.password}" %>
<% end %>
</div>
<div class="small2 left">
<h3 class="center">
Stats
</h3>
<% if server.domain == Server::DOMAIN_HLDS or server.reservation %>
<%= cascade server, ["ping", "map", "players_s", "recording_s", ["Connected to", "reservation_s"]] %>
<% end %>
</div>
<div class="clear center">
<% if cuser and server.can_update? cuser %>
<%= link_to "Edit", edit_server_path(server) %>
<% end %>
</div>
<%= cascade server, ["dns", "password"] %>
<%= link_to "Click to Connect", "steam://run/4920//connect #{server.ip} #{server.password}", class: 'connect button tiny' %>
</div>

View file

@ -1,6 +1,3 @@
<h1>Editing server</h1>
<h1>Editing Server</h1>
<%= render :partial => 'form' %>
<%= link_to 'Show', @server %> |
<%= link_to 'Back', servers_path %>
<%= render partial: 'form' %>

View file

@ -1,35 +1,30 @@
<h1>
Listing servers
</h1>
<h1 class="title">Listing Servers</h1>
<div id="serversTab">
<ul id="serversTab-nav" class="tabs">
<div id="servers" class="tabbed">
<ul id="servers-nav" class="tabs">
<li><a href="#officials">ENSL NS2 Servers</a></li>
<li><a href="#ns2">All NS2 Servers</a></li>
<li><a href="#ns2">NS2 Servers</a></li>
<li><a href="#ns1">NS1 Servers</a></li>
<li><a href="#hltvs">HLTVs</a></li>
</ul>
<div class="box wide tabs">
<div class="tabbed-contents">
<div class="tab" id="officials">
<%= render :partial => "server", :collection => @officials %>
<%= render partial: "server", collection: @officials %>
</div>
<div class="tab" id="ns2">
<%= render :partial => "server", :collection => @ns2 %>
<%= render partial: "server", collection: @ns2 %>
</div>
<div class="tab" id="ns1">
<%= render :partial => "server", :collection => @servers %>
</div>
<div class="tab" id="hltvs">
<%= render :partial => "server", :collection => @hltvs %>
<%= render partial: "server", collection: @servers %>
</div>
</div>
</div>
<script type="text/javascript">
var tabber1 = new Yetii({id: 'serversTab'});
var tabber1 = new Yetii({
id: 'servers'
});
</script>
<%= link_to 'New server', new_server_path %>
<%= link_to 'New server', new_server_path, class: 'button' %>

View file

@ -1,5 +1,3 @@
<h1>New server</h1>
<h1>New Server</h1>
<%= render :partial => 'form' %>
<%= link_to 'Back', servers_path %>
<%= render partial: 'form' %>

View file

@ -1,55 +1,23 @@
<h1>
Server: <%= h @server.name %>
<h1 class="fancy">
<span><%= h @server.name %></span>
</h1>
<div class="big2 left center">
<%= image_tag "servers/#{@server.id}.png", :width => 350, :height => 227, :class => "centered" %>
</div>
<div class="left">
<% if @server.map %>
<%= image_tag "maps/" + @server.map + ".gif", :width => 150, :height => 100, :class => "centered" %>
<% end %>
<h3 class="center">
<%= h @server.name %><br />
</h3>
<p>
<b>IP:</b>
<%= link_to @server.addr, "steam://connect/#{@server.addr}" %>
</p>
<%= cascade @server, ["dns", "password", "irc", ["Owner", :user], "description"] %>
</div>
<div class="clear"></div>
<h3 class="center">
Reservations
</h3>
<table class="data">
<tr>
<th>Teams</th>
<th>Time</th>
</tr>
<% @server.matches.order("id DESC").limit(10).each do |match| %>
<tr>
<td><%= link_to match, match %></td>
<td><%= longtime match.match_time %></td>
</tr>
<% end %>
</table>
<% if @server.can_update? cuser %>
<%= link_to 'Edit', edit_server_path(@server) %> |
<%= link_to 'Admin', :action => "admin", :id => @server %> |
<% if @server.domain == Server::DOMAIN_HLTV %>
<%= link_to 'Default Record', :action => "default", :id => @server %> |
<% end %>
<% if map = Map.find_by_name(@server.map) and map.picture.length > 0 %>
<div class="preview">
<%= image_tag map.picture %>
</div>
<% end %>
<%= link_to 'Back', servers_path %>
<p>
<strong>IP:</strong>
<%= link_to @server.addr, "steam://connect/#{@server.addr}" %>
</p>
<%= cascade @server, ["dns", "password", "irc", ["Owner", :user], "description"] %>
<% if @server.can_update? cuser %>
<%= link_to 'Edit Server', edit_server_path(@server), class: 'button' %>
<% if @server.domain == Server::DOMAIN_HLTV %>
<%= link_to 'Default Record', action: "default", id: @server, class: 'button' %>
<% end %>
<% end %>

View file

@ -42,8 +42,10 @@
</div>
<div class="tab" id="members">
<% if @team.teamers.active.ordered.distinct.length > 0 %>
<h3>Current Members</h3>
<%= render partial: "teamers/list", locals: { teamers: @team.teamers.active.ordered.distinct, blacklist: false, comment: true } %>
<% end %>
<% if @team.teamers.past.distinct.length > 0 %>
<h3>Past Members</h3>

View file

@ -42,7 +42,9 @@
<% if @user.profile.achievements and !@user.profile.achievements.empty? %>
<h4>Achievements</h4>
<div class="achievements">
<%= @user.profile.achievements_parsed.html_safe %>
</div>
<% end %>
<%= link_to "Send PM", { controller: "messages", action: "new", id: "User", id2: @user }, { class: 'button tiny' } %>