diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index fd99511..53b1a84 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -55,3 +55,5 @@ @import "pages/matches"; @import "pages/files"; @import "pages/bans"; +@import "pages/servers"; + diff --git a/app/assets/stylesheets/components/_gather.scss b/app/assets/stylesheets/components/_gather.scss index 952d4ab..1422a42 100644 --- a/app/assets/stylesheets/components/_gather.scss +++ b/app/assets/stylesheets/components/_gather.scss @@ -106,7 +106,6 @@ .data { @include span-columns(4); - max-height: em(400); overflow-y: scroll; padding-bottom: em(20); diff --git a/app/assets/stylesheets/pages/_servers.scss b/app/assets/stylesheets/pages/_servers.scss new file mode 100644 index 0000000..84e2813 --- /dev/null +++ b/app/assets/stylesheets/pages/_servers.scss @@ -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); + } + } +} \ No newline at end of file diff --git a/app/assets/stylesheets/pages/_users.scss b/app/assets/stylesheets/pages/_users.scss index b2d8ed0..3c2d519 100644 --- a/app/assets/stylesheets/pages/_users.scss +++ b/app/assets/stylesheets/pages/_users.scss @@ -87,6 +87,10 @@ } } + .achievements { + margin-bottom: em(20); + } + tbody td { &:first-child, &:nth-child(2) { diff --git a/app/models/concerns/extra.rb b/app/models/concerns/extra.rb index be784b8..08013ad 100644 --- a/app/models/concerns/extra.rb +++ b/app/models/concerns/extra.rb @@ -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) diff --git a/app/views/servers/_form.html.erb b/app/views/servers/_form.html.erb index 0e39651..97c0403 100644 --- a/app/views/servers/_form.html.erb +++ b/app/views/servers/_form.html.erb @@ -1,52 +1,52 @@ -
- <%= form_for @server do |f| %> - <%= f.error_messages %> +<%= form_for @server, html: { class: 'server square' } do |f| %> + <%= f.error_messages %> -
-

- <%= f.label :dns %>
- <%= f.text_field :dns %> -

-

- <%= f.label :ip %> : - <%= f.label :port %>
- <%= f.text_field :ip, :size => 15 %> - <%= f.text_field :port, :size => 5 %> -

-

- <%= f.label :rcon %>
- <%= f.text_field :rcon %> -

-

- <%= f.label :password %>
- <%= f.text_field :password %> -

-
-
-

- <%= f.label :name %>
- <%= f.text_field :name %> -

-

- <%= f.label :description %>
- <%= f.text_field :description %> -

-

- <%= f.label :irc %>
- <%= f.text_field :irc %> -

-

- <%= f.label :domain %>
- <%= f.select :domain, @server.domains.invert %> -

-

- <%= f.label :official, "Available for ENSL officials?" %>
- <%= f.check_box :official %> -

+
+ <%= f.label :dns %> + <%= f.text_field :dns %> +
+
+ <%= f.label :ip, "IP:Port" %> +
+
+ <%= f.text_field :ip %> +
+
+ <%= f.text_field :port %> +
+
+
+ <%= f.label :rcon %> + <%= f.text_field :rcon %> +
+
+ <%= f.label :password %> + <%= f.text_field :password %> +
+
+ <%= f.label :name %> + <%= f.text_field :name %> +
+
+ <%= f.label :description %> + <%= f.text_field :description %> +
+
+ <%= f.label :irc %> + <%= f.text_field :irc %> +
+
+ <%= f.label :domain %> + <%= f.select :domain, @server.domains.invert %> +
+
+ <%= f.label :official, "Available for officials?" %> + <%= f.check_box :official %> + <%= f.label :official, class: 'checkbox' %> +
-

- <%= f.submit 'Save' %> -

- <% end %> -
+
+ <%= f.submit 'Save' %> +
+<% end %> diff --git a/app/views/servers/_server.html.erb b/app/views/servers/_server.html.erb index 791a186..1596274 100644 --- a/app/views/servers/_server.html.erb +++ b/app/views/servers/_server.html.erb @@ -1,48 +1,12 @@ -
-
-

- <%= namelink server %> -

- - <% if m = Map.find_by_name(server.map) and m.picture %> - <%= image_tag m.picture.url, :width => 140, :height => 90, :class => "centered" %> - <% else %> - Description: <%= server.description %> - <% end %> -
- -
-

- Details -

+
+

<%= namelink server %>

- IP: + IP: <%= h server.ip %>:<%= h server.port %>

- <%= 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 %> -
- -
-

- Stats -

- - <% if server.domain == Server::DOMAIN_HLDS or server.reservation %> - <%= cascade server, ["ping", "map", "players_s", "recording_s", ["Connected to", "reservation_s"]] %> - <% end %> -
- -
- <% if cuser and server.can_update? cuser %> - <%= link_to "Edit", edit_server_path(server) %> - <% end %> -
+ <%= cascade server, ["dns", "password"] %> + <%= link_to "Click to Connect", "steam://run/4920//connect #{server.ip} #{server.password}", class: 'connect button tiny' %>
diff --git a/app/views/servers/edit.html.erb b/app/views/servers/edit.html.erb index e2753a3..94c0e66 100644 --- a/app/views/servers/edit.html.erb +++ b/app/views/servers/edit.html.erb @@ -1,6 +1,3 @@ -

Editing server

+

Editing Server

-<%= render :partial => 'form' %> - -<%= link_to 'Show', @server %> | -<%= link_to 'Back', servers_path %> \ No newline at end of file +<%= render partial: 'form' %> diff --git a/app/views/servers/index.html.erb b/app/views/servers/index.html.erb index 1db21d7..fc47577 100644 --- a/app/views/servers/index.html.erb +++ b/app/views/servers/index.html.erb @@ -1,35 +1,30 @@ -

- Listing servers -

+

Listing Servers

-
-
    +
    + -
    +
    - <%= render :partial => "server", :collection => @officials %> + <%= render partial: "server", collection: @officials %>
    - <%= render :partial => "server", :collection => @ns2 %> + <%= render partial: "server", collection: @ns2 %>
    - <%= render :partial => "server", :collection => @servers %> -
    - -
    - <%= render :partial => "server", :collection => @hltvs %> + <%= render partial: "server", collection: @servers %>
    -<%= link_to 'New server', new_server_path %> +<%= link_to 'New server', new_server_path, class: 'button' %> diff --git a/app/views/servers/new.html.erb b/app/views/servers/new.html.erb index 849d333..44842c7 100644 --- a/app/views/servers/new.html.erb +++ b/app/views/servers/new.html.erb @@ -1,5 +1,3 @@ -

    New server

    +

    New Server

    -<%= render :partial => 'form' %> - -<%= link_to 'Back', servers_path %> \ No newline at end of file +<%= render partial: 'form' %> diff --git a/app/views/servers/show.html.erb b/app/views/servers/show.html.erb index 975c51a..31b3ada 100644 --- a/app/views/servers/show.html.erb +++ b/app/views/servers/show.html.erb @@ -1,55 +1,23 @@ -

    - Server: <%= h @server.name %> +

    + <%= h @server.name %>

    -
    - - <%= image_tag "servers/#{@server.id}.png", :width => 350, :height => 227, :class => "centered" %> -
    - -
    - <% if @server.map %> - <%= image_tag "maps/" + @server.map + ".gif", :width => 150, :height => 100, :class => "centered" %> - <% end %> - -

    - <%= h @server.name %>
    -

    - -

    - IP: - <%= link_to @server.addr, "steam://connect/#{@server.addr}" %> -

    - - <%= cascade @server, ["dns", "password", "irc", ["Owner", :user], "description"] %> -
    - -
    - -

    - Reservations -

    - - - - - - - - <% @server.matches.order("id DESC").limit(10).each do |match| %> - - - - - <% end %> -
    TeamsTime
    <%= link_to match, match %><%= longtime match.match_time %>
    - -<% 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 %> +
    + <%= image_tag map.picture %> +
    <% end %> -<%= link_to 'Back', servers_path %> +

    + IP: + <%= link_to @server.addr, "steam://connect/#{@server.addr}" %> +

    + +<%= 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 %> diff --git a/app/views/teams/show.html.erb b/app/views/teams/show.html.erb index 0f8efc1..357f2d0 100644 --- a/app/views/teams/show.html.erb +++ b/app/views/teams/show.html.erb @@ -42,8 +42,10 @@
    -

    Current Members

    - <%= render partial: "teamers/list", locals: { teamers: @team.teamers.active.ordered.distinct, blacklist: false, comment: true } %> + <% if @team.teamers.active.ordered.distinct.length > 0 %> +

    Current Members

    + <%= render partial: "teamers/list", locals: { teamers: @team.teamers.active.ordered.distinct, blacklist: false, comment: true } %> + <% end %> <% if @team.teamers.past.distinct.length > 0 %>

    Past Members

    diff --git a/app/views/users/_general.html.erb b/app/views/users/_general.html.erb index e2bebc3..509f423 100644 --- a/app/views/users/_general.html.erb +++ b/app/views/users/_general.html.erb @@ -42,7 +42,9 @@ <% if @user.profile.achievements and !@user.profile.achievements.empty? %>

    Achievements

    - <%= @user.profile.achievements_parsed.html_safe %> +
    + <%= @user.profile.achievements_parsed.html_safe %> +
    <% end %> <%= link_to "Send PM", { controller: "messages", action: "new", id: "User", id2: @user }, { class: 'button tiny' } %>