mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-01-13 21:31:28 +00:00
Improved forms and error styling
Revert colour changes
This commit is contained in:
parent
63ec5d86fa
commit
8eac4abebe
8 changed files with 106 additions and 46 deletions
|
@ -47,7 +47,9 @@ $blue: #5a9aa8;
|
||||||
$purple: #6a5a8c;
|
$purple: #6a5a8c;
|
||||||
$gold: #FFD700;
|
$gold: #FFD700;
|
||||||
|
|
||||||
|
$dark-blue: #046;
|
||||||
$dark-gray: #232323;
|
$dark-gray: #232323;
|
||||||
|
|
||||||
$medium-gray: #2e2e2e;
|
$medium-gray: #2e2e2e;
|
||||||
|
|
||||||
$light-blue: #F3F3FB;
|
$light-blue: #F3F3FB;
|
||||||
|
|
|
@ -32,3 +32,34 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Error Messages
|
||||||
|
*/
|
||||||
|
|
||||||
|
div#errors {
|
||||||
|
@extend .flash.error;
|
||||||
|
@include span-columns(12);
|
||||||
|
margin-bottom: em(20);
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
strong {
|
||||||
|
@include span-columns(12);
|
||||||
|
margin-bottom: em(10);
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.errors {
|
||||||
|
@include span-columns(12);
|
||||||
|
|
||||||
|
li {
|
||||||
|
margin-bottom: .5em;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -101,6 +101,11 @@ form.dark {
|
||||||
|
|
||||||
form.square {
|
form.square {
|
||||||
@include span-columns(12);
|
@include span-columns(12);
|
||||||
|
margin: em(20) 0;
|
||||||
|
|
||||||
|
.horizontal {
|
||||||
|
@include span-columns(12);
|
||||||
|
margin-bottom: em(20);
|
||||||
|
|
||||||
&.small {
|
&.small {
|
||||||
@include span-columns(6);
|
@include span-columns(6);
|
||||||
|
@ -115,13 +120,17 @@ form.square {
|
||||||
}
|
}
|
||||||
|
|
||||||
> .field_with_errors:first-child,
|
> .field_with_errors:first-child,
|
||||||
> label {
|
> label,
|
||||||
|
> .label {
|
||||||
@include span-columns(3);
|
@include span-columns(3);
|
||||||
|
padding: em(11) 0;
|
||||||
|
line-height: em(16);
|
||||||
}
|
}
|
||||||
|
|
||||||
input {
|
input {
|
||||||
@include span-columns(9);
|
@include span-columns(9);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.controls {
|
.controls {
|
||||||
@include span-columns(9);
|
@include span-columns(9);
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
background: lighten($blue, 10);
|
background: $dark-blue;
|
||||||
@include background-image(linear-gradient(lighten($blue, 10), $medium-gray));
|
@include background-image(linear-gradient($dark-blue, $medium-gray));
|
||||||
}
|
}
|
||||||
|
|
||||||
%container-padded {
|
%container-padded {
|
||||||
|
|
|
@ -53,7 +53,7 @@ class UsersController < ApplicationController
|
||||||
if @user.valid? and @user.save
|
if @user.valid? and @user.save
|
||||||
@user.profile = Profile.new
|
@user.profile = Profile.new
|
||||||
@user.profile.user = @user
|
@user.profile.user = @user
|
||||||
@user.profile.save()
|
@user.profile.save
|
||||||
redirect_to action: :show, id: @user.id
|
redirect_to action: :show, id: @user.id
|
||||||
save_session @user
|
save_session @user
|
||||||
else
|
else
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="author">
|
<div class="author">
|
||||||
<%= flag(article.user.country) %> <%= namelink(article.user) %> on <%= longtime article.created_at %>
|
<%= namelink(article.user) %> on <%= longtime article.created_at %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
|
|
11
app/views/shared/_errors.html.erb
Normal file
11
app/views/shared/_errors.html.erb
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<% if messages.size > 0 %>
|
||||||
|
<div id="errors">
|
||||||
|
<strong><%= t('errors.template.header') %></strong>
|
||||||
|
|
||||||
|
<ul class="errors">
|
||||||
|
<% messages.each do |msg| %>
|
||||||
|
<li><%= msg %></li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
|
@ -1,28 +1,35 @@
|
||||||
<div class="wide box">
|
<div id="registration">
|
||||||
<h2>Registration</h2>
|
<h1>Registration</h1>
|
||||||
<%= form_for @user do |f| %>
|
|
||||||
<%= f.error_messages %>
|
<%= link_to "You can use this tool to find your SteamID.", "/files/client/steamid_finder.exe" %>
|
||||||
<p>
|
|
||||||
<%= f.label :username %><br />
|
<%= form_for @user, html: { class: "square" } do |f| %>
|
||||||
|
<%= render 'shared/errors', messages: @user.errors.full_messages %>
|
||||||
|
|
||||||
|
<div class="fields">
|
||||||
|
<div class="horizontal text-field">
|
||||||
|
<%= f.label :username %>
|
||||||
<%= f.text_field :username %>
|
<%= f.text_field :username %>
|
||||||
</p>
|
</div>
|
||||||
<p>
|
<div class="horizontal text-field">
|
||||||
<%= f.label :raw_password, "Password" %><br />
|
<%= f.label :raw_password, "Password" %>
|
||||||
<%= f.password_field :raw_password %>
|
<%= f.password_field :raw_password %>
|
||||||
</p>
|
</div>
|
||||||
<p>
|
<div class="horizontal text-field">
|
||||||
<%= f.label :email %><br />
|
<%= f.label :email %>
|
||||||
<%= f.text_field :email %>
|
<%= f.text_field :email %>
|
||||||
</p>
|
</div>
|
||||||
<p>
|
<div class="horizontal text-field">
|
||||||
<%= f.label :steamid %> <em>(e.g. 0:1:23456789)</em><br>
|
<%= f.label :steamid %>
|
||||||
<%= f.text_field :steamid %><br />
|
<%= f.text_field :steamid, placeholder: "0:1:23456789" %>
|
||||||
<%= link_to "You can use this tool to find out", "/files/client/steamid_finder.exe" %>
|
</div>
|
||||||
</p>
|
<div class="horizontal">
|
||||||
<p>
|
<%= f.label :birthdate %>
|
||||||
<%= f.label :birthdate %><br />
|
<%= date_select :user, :birthdate, order: [:year, :month, :day], start_year: 1950 %>
|
||||||
<%= date_select :user, :birthdate, :order => [:year, :month, :day], :start_year => 1950 %>
|
</div>
|
||||||
</p>
|
</div>
|
||||||
|
<div class="controls submit-field">
|
||||||
<%= f.submit "Register" %>
|
<%= f.submit "Register" %>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue