Completed restyling:

- Bans
- Articles
- Forums
- Users

Further styling improvements to form elements
This commit is contained in:
Luke Barratt 2014-04-20 02:29:52 +01:00
parent 6f56bf81fd
commit 5cd2d098a0
33 changed files with 575 additions and 475 deletions

View file

@ -53,3 +53,5 @@
@import "pages/teams";
@import "pages/users";
@import "pages/matches";
@import "pages/files";
@import "pages/bans";

View file

@ -57,6 +57,9 @@ form {
display: block;
width: auto;
position: relative;
line-height: em(22);
vertical-align: middle;
max-height: em(36);
margin-left: 0;
border: 0;
margin: 0;
@ -139,42 +142,46 @@ form {
font-family: $open-sans;
}
input[type=checkbox] {
@include appearance(none);
border-radius: $input-border-radius;
> label.checkbox {
display: none;
position: relative;
width: em(40);
height: em(40);
font-size: $input-font-size;
padding: $input-padding;
background-color: $input-primary;
border: $input-border-colour solid $input-border-width;
position: relative;
margin: 0;
float: left;
overflow: hidden;
&:focus {
outline: none;
&:before {
@include box-sizing(border-box);
content: "";
display: block;
border-radius: $input-border-radius;
width: em(40);
height: em(40);
padding: $input-padding;
background-color: $input-primary;
border: $input-border-colour solid $input-border-width;
margin: 0;
}
&:hover {
border: $input-border-width solid lighten($input-secondary, 20%);
cursor: pointer;
&:before {
border: $input-border-width solid lighten($input-secondary, 20%);
}
}
}
input[type=checkbox] {
display: none;
&:checked {
border-color: $button-secondary;
&:after {
& + label.checkbox:before {
content: $fa-var-check;
pointer-events: none;
font-family: $fontawesome;
font-weight: normal;
font-style: normal;
position: absolute;
font-size: em(22);
top: em(4);
left: em(5);
color: $button-secondary;
color: $light-blue;
}
}
}
@ -258,6 +265,11 @@ form.square {
@include span-columns(3);
padding: em(11) 0;
line-height: em(16);
&.checkbox {
width: em(40);
padding: 0;
}
}
input[type=text],
@ -277,7 +289,6 @@ form.square {
}
}
&.wide {
> .field_with_errors {

View file

@ -26,12 +26,16 @@ tr, td, th {
}
table.striped > tbody {
> tr > td:first-child {
padding-left: ($base-line-height / 2);
}
> tr {
td:first-child,
th:first-child {
padding-left: ($base-line-height / 2);
}
> tr > td:last-child {
padding-right: ($base-line-height / 2);
td:last-child,
th:last-child {
padding-right: ($base-line-height / 2);
}
}
> tr:nth-child(2n) td {

View file

@ -21,7 +21,6 @@ ul.navigation {
float: left;
width: 100%;
background: transparent;
overflow: hidden;
max-width: $max-width;
max-height: em(60);

View file

@ -0,0 +1,23 @@
/*
Bans List
*/
#bans {
h1 {
margin-bottom: 1em;
}
table.bans {
.type,
.expiry {
width: 20%;
}
.actions {
width: 10%;
text-align: right;
}
}
}

View file

@ -0,0 +1,12 @@
/*
File Page
*/
#file {
.actions,
.files-list {
@include span-columns(12);
margin: em(20) 0;
}
}

View file

@ -175,4 +175,23 @@ div#categories {
}
}
}
}
/*
Forms
*/
#forums .add-acl {
h4 {
margin: 1em 0;
}
.permissions,
.controls {
display: inline;
width: auto;
float: none;
}
}

View file

@ -87,4 +87,20 @@ form.article {
h4 {
margin-bottom: em(20);
}
}
.files {
.files-list {
margin: em(20) 0 em(40);
}
form {
@include span-columns(12);
margin: em(20) 0;
.fields {
margin-bottom: em(20);
}
}
}

View file

@ -96,6 +96,17 @@
}
}
#profile-edit {
h1 {
margin-bottom: 1em;
}
form {
margin-top: 0;
}
}
/*
Agenda
*/
@ -172,3 +183,23 @@
margin-top: em(20);
}
}
/*
Staff List
*/
table.staff {
table-layout: auto;
.country {
width: 6%;
}
.username {
width: 20%;
}
.age {
width: 5%;
}
}

View file

