Merge pull request #2430 from TracksApp/login_form_styles

Signup form styles
This commit is contained in:
Jyri-Petteri Paloposki 2020-07-20 18:38:55 +03:00 committed by GitHub
commit 0ff46f63dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 70 additions and 28 deletions

View file

@ -19,11 +19,17 @@ body {
@include make-sm-column-offset(3);
margin: 2em auto 1em;
background-color: rgba(0, 0, 0, 0.75);
color: #eaeaea;
padding: 0 0 1em 0;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), 0 2px 3px rgba(0, 0, 0, 0.3);
color: #eaeaea;
a {
color: #eaeaea;
text-decoration: underline;
}
}
@media(min-width: $screen-sm-min) {
.login-box {
border-radius: 5px;
@ -34,7 +40,7 @@ body {
padding: 1em 0;
}
.login-form {
.login-form, .signup-form {
@include make-xs-column(12);
@include make-sm-column(8);
@include make-sm-column-offset(2)

View file

@ -76,10 +76,14 @@ class UsersController < ApplicationController
return
end
unless params['approve_tos'] == 'on' || SITE_CONFIG['tos_link'].blank?
render_failure "You have to accept the terms of service to sign up!"
return
end
user = User.new(user_params)
unless user.valid?
session['new_user'] = user
redirect_to signup_path
return
end
@ -106,6 +110,11 @@ class UsersController < ApplicationController
render_failure "Expected post format is valid xml like so: <user><login>username</login><password>abc123</password></user>.", 400
return
end
unless user_params['approve_tos'] == 'on' || SITE_CONFIG['tos_link'].blank?
render_failure "You have to accept the terms of service to sign up!"
return
end
user = User.new(user_params)
user.password_confirmation = user_params[:password]
saved = user.save

View file

@ -1,31 +1,51 @@
<div title="<%= t('users.account_signup') %>" id="signupform" class="form">
<%= form_tag :action=> "create" do %>
<div class="container-fluid">
<div class="row">
<div class="login-flash">
<%= bootstrap_flash :close_button => false %>
</div>
</div>
<div class="login-wrapper">
<div class="login-box">
<div class="icon-box">
<div class="tracks-icon"><div class="tracks-icon-text">10</div>
</div>
<div title="<%= t('users.account_signup') %>" id="signupform" class="signup-form" class="form">
<%= form_tag :action=> "create" do %>
<%= get_list_of_error_messages_for @user %><br/>
<%= get_list_of_error_messages_for @user %><br/>
<%= render_flash %>
<%= render_flash %>
<h3><%= @heading -%></h3>
<h3><%= @heading -%></h3>
<table>
<tr>
<td><label for="user_login"><%= t('users.desired_login') %>:</label></td>
<td> <%= text_field "user", "login", :size => 20 %></td>
</tr>
<tr>
<td><label for="user_password"><%= t('users.choose_password') %>:</label></td>
<td><%= password_field "user", "password", :size => 20 %></td>
</tr>
<tr>
<td><label for="user_password_confirmation"><%= t('users.confirm_password') %>:</label></td>
<td><%= password_field "user", "password_confirmation", :size => 20 %></td>
</tr>
<tr>
<td></td>
<td><input type="submit" id="signup" value="<%= t('users.signup') %> &#187;" class="primary" /></td>
</tr>
</table>
<%end-%>
<div class="label-element-combo">
<%= label_tag "user_login", t('users.desired_login') %>
<%= text_field "user", "login", class: "form-control" %>
</div>
<div class="label-element-combo">
<%= label_tag "user_password", t('users.choose_password') %>
<%= password_field "user", "password", class: "form-control" %>
</div>
<div class="label-element-combo">
<%= label_tag "user_password_confirmation", t('users.confirm_password') %>
<%= password_field "user", "password_confirmation", class: "form-control" %>
</div>
<% unless SITE_CONFIG['tos_link'].blank? -%>
<div class="label-element-combo">
<div class="checkbox">
<input name="approve_tos" id="approve_tos" type="checkbox" />
<label for="approve_tos"><%= t("users.approve_tos") %></label>
(<a href="<%= SITE_CONFIG['tos_link'] %>"><%= t('users.tos_link') %></a>)
</div>
</div>
<% end -%>
<%= submit_tag t("users.signup"), class: "btn btn-default" %>
<% end %>
</div>
</div>
</div>
<div class="footer">
<%= render :partial => "shared/footer" %>
</div>
</div>

View file

@ -978,6 +978,8 @@ en:
change_authentication_type: Change authentication type
total_notes: Total notes
select_authentication_type: Select your new authentication type and click 'Change authentication type' to replace your current settings.
approve_tos: I approve the Terms of Service
tos_link: read the Terms of Service
feedlist:
choose_context: Choose the context you want a feed of
actions_due_today: Actions due today or earlier

View file

@ -42,6 +42,9 @@ force_ssl: false
# Set to true to allow anyone to sign up for a username.
open_signups: false
# Set to require TOS approval on signup.
#tos_link: "https://www.example.com"
# When integrating your tracks instance with http://cloudmailin.com/ by using
# the /integrations/cloudmailin URL, this value is the cloudmailin-secret for
# verifying the authenticity of the request.

View file

@ -48,6 +48,8 @@ force_ssl: false
# Set to true to allow anyone to sign up for a username.
open_signups: false
# Set to require TOS approval on signup.
#tos_link: "https://www.example.com"
# When integrating your tracks instance with http://cloudmailin.com/ by using
# the /integrations/cloudmailin URL, this value is the cloudmailin-secret for