From 5cd2d098a0056a5bd1d2fe108e1877f897ab42f0 Mon Sep 17 00:00:00 2001 From: Luke Barratt Date: Sun, 20 Apr 2014 02:29:52 +0100 Subject: [PATCH] Completed restyling: - Bans - Articles - Forums - Users Further styling improvements to form elements --- app/assets/stylesheets/application.css.scss | 2 + app/assets/stylesheets/components/_forms.scss | 57 ++-- .../stylesheets/components/_tables.scss | 14 +- .../stylesheets/layout/_navigation.scss | 1 - app/assets/stylesheets/pages/_bans.scss | 23 ++ app/assets/stylesheets/pages/_files.scss | 12 + app/assets/stylesheets/pages/_forums.scss | 19 ++ app/assets/stylesheets/pages/_news.scss | 16 + app/assets/stylesheets/pages/_users.scss | 31 ++ app/controllers/posts_controller.rb | 5 +- app/controllers/topics_controller.rb | 6 +- app/views/about/staff.html.erb | 47 +-- app/views/articles/_form.html.erb | 32 +- app/views/articles/edit.html.erb | 2 - app/views/articles/index.html.erb | 43 ++- app/views/articles/new.html.erb | 2 - app/views/bans/_form.html.erb | 62 ++-- app/views/bans/_list.html.erb | 23 +- app/views/bans/edit.html.erb | 7 +- app/views/bans/index.html.erb | 15 +- app/views/bans/new.html.erb | 6 +- app/views/data_files/_list.html.erb | 6 +- app/views/data_files/show.html.erb | 74 ++-- app/views/forums/_form.html.erb | 107 +++--- app/views/forums/edit.html.erb | 3 - app/views/forums/new.html.erb | 2 - app/views/messages/new.html.erb | 2 +- app/views/posts/_form.html.erb | 27 +- app/views/posts/edit.html.erb | 2 +- app/views/posts/new.html.erb | 6 +- app/views/topics/edit.html.erb | 42 ++- app/views/topics/new.html.erb | 37 +- app/views/users/edit.html.erb | 317 +++++++++--------- 33 files changed, 575 insertions(+), 475 deletions(-) create mode 100644 app/assets/stylesheets/pages/_bans.scss create mode 100644 app/assets/stylesheets/pages/_files.scss diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index dd27d4f..fd99511 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -53,3 +53,5 @@ @import "pages/teams"; @import "pages/users"; @import "pages/matches"; +@import "pages/files"; +@import "pages/bans"; diff --git a/app/assets/stylesheets/components/_forms.scss b/app/assets/stylesheets/components/_forms.scss index 3276900..176ce8d 100644 --- a/app/assets/stylesheets/components/_forms.scss +++ b/app/assets/stylesheets/components/_forms.scss @@ -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 { diff --git a/app/assets/stylesheets/components/_tables.scss b/app/assets/stylesheets/components/_tables.scss index cd08ecd..3cb4dc8 100644 --- a/app/assets/stylesheets/components/_tables.scss +++ b/app/assets/stylesheets/components/_tables.scss @@ -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 { diff --git a/app/assets/stylesheets/layout/_navigation.scss b/app/assets/stylesheets/layout/_navigation.scss index a2b538e..f7f692d 100644 --- a/app/assets/stylesheets/layout/_navigation.scss +++ b/app/assets/stylesheets/layout/_navigation.scss @@ -21,7 +21,6 @@ ul.navigation { float: left; width: 100%; background: transparent; - overflow: hidden; max-width: $max-width; max-height: em(60); diff --git a/app/assets/stylesheets/pages/_bans.scss b/app/assets/stylesheets/pages/_bans.scss new file mode 100644 index 0000000..e91ba24 --- /dev/null +++ b/app/assets/stylesheets/pages/_bans.scss @@ -0,0 +1,23 @@ +/* + Bans List +*/ + +#bans { + + h1 { + margin-bottom: 1em; + } + + table.bans { + + .type, + .expiry { + width: 20%; + } + + .actions { + width: 10%; + text-align: right; + } + } +} \ No newline at end of file diff --git a/app/assets/stylesheets/pages/_files.scss b/app/assets/stylesheets/pages/_files.scss new file mode 100644 index 0000000..146e932 --- /dev/null +++ b/app/assets/stylesheets/pages/_files.scss @@ -0,0 +1,12 @@ +/* + File Page +*/ + +#file { + + .actions, + .files-list { + @include span-columns(12); + margin: em(20) 0; + } +} \ No newline at end of file diff --git a/app/assets/stylesheets/pages/_forums.scss b/app/assets/stylesheets/pages/_forums.scss index 5c646ff..1ca1108 100644 --- a/app/assets/stylesheets/pages/_forums.scss +++ b/app/assets/stylesheets/pages/_forums.scss @@ -175,4 +175,23 @@ div#categories { } } } +} + +/* + Forms +*/ + + +#forums .add-acl { + + h4 { + margin: 1em 0; + } + + .permissions, + .controls { + display: inline; + width: auto; + float: none; + } } \ No newline at end of file diff --git a/app/assets/stylesheets/pages/_news.scss b/app/assets/stylesheets/pages/_news.scss index 857de55..aa272d8 100644 --- a/app/assets/stylesheets/pages/_news.scss +++ b/app/assets/stylesheets/pages/_news.scss @@ -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); + } + } } \ No newline at end of file diff --git a/app/assets/stylesheets/pages/_users.scss b/app/assets/stylesheets/pages/_users.scss index 0a2ad51..b2d8ed0 100644 --- a/app/assets/stylesheets/pages/_users.scss +++ b/app/assets/stylesheets/pages/_users.scss @@ -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%; + } +} \ No newline at end of file diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index cb3f7f1..6e1da8f 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -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 diff --git a/app/controllers/topics_controller.rb b/app/controllers/topics_controller.rb index 38a8306..33493e4 100644 --- a/app/controllers/topics_controller.rb +++ b/app/controllers/topics_controller.rb @@ -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 diff --git a/app/views/about/staff.html.erb b/app/views/about/staff.html.erb index c9beed1..bad9e40 100644 --- a/app/views/about/staff.html.erb +++ b/app/views/about/staff.html.erb @@ -27,7 +27,7 @@

Admins

- +
@@ -36,9 +36,9 @@ <% Group.admins.each do |grouper| %> - - - + + + - + <% end %>
UsernameAge
<%= flag grouper.user.country %><%= namelink grouper.user %>
<%= flag grouper.user.country %><%= namelink grouper.user %> <%= h grouper.user.email_s %> <% if grouper.task %> @@ -47,14 +47,14 @@ <%= h grouper.group.name.singularize %> <% end %> <%= h grouper.user.age %><%= h grouper.user.age %>

Referees

- +
@@ -63,9 +63,9 @@ <% Group.referees.each do |grouper| %> - - - + + + - + <% end %>
UsernameAge
<%= flag grouper.user.country %><%= namelink grouper.user %>
<%= flag grouper.user.country %><%= namelink grouper.user %> <%= h grouper.user.email_s %> <% if grouper.task %> @@ -74,14 +74,14 @@ <%= h grouper.group.name.singularize %> <% end %> <%= h grouper.user.age %><%= h grouper.user.age %>

Shoutcasters

- +
@@ -90,9 +90,9 @@ <% Group.shoutcasters.each do |grouper| %> - - - + + + - + <% end %>
UsernameAge
<%= flag grouper.user.country %><%= namelink grouper.user %>
<%= flag grouper.user.country %><%= namelink grouper.user %> <%= h grouper.user.email_s %> <% if grouper.task %> @@ -101,14 +101,14 @@ <%= h grouper.group.name.singularize %> <% end %> <%= h grouper.user.age %><%= h grouper.user.age %>

Extras

- +
@@ -118,8 +118,8 @@ <% Group.extras.each do |grouper| %> - - + + - + <% end %>
Username
<%= flag grouper.user.country %><%= namelink grouper.user %><%= flag grouper.user.country %><%= namelink grouper.user %> <%= h grouper.user.email_s %> <% if grouper.task %> @@ -128,7 +128,7 @@ <%= h grouper.group.name.singularize %> <% end %> <%= h grouper.user.age %><%= h grouper.user.age %>
@@ -141,7 +141,8 @@
- - + diff --git a/app/views/articles/_form.html.erb b/app/views/articles/_form.html.erb index a482c13..1e5078b 100644 --- a/app/views/articles/_form.html.erb +++ b/app/views/articles/_form.html.erb @@ -35,23 +35,27 @@ <% end %> <% unless @article.new_record? %> -

Files

+
+

Files

- <%= render partial: "data_files/list", locals: { files: @article.files } %> + <%= render partial: "data_files/list", locals: { files: @article.files } %> - <% if @file && @file.can_create?(cuser) %> -

New file

+ <% if @file && @file.can_create?(cuser) %> +

New File

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

- <%= f.file_field :name %> - <%= f.submit 'Create' %> -

- <% end %> - <% end %> +
+ <%= f.file_field :name %> +
+
+ <%= f.submit 'Create' %> +
+ <% end %> + <% end %> +
<% end %> diff --git a/app/views/articles/edit.html.erb b/app/views/articles/edit.html.erb index 002da2d..d44c608 100644 --- a/app/views/articles/edit.html.erb +++ b/app/views/articles/edit.html.erb @@ -1,3 +1 @@ <%= render partial: "form" %> - -<%= link_to 'Show', @article, class: 'button' %> diff --git a/app/views/articles/index.html.erb b/app/views/articles/index.html.erb index 319af85..56ad572 100644 --- a/app/views/articles/index.html.erb +++ b/app/views/articles/index.html.erb @@ -1,31 +1,26 @@ -
-

Articles

+

Articles

- <% @categories.each do |category| %> -

- <%= category.name %> -

+<% @categories.each do |category| %> +

+ <%= category.name %> +

- <% category.articles.nodrafts.ordered.each do |article| %> -
-
- <% if cuser and !article.read_by? cuser %> - NEW - <% end %> - <%= namelink article %> -
-
- (<%= namelink article.user %> on <%= longdate article.created_at %>) -
-
+ <% category.articles.nodrafts.ordered.each do |article| %> +
+
+ <% if cuser and !article.read_by? cuser %> + NEW + <% end %> + <%= namelink article %>
- <% end %> +
+ (<%= namelink article.user %> on <%= longdate article.created_at %>) +
+
+
<% end %> -
-
+<% end %> <% if Article.new.can_create? cuser %> -

- <%= link_to 'New article', new_article_path %> -

+ <%= link_to 'New Article', new_article_path, class: 'button' %> <% end %> diff --git a/app/views/articles/new.html.erb b/app/views/articles/new.html.erb index e27c01a..2872e82 100644 --- a/app/views/articles/new.html.erb +++ b/app/views/articles/new.html.erb @@ -1,3 +1 @@ <%= render :partial => "form" %> - -<%= link_to 'Back', articles_path %> \ No newline at end of file diff --git a/app/views/bans/_form.html.erb b/app/views/bans/_form.html.erb index 551b9c0..15f1df4 100644 --- a/app/views/bans/_form.html.erb +++ b/app/views/bans/_form.html.erb @@ -1,35 +1,29 @@ -
- <%= form_for(@ban) do |f| %> -
-
    - <% @ban.errors.full_messages.each do |msg| %> -
  • <%= msg %>
  • - <% end %> -
-
+<%= form_for @ban, html: { class: 'square' } do |f| %> + <%= render 'shared/errors', messages: @ban.errors.full_messages %> -

- <%= link_to_function 'User', "findUser('ban[user_name]')" %>
- <%= f.text_field :user_name, {:value => @ban.user.to_s} %> -

-

- <%= f.label :ban_type %>
- <%= f.select :ban_type, @ban.types.invert %> -

-

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

-

- <%= f.label :expiry %>
- <%= f.datetime_select :expiry %> -

-

- <%= f.label :reason %> <%= bbcode %>
- <%= f.text_area :reason %> -

-

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

- <% end %> -
+
+ <%= f.label :user_name %> + <%= f.text_field :user_name, { value: @ban.user.to_s } %> +
+
+ <%= f.label :ban_type %> + <%= f.select :ban_type, @ban.types.invert %> +
+
+ <%= f.label :steamid %> + <%= f.text_field :steamid %> +
+
+ <%= f.label :expiry %> + <%= f.datetime_select :expiry, datetime_separator: '', time_separator: '' %> +
+
+ <%= f.label :reason do %> + Reason (BB Code) + <% end %> + <%= f.text_area :reason %> +
+
+ <%= f.submit 'Create' %> +
+<% end %> diff --git a/app/views/bans/_list.html.erb b/app/views/bans/_list.html.erb index 4be5fa3..f3d7ddd 100644 --- a/app/views/bans/_list.html.erb +++ b/app/views/bans/_list.html.erb @@ -1,11 +1,11 @@ - +
- - - - + + + + <% if cuser and cuser.admin? %> - + <% end %> @@ -20,13 +20,14 @@ - + <% if cuser and cuser.admin? %> - <% end %> diff --git a/app/views/bans/edit.html.erb b/app/views/bans/edit.html.erb index 29029da..efb5edd 100644 --- a/app/views/bans/edit.html.erb +++ b/app/views/bans/edit.html.erb @@ -1,6 +1,3 @@ -

Editing ban

+

Editing Ban

-<%= render :partial => "form" %> - -<%= link_to 'Show', @ban %> | -<%= link_to 'Back', bans_path %> \ No newline at end of file +<%= render partial: "form" %> diff --git a/app/views/bans/index.html.erb b/app/views/bans/index.html.erb index b6dbc45..003d8f9 100644 --- a/app/views/bans/index.html.erb +++ b/app/views/bans/index.html.erb @@ -1,11 +1,14 @@ -

Active bans

+
+

Active bans

-<%= render :partial => "list", :locals => {:bans => @bans.effective} %> + <%= link_to 'New ban', new_ban_path, class: 'button' %> -
+ <%= render partial: "list", locals: { bans: @bans.effective } %> -

Ban history

+

Ban history

-<%= render :partial => "list", :locals => {:bans => @bans.ineffective} %> + <%= render partial: "list", locals: { bans: @bans.ineffective } %> -<%= link_to 'New ban', new_ban_path %> \ No newline at end of file + <%= link_to 'New ban', new_ban_path, class: 'button' %> +
+ \ No newline at end of file diff --git a/app/views/bans/new.html.erb b/app/views/bans/new.html.erb index 5c9d44a..df829e4 100644 --- a/app/views/bans/new.html.erb +++ b/app/views/bans/new.html.erb @@ -1,5 +1,3 @@ -

New ban

+

New Ban

-<%= render :partial => "form" %> - -<%= link_to 'Back', bans_path %> \ No newline at end of file +<%= render partial: "form" %> diff --git a/app/views/data_files/_list.html.erb b/app/views/data_files/_list.html.erb index da4e3ea..5b97176 100644 --- a/app/views/data_files/_list.html.erb +++ b/app/views/data_files/_list.html.erb @@ -1,4 +1,4 @@ -
UserTypeExpiryReasonUserTypeExpiryReasonActions
<%= ban.types[ban.ban_type] %> <%= shorttime ban.expiry %><%= shorten ban.reason, 30 %> <%= shorten ban.reason, 30 %> + <% 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 %>
+
@@ -7,7 +7,7 @@ <% files.each do |file| %> - + @@ -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 %> diff --git a/app/views/data_files/show.html.erb b/app/views/data_files/show.html.erb index 827c37a..15c06f8 100644 --- a/app/views/data_files/show.html.erb +++ b/app/views/data_files/show.html.erb @@ -1,58 +1,48 @@ -
-

- <%= h @file %> -

+
+

<%=h @file %>

<%= cascade @file, [["Filename", "name.filename".to_sym], "size_s", "directory", "md5_s", ["Modified", "created_at"]] %> <% if cuser and cuser.admin? %> -

- [ +

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

+
<% end %> -
+ <%= link_to "Download", @file.url, class: 'button' %> -

- <%= link_to "Download", @file.url %> -

-
+
+

Related Files

-
-

- Related Files -

- -
Name Path
<%= namelink file %> <%= h file.url %> <%= file.size_s %>
- - - - - - - <% @file.related_files.each do |related| %> +
NameSizeMD5Modified
- - - - + + + + - <% end %> -
- <%= link_to (h related.name.filename), related.name.url %> - - <%= related.size_s %> MB - - <%= related.md5_s %> - - <%= shorttime related.created_at %> - NameSizeMD5Modified
+ <% @file.related_files.each do |related| %> + + + <%= link_to (h related.name.filename), related.name.url %> + + + <%= related.size_s %> MB + + + <%= related.md5_s %> + + + <%= shorttime related.created_at %> + + + <% end %> + +
<%= add_comments @file %> diff --git a/app/views/forums/_form.html.erb b/app/views/forums/_form.html.erb index d7acfba..9158236 100644 --- a/app/views/forums/_form.html.erb +++ b/app/views/forums/_form.html.erb @@ -1,71 +1,74 @@ -
- <%= form_for(@forum) do |f| %> -
-
    - <% @forum.errors.full_messages.each do |msg| %> -
  • <%= msg %>
  • - <% end %> -
-
+
+ <%= form_for(@forum, html: { class: 'square' }) do |f| %> + <%= render 'shared/errors', messages: @forum.errors.full_messages %> -

- <%= f.label :title %>
+

+ <%= f.label :title %> <%= f.text_field :title %> -

-

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

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

-

- <%= f.label :category %>
+

+
+ <%= f.label :category %> <%= f.select :category_id, Category.domain(Category::DOMAIN_FORUMS).ordered.collect{|c| [c, c.id]} %> -

-

+

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

+
<% end %> -
-<% unless @forum.new_record? %> -
-

- Access Rights -

- - If no groups are specified, everyone is allowed for the specific access type. - - + <% unless @forum.new_record? %> +

Access Rights

+

If no groups are specified, everyone is allowed for the specific access type.

+ +
- - - + + + <% @forum.forumers.each do |forumer| %> - - <%= form_for forumer do |g| %> - - - - <% end %> + + + + <% end %>
GroupAccess LevelOptionsGroupAccess LevelOptions
<%= namelink forumer.group %> - <%= g.select :access, forumer.accesses.invert, :size => 20 %> - - <%= link_to_function "Update", "$('edit_forumer_#{forumer.id}').submit()" %> - <%= link_to "Remove", forumer, :method => :delete %> -
<%= namelink forumer.group %> + <%= form_for forumer do |g| %> +
+ <%= g.select :access, forumer.accesses.invert, size: 20 %> +
+ <% end %> +
+ <%= content_tag :a, { class: 'button tiny', data: { forumer: forumer.id } } do %> + Update + <% end %> + <%= link_to "Remove", forumer, method: :delete, class: 'button tiny' %> +
- <%= 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 %> -

- <%= f.label :group_id %>
+ +

+

Grant Access

<%= f.select :group_id, Group.all.collect{|g| [g, g.id]} %> <%= f.select :access, f.object.accesses.invert, :size => 20 %> - <%= f.submit "Add" %> -

+
+
+ <%= f.submit "Add" %> +
<% end %> -
-<% end %> + <% end %> + + +
diff --git a/app/views/forums/edit.html.erb b/app/views/forums/edit.html.erb index 9dab230..6cb015d 100644 --- a/app/views/forums/edit.html.erb +++ b/app/views/forums/edit.html.erb @@ -1,6 +1,3 @@

Editing forum

<%= render :partial => "form" %> - -<%= link_to 'Show', @forum %> | -<%= link_to 'Back', forums_path %> \ No newline at end of file diff --git a/app/views/forums/new.html.erb b/app/views/forums/new.html.erb index b990650..c87ade8 100644 --- a/app/views/forums/new.html.erb +++ b/app/views/forums/new.html.erb @@ -1,5 +1,3 @@

New Forum

<%= render partial: "form" %> - -<%= link_to 'Back', forums_path, class: 'button' %> \ No newline at end of file diff --git a/app/views/messages/new.html.erb b/app/views/messages/new.html.erb index 05bc7e5..392f0bd 100644 --- a/app/views/messages/new.html.erb +++ b/app/views/messages/new.html.erb @@ -20,7 +20,7 @@
<%= f.label :text %> - <%= f.text_area :text %> + <%= f.text_area :text, rows: 15 %>
<%= f.submit 'Send Message' %> diff --git a/app/views/posts/_form.html.erb b/app/views/posts/_form.html.erb index 1de4288..ce16632 100644 --- a/app/views/posts/_form.html.erb +++ b/app/views/posts/_form.html.erb @@ -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 %> -

- Topic: <%= namelink @post.topic %> -

-

- <%= f.text_area :text, :rows => 15, :cols => 108 %> -

-

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

+
+ <%= f.label :topic %> +
+ <%= namelink @post.topic %> +
+
+
+ <%= f.label :text %> + <%= f.text_area :text, rows: 20 %> +
+
+ <%= f.submit 'Save Post' %> +
<% end %> diff --git a/app/views/posts/edit.html.erb b/app/views/posts/edit.html.erb index cf8884a..46703c1 100644 --- a/app/views/posts/edit.html.erb +++ b/app/views/posts/edit.html.erb @@ -2,4 +2,4 @@ <%= render :partial => "form" %> -<%= link_to 'Back to topic', @post.topic %> \ No newline at end of file +<%= link_to 'Back to topic', @post.topic, class: 'button tiny' %> \ No newline at end of file diff --git a/app/views/posts/new.html.erb b/app/views/posts/new.html.erb index 03c448b..42c5a72 100644 --- a/app/views/posts/new.html.erb +++ b/app/views/posts/new.html.erb @@ -1,5 +1,3 @@ -

New post

+

New Post

-<%= render :partial => "form" %> - -<%= link_to 'Back', posts_path %> \ No newline at end of file +<%= render partial: "form" %> diff --git a/app/views/topics/edit.html.erb b/app/views/topics/edit.html.erb index cdef67b..64b69a2 100644 --- a/app/views/topics/edit.html.erb +++ b/app/views/topics/edit.html.erb @@ -1,25 +1,21 @@ -

Editing topic

+

Editing Topic

-
- <%= form_for(@topic) do |f| %> - <%= f.error_messages %> +<%= form_for(@topic, html: { class: 'square' }) do |f| %> + <%= render 'shared/errors', messages: @topic.errors.full_messages %> -

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

-

- <%= f.label :forum_id %>
- <%= f.select :forum_id, Forum.all.collect{|forum| [forum, forum.id]} %> -

-

- <%= f.label :state %>
- <%= f.select :state, f.object.states.invert %> -

-

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

- <% end %> -
- -<%= link_to 'Back', @topic %> +
+ <%= f.label :title %> + <%= f.text_field :title %> +
+
+ <%= f.label :forum_id %> + <%= f.select :forum_id, Forum.all.collect{|forum| [forum, forum.id]} %> +
+
+ <%= f.label :state %> + <%= f.select :state, f.object.states.invert %> +
+
+ <%= f.submit 'Update Topic' %> +
+<% end %> diff --git a/app/views/topics/new.html.erb b/app/views/topics/new.html.erb index edfaa38..ee50521 100644 --- a/app/views/topics/new.html.erb +++ b/app/views/topics/new.html.erb @@ -1,21 +1,28 @@ -

New topic

+

New Topic

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

- <%= f.label :title %>
- <%= f.text_field :title, :size => 50 %> -

+
+ <%= f.label :forum %> +
+ <%= @topic.forum %> +
+
-

- <%= f.text_area :first_post, :rows => 15, :cols => 108 %> -

+
+ <%= f.label :title %> + <%= f.text_field :title, size: 50 %> +
-

- <%= f.submit 'Create the topic' %> -

+
+ <%= f.label :post %> + <%= f.text_area :first_post, rows: 15 %> +
+ +
+ <%= f.submit 'Create Topic' %> +
<% end %> - -<%= link_to 'Back', @topic.forum %> \ No newline at end of file diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 4ab5548..8748e3b 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -1,171 +1,174 @@ -

Account: <%= h @user.username %>

+
+

Account: <%= h @user.username %>

-<%= form_for @user, html: { multipart: true, id: 'profile', class: 'square' } do |f| %> - <% f.fields_for :profile do |p| %> -
- + <%= render 'shared/errors', messages: @user.errors.full_messages %> -
-
- <% if @user.errors.any? %> -
- <%= pluralize(@user.errors.count, t(:error)) %> -
    - <% @user.errors.full_messages.each do |msg| %> -
  • <%= msg %>
  • - <% end %> -
+ <%= form_for @user, html: { multipart: true, id: 'profile', class: 'square' } do |f| %> + <% f.fields_for :profile do |p| %> +
+ + +
+
+
+ <%= f.label :username, 'Username', class: 'required' %> + <%= f.text_field :username %> +
+
+ <%= f.label :raw_password, "Password" %> + <%= f.password_field :raw_password %> +
+
+ <%= f.label :email do %> +

Email

+ (only visible to admins) + <% end %> + <%= f.text_field :email %> +
+
+ <%= f.label :public_email %> + <%= f.check_box :public_email %> + <%= f.label :public_email, class: 'checkbox' %> +
+
+ <%= f.label :steamid %> + <%= f.text_field :steamid, html: { placeholder: 'http://steamcommunity.com/id/...' } %> +
+
+ <%= f.label :firstname do %> +

First Name

+ (only visible to members) + <% end %> + <%= f.text_field :firstname %> +
+
+ <%= f.label :lastname do %> +

Last Name

+ (only visible to members) + <% end %> + <%= f.text_field :lastname %> +
+
+ <%= f.label :birthdate %> +
+ <%= date_select :user, :birthdate, order: [:year, :month, :day], default: @user.birthdate, start_year: 1950 %> +
- <% end %> -
- <%= f.label :username, 'Username', class: 'required' %> - <%= f.text_field :username %>
-
- <%= f.label :raw_password, "Password" %> - <%= f.password_field :raw_password %> + +
+
+ <%= p.label :steam_profile, "Steam Profile URL" %> + <%= p.text_field :steam_profile %> +
+
+ <%= p.label :web %> + <%= p.text_field :web %> +
+
+ <%= p.label :achievements %> + <%= p.text_area :achievements, rows: 5 %> +
+ +
+ <%= p.label :signature %> + <%= p.text_area :signature, rows: 5 %> +
+ +
+ + <%= p.file_field :avatar %> +
-
- <%= f.label :email do %> -

Email

- (only visible to admins) - <% end %> - <%= f.text_field :email %> + +
+
+ <%= f.label :country %> +
+ <%= country_code_select :user, :country %> +
+
+
+ <%= p.label :town %> + <%= p.text_field :town %> +
+
+ <%= f.label :time_zone %> +
+ <%= f.time_zone_select :time_zone, ActiveSupport::TimeZone.all %>

+

Daylight savings will be observed automatically.

+
+
-
- <%= f.label :public_email %> - <%= f.check_box :public_email %> -
-
- <%= f.label :steamid %> - <%= f.text_field :steamid, html: { placeholder: 'http://steamcommunity.com/id/...' } %> -
-
- <%= f.label :firstname do %> -

First Name

- (only visible to members) - <% end %> - <%= f.text_field :firstname %> -
-
- <%= f.label :lastname do %> -

Last Name

- (only visible to members) - <% end %> - <%= f.text_field :lastname %> -
-
- <%= f.label :birthdate %> -
- <%= date_select :user, :birthdate, order: [:year, :month, :day], default: @user.birthdate, start_year: 1950 %> + +
+

Notify me when...

+ +
+ <%= p.label :notify_news, "News item are posted" %> + <%= p.check_box :notify_news %> + <%= p.label :notify_news, class: 'checkbox' %> +
+ +
+ <%= p.label :notify_articles, "New articles" %> + <%= p.check_box :notify_articles %> + <%= p.label :notify_articles, class: 'checkbox' %> +
+ +
+ <%= p.label :notify_movies, "New movies" %> + <%= p.check_box :notify_movies %> + <%= p.label :notify_movies, class: 'checkbox' %> +
+ +
+ <%= p.label :notify_gather, "Gather has 6 players" %> + <%= p.check_box :notify_gather %> + <%= p.label :notify_gather, class: 'checkbox' %> +
+ +
+ <%= p.label :notify_own_match, "My team's matches" %> + <%= p.check_box :notify_own_match %> + <%= p.label :notify_own_match, class: 'checkbox' %> +
+ +
+ <%= p.label :notify_any_match, "New matches" %> + <%= p.check_box :notify_any_match %> + <%= p.label :notify_any_match, class: 'checkbox' %> +
+ +
+ <%= p.label :notify_challenge, "New challenges" %> + <%= p.check_box :notify_challenge %> + <%= p.label :notify_challenge, class: 'checkbox' %> +
+ +
+ <%= p.label :notify_pms, "Private messages" %> + <%= p.check_box :notify_pms %> + <%= p.label :notify_pms, class: 'checkbox' %>
-
-
- <%= p.label :steam_profile, "Steam Profile URL" %> - <%= p.text_field :steam_profile %> -
-
- <%= p.label :web %> - <%= p.text_field :web %> -
-
- <%= p.label :achievements %> - <%= p.text_area :achievements, rows: 5 %> -
- -
- <%= p.label :signature %> - <%= p.text_area :signature, rows: 5 %> -
- -
- - <%= p.file_field :avatar %> -
-
- -
-
- <%= f.label :country %> -
- <%= country_code_select :user, :country %> -
-
-
- <%= p.label :town %> - <%= p.text_field :town %> -
-
- <%= f.label :time_zone %> -
- <%= f.time_zone_select :time_zone, ActiveSupport::TimeZone.all %>

-

Daylight savings will be observed automatically.

-
-
-
- -
-

Notify me when...

- -
- <%= p.label :notify_news, "News item are posted" %> - <%= p.check_box :notify_news %> -
- -
- <%= p.label :notify_articles, "New articles" %> - <%= p.check_box :notify_articles %> -
- -
- <%= p.label :notify_movies, "New movies" %> - <%= p.check_box :notify_movies %> -
- -
- <%= p.label :notify_gather, "Gather has 6 players" %> - <%= p.check_box :notify_gather %> -
- -
- <%= p.label :notify_own_match, "My team's matches" %> - <%= p.check_box :notify_own_match %> -
- -
- <%= p.label :notify_any_match, "New matches" %> - <%= p.check_box :notify_any_match %> -
- -
- <%= p.label :notify_challenge, "New challenges" %> - <%= p.check_box :notify_challenge %> -
- -
- <%= p.label :notify_pms, "Private messages" %> - <%= p.check_box :notify_pms %> -
+
+ <%= f.submit %>
- -
- <%= f.submit %> -
-
+ <% end %> <% end %> -<% end %> - + +
\ No newline at end of file