@ -1,6 +1,7 @@
class PostsController < ApplicationController
before_filter :get_post, except: [:new, :create]
respond_to :html, :js
layout 'forums'
def quote
raise AccessError unless @post.can_show? cuser
@ -10,7 +11,6 @@ class PostsController < ApplicationController
@post = Post.new
@post.topic = Topic.find(params[:id])
raise AccessError unless @post.can_create? cuser
render layout: 'forums'
end
def edit
@ -28,8 +28,7 @@ class PostsController < ApplicationController
flash[:notice] = t(:posts_create)
format.js { render }
else
flash[:error] = t(:posts_invalid) + @post.errors.full_messages.to_s
format.html { return_to }
format.html { render :new }
end
end
end

View file

@ -1,5 +1,6 @@
class TopicsController < ApplicationController
before_filter :get_topic, only: [:show, :reply, :edit, :update, :destroy]
layout 'forums'
def index
render partial: true, locals: {page: params[:p].to_i}
@ -18,7 +19,6 @@ class TopicsController < ApplicationController
@newpost.topic = @topic
@newpost.user = cuser
@lock = (@topic.lock ? @topic.lock : Lock.new(:lockable => @topic))
render layout: 'forums'
end
def reply
@ -27,7 +27,7 @@ class TopicsController < ApplicationController
if request.xhr?
render 'quickreply', layout: false
else
render layout: 'forums'
render
end
end
@ -35,12 +35,10 @@ class TopicsController < ApplicationController
@topic = Topic.new
@topic.forum = Forum.find(params[:id])
raise AccessError unless @topic.can_create? cuser
render layout: 'forums'
end
def edit
raise AccessError unless @topic.can_update? cuser
render layout: 'forums'
end
def create

View file

@ -27,7 +27,7 @@
<div class="tabbed-contents">
<div class="tab" id="admins">
<h3>Admins</h3>
<table class="data">
<table class="striped staff">
<tr>
<th></th>
<th>Username</th>
@ -36,9 +36,9 @@
<th>Age</th>
</tr>
<% Group.admins.each do |grouper| %>
<tr class="<%= cycle('even', 'odd') %>">
<td><%= flag grouper.user.country %></td>
<td><%= namelink grouper.user %></td>
<tr>
<td class="country"><%= flag grouper.user.country %></td>
<td class="username"><%= namelink grouper.user %></td>
<td><%= h grouper.user.email_s %></td>
<td>
<% if grouper.task %>
@ -47,14 +47,14 @@
<%= h grouper.group.name.singularize %>
<% end %>
</td>
<td><%= h grouper.user.age %></td>
<td class="age"><%= h grouper.user.age %></td>
</tr>
<% end %>
</table>
</div>
<div class="tab" id="referees">
<h3>Referees</h3>
<table class="data">
<table class="striped staff">
<tr>
<th></th>
<th>Username</th>
@ -63,9 +63,9 @@
<th>Age</th>
</tr>
<% Group.referees.each do |grouper| %>
<tr class="<%= cycle('even', 'odd') %>">
<td><%= flag grouper.user.country %></td>
<td><%= namelink grouper.user %></td>
<tr>
<td class="country"><%= flag grouper.user.country %></td>
<td class="username"><%= namelink grouper.user %></td>
<td><%= h grouper.user.email_s %></td>
<td>
<% if grouper.task %>
@ -74,14 +74,14 @@
<%= h grouper.group.name.singularize %>
<% end %>
</td>
<td><%= h grouper.user.age %></td>
<td class="age"><%= h grouper.user.age %></td>
</tr>
<% end %>
</table>
</div>
<div class="tab" id="casters">
<h3>Shoutcasters</h3>
<table class="data">
<table class="striped staff">
<tr>
<th></th>
<th>Username</th>
@ -90,9 +90,9 @@
<th>Age</th>
</tr>
<% Group.shoutcasters.each do |grouper| %>
<tr class="<%= cycle('even', 'odd') %>">
<td><%= flag grouper.user.country %></td>
<td><%= namelink grouper.user %></td>
<tr>
<td class="country"><%= flag grouper.user.country %></td>
<td class="username"><%= namelink grouper.user %></td>
<td><%= h grouper.user.email_s %></td>
<td>
<% if grouper.task %>
@ -101,14 +101,14 @@
<%= h grouper.group.name.singularize %>
<% end %>
</td>
<td><%= h grouper.user.age %></td>
<td class="age"><%= h grouper.user.age %></td>
</tr>
<% end %>
</table>
</div>
<div class="tab" id="extras">
<h3>Extras</h3>
<table class="data">
<table class="striped staff">
<tr>
<th></th>
<th>Username</th>
@ -118,8 +118,8 @@
</tr>
<% Group.extras.each do |grouper| %>
<tr>
<td><%= flag grouper.user.country %></td>
<td><%= namelink grouper.user %></td>
<td class="country"><%= flag grouper.user.country %></td>
<td class="username"><%= namelink grouper.user %></td>
<td><%= h grouper.user.email_s %></td>
<td>
<% if grouper.task %>
@ -128,7 +128,7 @@
<%= h grouper.group.name.singularize %>
<% end %>
</td>
<td><%= h grouper.user.age %></td>
<td class="age"><%= h grouper.user.age %></td>
</tr>
<% end %>
</table>
@ -141,7 +141,8 @@
</div>
</div>
</div>
<script type="text/javascript">
new Yetii({id: 'staff'});
</script>
<script type="text/javascript">
new Yetii({
id: 'staff'
});
</script>

