Skip to content

Commit 3639744

Browse files
ipweblabVidas P
authored andcommitted
Tidier User Settings page and add helpful messages to user forms
1 parent 5facaec commit 3639744

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

app/assets/stylesheets/forms.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ label[required] {
1111
.help-inline {
1212
font-size: 0.8rem;
1313
font-style: italic;
14-
line-height: 1.1;
14+
line-height: 1.3;
15+
display: inline-flex;
16+
color: $info;
1517
}
1618

1719
.btn-lg, .btn-group-lg > .btn {

app/assets/stylesheets/login.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010

1111
.sessions,
1212
.passwords,
13-
.unlocks,
14-
.registrations {
13+
.unlocks {
1514

1615
.logo {
1716
margin: 40px auto;

app/views/devise/registrations/_common_registration_fields.html.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
<%= f.label :username, class: 'control-label' %>
1010
<div>
1111
<%= f.text_field :username, class: 'form-control' %>
12+
<span class='help-inline'>3-190 characters: only letters, numbers, underscores, and dashes.</span>
1213
</div>
1314
</div>
1415

1516
<div class="form-group">
1617
<%= f.label :password, class: 'control-label' %>
1718
<div>
1819
<%= f.password_field :password, autocomplete: "off", class: 'form-control' %>
19-
<% if @validatable %><span class="help-inline"><%= @minimum_password_length %> characters minimum.</span><% end %>
20+
<span class='help-inline'>Minimum 8 characters.</span>
2021
</div>
2122
</div>
2223

app/views/devise/registrations/edit.html.erb

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
<% content_for :title, "Account" -%>
22

33
<div class="container">
4-
<div class="row">
5-
<p>If you want to access ActiveWorkflow via the REST API the token for your user is:
6-
<pre><code class="text-info"><%= JsonWebToken.encode(user_id: current_user.id) %></code></pre>
7-
</p>
4+
<div class="row mt-3 mb-5">
5+
<div class="col-md-12">
6+
<p><em>If you want to access ActiveWorkflow via the REST API, the token for your user is:</em>
7+
<pre><code class="text-info"><%= JsonWebToken.encode(user_id: current_user.id) %></code></pre>
8+
</p>
9+
</div>
10+
</div>
811

12+
<div class="row">
913
<div class="col-md-6">
1014

1115
<h2>Edit <%= resource_name.to_s.humanize %></h2>
@@ -16,6 +20,7 @@
1620
<%= f.label :email, class: 'control-label' %>
1721
<div>
1822
<%= f.email_field :email, autofocus: true, class: 'form-control' %>
23+
<span class='help-inline'></span>
1924
</div>
2025
</div>
2126

@@ -27,6 +32,7 @@
2732
<%= f.label :username, class: 'control-label' %>
2833
<div>
2934
<%= f.text_field :username, class: 'form-control' %>
35+
<span class='help-inline'>3-190 characters: only letters, numbers, underscores, and dashes.</span>
3036
</div>
3137
</div>
3238

@@ -64,13 +70,15 @@
6470
<%= f.label :password, class: 'control-label' %>
6571
<div>
6672
<%= f.password_field :password, autocomplete: "off", class: 'form-control' %>
73+
<span class='help-inline'>Minimum 8 characters.</span>
6774
</div>
6875
</div>
6976

7077
<div class="form-group">
7178
<%= f.label :password_confirmation, class: 'control-label' %>
7279
<div>
7380
<%= f.password_field :password_confirmation, autocomplete: "off", class: 'form-control' %>
81+
<span class='help-inline'></span>
7482
</div>
7583
</div>
7684

0 commit comments

Comments
 (0)