View file

@ -35,23 +35,27 @@
<% end %>
<% unless @article.new_record? %>
<h2>Files</h2>
<div class="files">
<h4>Files</h4>
<%= render partial: "data_files/list", locals: { files: @article.files } %>
<%= render partial: "data_files/list", locals: { files: @article.files } %>
<% if @file && @file.can_create?(cuser) %>
<h4>New file</h4>
<% if @file && @file.can_create?(cuser) %>
<h4>New File</h4>
<%= form_for @file, html: { multipart: true } do |f| %>
<%= render 'shared/errors', messages: @file.errors.full_messages %>
<%= form_for @file, html: { multipart: true } do |f| %>
<%= render 'shared/errors', messages: @file.errors.full_messages %>
<%= f.hidden_field :directory_id %>
<%= f.hidden_field :article_id %>
<%= f.hidden_field :directory_id %>
<%= f.hidden_field :article_id %>
<p>
<%= f.file_field :name %>
<%= f.submit 'Create' %>
</p>
<% end %>
<% end %>
<div class="fields">
<%= f.file_field :name %>
</div>
<div class="controls">
<%= f.submit 'Create' %>
</div>
<% end %>
<% end %>
</div>
<% end %>

View file

@ -1,3 +1 @@
<%= render partial: "form" %>
<%= link_to 'Show', @article, class: 'button' %>

View file

@ -1,31 +1,26 @@
<div class="box wide">
<h2>Articles</h2>
<h1>Articles</h1>
<% @categories.each do |category| %>
<h3>
<%= category.name %>
</h3>
<% @categories.each do |category| %>
<h3>
<%= 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" />
<% 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>
<% end %>
<div class="right">
(<%= namelink article.user %> on <%= longdate article.created_at %>)
</div>
<br class="clear" />
</div>
<% end %>
<br />
</div>
<% end %>
<% if Article.new.can_create? cuser %>
<p>
<%= link_to 'New article', new_article_path %>
</p>
<%= link_to 'New Article', new_article_path, class: 'button' %>
<% end %>

View file

@ -1,3 +1 @@
<%= render :partial => "form" %>
<%= link_to 'Back', articles_path %>

View file

@ -1,35 +1,29 @@
<div class="wide box">
<%= form_for(@ban) do |f| %>
<div id="error_explanation">
<ul>
<% @ban.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<%= form_for @ban, html: { class: 'square' } do |f| %>
<%= render 'shared/errors', messages: @ban.errors.full_messages %>
<p>
<%= link_to_function 'User', "findUser('ban[user_name]')" %><br />
<%= f.text_field :user_name, {:value => @ban.user.to_s} %>
</p>
<p>
<%= f.label :ban_type %><br />
<%= f.select :ban_type, @ban.types.invert %>
</p>
<p>
<%= f.label :steamid %><br />
<%= f.text_field :steamid %>
</p>
<p>
<%= f.label :expiry %><br />
<%= f.datetime_select :expiry %>
</p>
<p>
<%= f.label :reason %> <%= bbcode %><br />
<%= f.text_area :reason %>
</p>
<p>
<%= f.submit 'Create' %>
</p>
<% end %>
</div>
<div class="fields horizontal">
<%= f.label :user_name %>
<%= f.text_field :user_name, { value: @ban.user.to_s } %>
</div>
<div class="fields horizontal">
<%= f.label :ban_type %>
<%= f.select :ban_type, @ban.types.invert %>
</div>
<div class="fields horizontal">
<%= f.label :steamid %>
<%= f.text_field :steamid %>
</div>
<div class="fields horizontal">
<%= f.label :expiry %>
<%= f.datetime_select :expiry, datetime_separator: '', time_separator: '' %>
</div>
<div class="fields horizontal">
<%= f.label :reason do %>
Reason (<em>BB Code</em>)
<% end %>
<%= f.text_area :reason %>
</div>
<div class="controls">
<%= f.submit 'Create' %>
</div>
<% end %>

View file

@ -1,11 +1,11 @@
<table class="data">
<table class="bans striped">
<tr>
<th>User</th>
<th>Type</th>
<th>Expiry</th>
<th>Reason</th>
<th class="user">User</th>
<th class="type">Type</th>
<th class="expiry">Expiry</th>
<th class="reason">Reason</th>
<% if cuser and cuser.admin? %>
<th>Actions</th>
<th class="actions"></th>
<% end %>
</tr>
@ -20,13 +20,14 @@
</td>
<td><%= ban.types[ban.ban_type] %></td>
<td><%= shorttime ban.expiry %></td>
<td><%= shorten ban.reason, 30 %> </td>
<td><%= shorten ban.reason, 30 %></td>
<% if cuser and cuser.admin? %>
<td>
<td class="actions">
<% if ban.can_update? cuser %>
<%= link_to 'E', edit_ban_path(ban) %>
<% end; if ban.can_destroy? cuser %>
<%= link_to 'D', ban, :confirm => 'Are you sure?', :method => :delete %>
<%= link_to icon('pencil'), edit_ban_path(ban) %>
<% end %>
<% if ban.can_destroy? cuser %>
<%= link_to icon('times'), ban, confirm: 'Are you sure?', method: :delete %>
<% end %>
</td>
<% end %>

View file

@ -1,6 +1,3 @@
<h1>Editing ban</h1>
<h1>Editing Ban</h1>
<%= render :partial => "form" %>
<%= link_to 'Show', @ban %> |
<%= link_to 'Back', bans_path %>
<%= render partial: "form" %>

View file

@ -1,11 +1,14 @@
<h1>Active bans</h1>
<div id="bans">
<h1>Active bans</h1>
<%= render :partial => "list", :locals => {:bans => @bans.effective} %>
<%= link_to 'New ban', new_ban_path, class: 'button' %>
<br />
<%= render partial: "list", locals: { bans: @bans.effective } %>
<h1>Ban history</h1>
<h1>Ban history</h1>
<%= render :partial => "list", :locals => {:bans => @bans.ineffective} %>
<%= render partial: "list", locals: { bans: @bans.ineffective } %>
<%= link_to 'New ban', new_ban_path %>
<%= link_to 'New ban', new_ban_path, class: 'button' %>
</div>

View file

@ -1,5 +1,3 @@
<h1>New ban</h1>
<h1>New Ban</h1>
<%= render :partial => "form" %>
<%= link_to 'Back', bans_path %>
<%= render partial: "form" %>

View file

@ -1,4 +1,4 @@
<table class="data">
<table class="striped files-list">
<tr>
<th>Name</th>
<th>Path</th>
@ -7,7 +7,7 @@
</tr>
<% files.each do |file| %>
<tr class="<%= cycle('even', 'odd') %>">
<tr>
<td><%= namelink file %></td>
<td><%= h file.url %></td>
<td><%= file.size_s %></td>
@ -15,7 +15,7 @@
<% if file.can_update? cuser %>
<%= link_to icon('pencil'), edit_data_file_path(file) %>
<% end; if file.can_destroy? cuser %>
<%= link_to icon('times'), file, :confirm => 'Are you sure?', :method => :delete %>
<%= link_to icon('times'), file, confirm: 'Are you sure?', method: :delete %>
<% end %>
</td>
</tr>

View file

@ -1,58 +1,48 @@
<div class="box wide">
<h1>
<%= h @file %>
</h1>
<div id="file">
<h1><%=h @file %></h1>
<%= cascade @file, [["Filename", "name.filename".to_sym], "size_s", "directory", "md5_s", ["Modified", "created_at"]] %>
<% if cuser and cuser.admin? %>
<p>
[
<div class="actions">
<% if @file.can_update? cuser %>
<%= link_to 'Edit', edit_data_file_path(@file) %>
<%= link_to 'Edit', edit_data_file_path(@file), class: 'button tiny' %>
<% end; if @file.can_destroy? cuser %>
<%= link_to 'Destroy', @file, :confirm => 'Are you sure?', :method => :delete %>
<%= link_to 'Destroy', @file, confirm: 'Are you sure?', method: :delete, class: 'button tiny' %>
<% end %>
]
</p>
</div>
<% end %>
<br />
<%= link_to "Download", @file.url, class: 'button' %>
<h2 class="center">
<%= link_to "Download", @file.url %>
</h2>
</div>
<div class="files-list">
<h4>Related Files</h4>
<div class="wide box">
<h3>
Related Files
</h3>
<table class="data">
<tr>
<th>Name</th>
<th>Size</th>
<th>MD5</th>
<th>Modified</th>
</tr>
<% @file.related_files.each do |related| %>
<table class="striped">
<tr>
<td>
<%= link_to (h related.name.filename), related.name.url %>
</td>
<td>
<%= related.size_s %> MB
</td>
<td>
<%= related.md5_s %>
</td>
<td>
<%= shorttime related.created_at %>
</td>
<th>Name</th>
<th>Size</th>
<th>MD5</th>
<th>Modified</th>
</tr>
<% end %>
</table>
<% @file.related_files.each do |related| %>
<tr>
<td>
<%= link_to (h related.name.filename), related.name.url %>
</td>
<td>
<%= related.size_s %> MB
</td>
<td>
<%= related.md5_s %>
</td>
<td>
<%= shorttime related.created_at %>
</td>
</tr>
<% end %>
</table>
</div>
</div>
<%= add_comments @file %>

View file

@ -1,71 +1,74 @@
<div class="wide box">
<%= form_for(@forum) do |f| %>
<div id="error_explanation">
<ul>
<% @forum.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<div id="forums">
<%= form_for(@forum, html: { class: 'square' }) do |f| %>
<%= render 'shared/errors', messages: @forum.errors.full_messages %>
<p>
<%= f.label :title %><br />
<div class="fields horizontal">
<%= f.label :title %>
<%= f.text_field :title %>
</p>
<p>
<%= f.label :description %><br />
</div>
<div class="fields horizontal">
<%= f.label :description %>
<%= f.text_field :description %>
</p>
<p>
<%= f.label :category %><br />
</div>
<div class="fields horizontal">
<%= f.label :category %>
<%= f.select :category_id, Category.domain(Category::DOMAIN_FORUMS).ordered.collect{|c| [c, c.id]} %>
</p>
<p>
</div>
<div class="controls">
<%= f.submit 'Save' %>
</p>
</div>
<% end %>
</div>
<% unless @forum.new_record? %>
<div class="wide box">
<h2>
Access Rights
</h2>
If no groups are specified, everyone is allowed for the specific access type.
<table class="data">
<% unless @forum.new_record? %>
<h2>Access Rights</h2>
<p>If no groups are specified, everyone is allowed for the specific access type.</p>
<table id="acl" class="striped">
<tr>
<th>Group</th>
<th>Access Level</th>
<th>Options</th>
<th class="group">Group</th>
<th class="level">Access Level</th>
<th class="options">Options</th>
</tr>
<% @forum.forumers.each do |forumer| %>
<tr class="<%= cycle('even', 'odd') %>">
<%= form_for forumer do |g| %>
<td><%= namelink forumer.group %></td>
<td>
<%= g.select :access, forumer.accesses.invert, :size => 20 %>
</td>
<td>
<%= link_to_function "Update", "$('edit_forumer_#{forumer.id}').submit()" %>
<%= link_to "Remove", forumer, :method => :delete %>
</td>
<% end %>
<tr>
<td><%= namelink forumer.group %></td>
<td>
<%= form_for forumer do |g| %>
<div class="fields">
<%= g.select :access, forumer.accesses.invert, size: 20 %>
</div>
<% end %>
</td>
<td>
<%= content_tag :a, { class: 'button tiny', data: { forumer: forumer.id } } do %>
Update
<% end %>
<%= link_to "Remove", forumer, method: :delete, class: 'button tiny' %>
</td>
</tr>
<% end %>
</table>
<%= form_for @forum.forumers.build do |f| %>
<%= f.error_messages %>
<%= form_for @forum.forumers.build, html: { class: 'add-acl' } do |f| %>
<%= render 'shared/errors', messages: @forum.errors.full_messages %>
<%= f.hidden_field :forum_id %>
<p>
<%= f.label :group_id %><br />
<div class="fields permissions">
<h4>Grant Access</h4>
<%= f.select :group_id, Group.all.collect{|g| [g, g.id]} %>
<%= f.select :access, f.object.accesses.invert, :size => 20 %>
<%= f.submit "Add" %>
</p>
</div>
<div class="controls">
<%= f.submit "Add" %>
</div>
<% end %>
</div>
<% end %>
<% end %>
<script>
$('a[data-forumer]').click(function() {
$('#edit_forumer_' + $(this).data('forumer')).submit();
});
</script>
</div>

View file

@ -1,6 +1,3 @@
<h1>Editing forum</h1>
<%= render :partial => "form" %>
<%= link_to 'Show', @forum %> |
<%= link_to 'Back', forums_path %>

View file

@ -1,5 +1,3 @@
<h1>New Forum</h1>
<%= render partial: "form" %>
<%= link_to 'Back', forums_path, class: 'button' %>

View file

@ -20,7 +20,7 @@
</div>
<div class="fields horizontal">
<%= f.label :text %>
<%= f.text_area :text %>
<%= f.text_area :text, rows: 15 %>
</div>
<div class="controls">
<%= f.submit 'Send Message' %>

View file

@ -1,13 +1,18 @@
<%= form_for(@post) do |f| %>
<%= f.error_messages %>
<%= form_for(@post, html: { class: 'square' }) do |f| %>
<%= render 'shared/errors', messages: @post.errors.full_messages %>
<%= f.hidden_field :topic_id %>
<p>
Topic: <%= namelink @post.topic %>
</p>
<p>
<%= f.text_area :text, :rows => 15, :cols => 108 %>
</p>
<p>
<%= f.submit 'Save' %>
</p>
<div class="square horizontal">
<%= f.label :topic %>
<div class="inputs">
<%= namelink @post.topic %>
</div>
</div>
<div class="square horizontal">
<%= f.label :text %>
<%= f.text_area :text, rows: 20 %>
</div>
<div class="controls">
<%= f.submit 'Save Post' %>
</div>
<% end %>

View file

@ -2,4 +2,4 @@
<%= render :partial => "form" %>
<%= link_to 'Back to topic', @post.topic %>
<%= link_to 'Back to topic', @post.topic, class: 'button tiny' %>

View file

@ -1,5 +1,3 @@
<h1>New post</h1>
<h1>New Post</h1>
<%= render :partial => "form" %>
<%= link_to 'Back', posts_path %>
<%= render partial: "form" %>

View file

@ -1,25 +1,21 @@
<h1>Editing topic</h1>
<h1>Editing Topic</h1>
<div class="wide box">
<%= form_for(@topic) do |f| %>
<%= f.error_messages %>
<%= form_for(@topic, html: { class: 'square' }) do |f| %>
<%= render 'shared/errors', messages: @topic.errors.full_messages %>
<p>
<%= f.label :title %><br />
<%= f.text_field :title %>
</p>
<p>
<%= f.label :forum_id %><br />
<%= f.select :forum_id, Forum.all.collect{|forum| [forum, forum.id]} %>
</p>
<p>
<%= f.label :state %><br />
<%= f.select :state, f.object.states.invert %>
</p>
<p>
<%= f.submit 'Update' %>
</p>
<% end %>
</div>
<%= link_to 'Back', @topic %>
<div class="fields horizontal">
<%= f.label :title %>
<%= f.text_field :title %>
</div>
<div class="fields horizontal">
<%= f.label :forum_id %>
<%= f.select :forum_id, Forum.all.collect{|forum| [forum, forum.id]} %>
</div>
<div class="fields horizontal">
<%= f.label :state %>
<%= f.select :state, f.object.states.invert %>
</div>
<div class="controls">
<%= f.submit 'Update Topic' %>
</div>
<% end %>

View file

@ -1,21 +1,28 @@
<h1>New topic</h1>
<h1>New Topic</h1>
<%= form_for @topic, html: { multipart: true, class: 'square' } do |f| %>
<%= render 'shared/errors', messages: @topic.errors.full_messages %>
<%= form_for @topic, :html => { :multipart => true } do |f| %>
<%= f.error_messages %>
<%= f.hidden_field :forum_id %>
<p>
<%= f.label :title %><br />
<%= f.text_field :title, :size => 50 %>
</p>
<div class="fields horizontal">
<%= f.label :forum %>
<div class="inputs">
<%= @topic.forum %>
</div>
</div>
<p>
<%= f.text_area :first_post, :rows => 15, :cols => 108 %>
</p>
<div class="fields horizontal">
<%= f.label :title %>
<%= f.text_field :title, size: 50 %>
</div>
<p>
<%= f.submit 'Create the topic' %>
</p>
<div class="fields horizontal">
<%= f.label :post %>
<%= f.text_area :first_post, rows: 15 %>
</div>
<div class="controls">
<%= f.submit 'Create Topic' %>
</div>
<% end %>
<%= link_to 'Back', @topic.forum %>

View file

@ -1,171 +1,174 @@
<h1>Account: <%= h @user.username %></h1>
<div id="profile-edit">
<h1>Account: <%= h @user.username %></h1>
<%= form_for @user, html: { multipart: true, id: 'profile', class: 'square' } do |f| %>
<% f.fields_for :profile do |p| %>
<div id="user" class="tabbed">
<ul id="user-nav" class="tabs">
<li><a href="#account">Account</a></li>
<li><a href="#profile">Profile</a></li>
<li><a href="#country"><%= t('profile.locals') %></a></li>
<li><a href="#notifications">Notifications</a></li>
</ul>
<%= render 'shared/errors', messages: @user.errors.full_messages %>
<div class="tabbed-contents">
<div class="tab" id="account">
<% if @user.errors.any? %>
<div id="errors">
<strong><%= pluralize(@user.errors.count, t(:error)) %></strong>
<ul class="errors">
<% @user.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
<%= form_for @user, html: { multipart: true, id: 'profile', class: 'square' } do |f| %>
<% f.fields_for :profile do |p| %>
<div id="user" class="tabbed">
<ul id="user-nav" class="tabs">
<li><a href="#account">Account</a></li>
<li><a href="#profile">Profile</a></li>
<li><a href="#country"><%= t('profile.locals') %></a></li>
<li><a href="#notifications">Notifications</a></li>
</ul>
<div class="tabbed-contents">
<div class="tab" id="account">
<div class="fields horizontal">
<%= f.label :username, 'Username', class: 'required' %>
<%= f.text_field :username %>
</div>
<div class="fields horizontal">
<%= f.label :raw_password, "Password" %>
<%= f.password_field :raw_password %>
</div>
<div class="fields horizontal">
<%= f.label :email do %>
<p>Email</p>
<em>(only visible to admins)</em>
<% end %>
<%= f.text_field :email %>
</div>
<div class="fields horizontal">
<%= f.label :public_email %>
<%= f.check_box :public_email %>
<%= f.label :public_email, class: 'checkbox' %>
</div>
<div class="fields horizontal">
<%= f.label :steamid %>
<%= f.text_field :steamid, html: { placeholder: 'http://steamcommunity.com/id/...' } %>
</div>
<div class="fields horizontal">
<%= f.label :firstname do %>
<p>First Name</p>
<em>(only visible to members)</em>
<% end %>
<%= f.text_field :firstname %>
</div>
<div class="fields horizontal">
<%= f.label :lastname do %>
<p>Last Name</p>
<em>(only visible to members)</em>
<% end %>
<%= f.text_field :lastname %>
</div>
<div class="fields horizontal">
<%= f.label :birthdate %>
<div class="inputs">
<%= date_select :user, :birthdate, order: [:year, :month, :day], default: @user.birthdate, start_year: 1950 %>
</div>
</div>
<% end %>
<div class="fields horizontal">
<%= f.label :username, 'Username', class: 'required' %>
<%= f.text_field :username %>
</div>
<div class="fields horizontal">
<%= f.label :raw_password, "Password" %>
<%= f.password_field :raw_password %>
<div class="tab" id="profile">
<div class="fields horizontal">
<%= p.label :steam_profile, "Steam Profile URL" %>
<%= p.text_field :steam_profile %>
</div>
<div class="fields horizontal">
<%= p.label :web %>
<%= p.text_field :web %>
</div>
<div class="fields horizontal">
<%= p.label :achievements %>
<%= p.text_area :achievements, rows: 5 %>
</div>
<div class="fields horizontal">
<%= p.label :signature %>
<%= p.text_area :signature, rows: 5 %>
</div>
<div class="fields horizontal">
<label>Avatar</label>
<%= p.file_field :avatar %>
</div>
</div>
<div class="fields horizontal">
<%= f.label :email do %>
<p>Email</p>
<em>(only visible to admins)</em>
<% end %>
<%= f.text_field :email %>
<div class="tab" id="country">
<div class="fields horizontal">
<%= f.label :country %>
<div class="inputs">
<%= country_code_select :user, :country %>
</div>
</div>
<div class="fields horizontal">
<%= p.label :town %>
<%= p.text_field :town %>
</div>
<div class="fields horizontal">
<%= f.label :time_zone %>
<div class="inputs">
<%= f.time_zone_select :time_zone, ActiveSupport::TimeZone.all %><br><br>
<p>Daylight savings will be observed automatically.</p>
</div>
</div>
</div>
<div class="fields horizontal">
<%= f.label :public_email %>
<%= f.check_box :public_email %>
</div>
<div class="fields horizontal">
<%= f.label :steamid %>
<%= f.text_field :steamid, html: { placeholder: 'http://steamcommunity.com/id/...' } %>
</div>
<div class="fields horizontal">
<%= f.label :firstname do %>
<p>First Name</p>
<em>(only visible to members)</em>
<% end %>
<%= f.text_field :firstname %>
</div>
<div class="fields horizontal">
<%= f.label :lastname do %>
<p>Last Name</p>
<em>(only visible to members)</em>
<% end %>
<%= f.text_field :lastname %>
</div>
<div class="fields horizontal">
<%= f.label :birthdate %>
<div class="inputs">
<%= date_select :user, :birthdate, order: [:year, :month, :day], default: @user.birthdate, start_year: 1950 %>
<div class="tab" id="notifications">
<h4>Notify me when...</h4>
<div class="fields horizontal">
<%= p.label :notify_news, "News item are posted" %>
<%= p.check_box :notify_news %>
<%= p.label :notify_news, class: 'checkbox' %>
</div>
<div class="fields horizontal">
<%= p.label :notify_articles, "New articles" %>
<%= p.check_box :notify_articles %>
<%= p.label :notify_articles, class: 'checkbox' %>
</div>
<div class="fields horizontal">
<%= p.label :notify_movies, "New movies" %>
<%= p.check_box :notify_movies %>
<%= p.label :notify_movies, class: 'checkbox' %>
</div>
<div class="fields horizontal">
<%= p.label :notify_gather, "Gather has 6 players" %>
<%= p.check_box :notify_gather %>
<%= p.label :notify_gather, class: 'checkbox' %>
</div>
<div class="fields horizontal">
<%= p.label :notify_own_match, "My team's matches" %>
<%= p.check_box :notify_own_match %>
<%= p.label :notify_own_match, class: 'checkbox' %>
</div>
<div class="fields horizontal">
<%= p.label :notify_any_match, "New matches" %>
<%= p.check_box :notify_any_match %>
<%= p.label :notify_any_match, class: 'checkbox' %>
</div>
<div class="fields horizontal">
<%= p.label :notify_challenge, "New challenges" %>
<%= p.check_box :notify_challenge %>
<%= p.label :notify_challenge, class: 'checkbox' %>
</div>
<div class="fields horizontal">
<%= p.label :notify_pms, "Private messages" %>
<%= p.check_box :notify_pms %>
<%= p.label :notify_pms, class: 'checkbox' %>
</div>
</div>
</div>
<div class="tab" id="profile">
<div class="fields horizontal">
<%= p.label :steam_profile, "Steam Profile URL" %>
<%= p.text_field :steam_profile %>
</div>
<div class="fields horizontal">
<%= p.label :web %>
<%= p.text_field :web %>
</div>
<div class="fields horizontal">
<%= p.label :achievements %>
<%= p.text_area :achievements, rows: 5 %>
</div>
<div class="fields horizontal">
<%= p.label :signature %>
<%= p.text_area :signature, rows: 5 %>
</div>
<div class="fields horizontal">
<label>Avatar</label>
<%= p.file_field :avatar %>
</div>
</div>
<div class="tab" id="country">
<div class="fields horizontal">
<%= f.label :country %>
<div class="inputs">
<%= country_code_select :user, :country %>
</div>
</div>
<div class="fields horizontal">
<%= p.label :town %>
<%= p.text_field :town %>
</div>
<div class="fields horizontal">
<%= f.label :time_zone %>
<div class="inputs">
<%= f.time_zone_select :time_zone, ActiveSupport::TimeZone.all %><br><br>
<p>Daylight savings will be observed automatically.</p>
</div>
</div>
</div>
<div class="tab" id="notifications">
<h4>Notify me when...</h4>
<div class="fields horizontal">
<%= p.label :notify_news, "News item are posted" %>
<%= p.check_box :notify_news %>
</div>
<div class="fields horizontal">
<%= p.label :notify_articles, "New articles" %>
<%= p.check_box :notify_articles %>
</div>
<div class="fields horizontal">
<%= p.label :notify_movies, "New movies" %>
<%= p.check_box :notify_movies %>
</div>
<div class="fields horizontal">
<%= p.label :notify_gather, "Gather has 6 players" %>
<%= p.check_box :notify_gather %>
</div>
<div class="fields horizontal">
<%= p.label :notify_own_match, "My team's matches" %>
<%= p.check_box :notify_own_match %>
</div>
<div class="fields horizontal">
<%= p.label :notify_any_match, "New matches" %>
<%= p.check_box :notify_any_match %>
</div>
<div class="fields horizontal">
<%= p.label :notify_challenge, "New challenges" %>
<%= p.check_box :notify_challenge %>
</div>
<div class="fields horizontal">
<%= p.label :notify_pms, "Private messages" %>
<%= p.check_box :notify_pms %>
</div>
<div class="controls">
<%= f.submit %>
</div>
</div>
<div class="controls">
<%= f.submit %>
</div>
</div>
<% end %>
<% end %>
<% end %>
<script type="text/javascript">
new Yetii({
id: 'user'
});
</script>
<script type="text/javascript">
new Yetii({
id: 'user'
});
</script>
</div>