Skip to content

Commit 9d31bb1

Browse files
committed
Migate login form to Bootrstrap 4
1 parent 290a1a9 commit 9d31bb1

File tree

3 files changed

+19
-30
lines changed

3 files changed

+19
-30
lines changed

app/assets/stylesheets/sessions.css

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,11 @@
1010
margin: 30px auto;
1111
}
1212

13-
.login-container input {
14-
display: block;
15-
width: 100%;
16-
padding: 10px;
17-
box-sizing: border-box;
18-
margin: 15px 0;
19-
height: 40px;
20-
}
21-
22-
.login-container input:focus {
23-
box-shadow: none;
24-
}
25-
26-
.login-container input.btn {
27-
background-color: #3498db !important;
28-
background-image: none;
29-
transition: background-color .4s;
30-
font-weight: bold;
31-
}
32-
33-
.login-container input.btn:hover {
34-
background-color: #2980b9 !important;
35-
background-image: none;
13+
.login-container h1 {
14+
margin-bottom: 20px;
3615
}
3716

38-
.login-container h1 {
17+
.login-form-button {
18+
width: 100%;
3919
margin-bottom: 20px;
4020
}
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<h1>Forgot password</h1>
22

33
<%= form_tag password_reset_keys_path do %>
4-
<%= labeled_field('E-mail: ', text_field_tag(:email)) %>
5-
<%= submit_tag 'Send password reset link' %>
4+
<div class="form-group">
5+
<label for='email'>Email</label>
6+
<%= text_field_tag :email, nil, class: 'form-control', id: 'email', placeholder: 'Email' %>
7+
</div>
8+
<%= submit_tag 'Send password reset link', class: 'btn btn-primary' %>
69
<% end %>
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
<%= form_for :session, :url => sessions_path, html: { class: 'login-form' } do |f| %>
2-
<%= f.text_field :login, class: 'span2', placeholder: 'Username' %>
3-
<%= f.password_field :password, class: 'span2', placeholder: 'Password' %>
4-
<%= f.submit "Sign in", class: "btn btn-primary" %>
1+
<%= form_for :session, :url => sessions_path, html: { class: '' } do |f| %>
2+
<div class='form-group'>
3+
<label for='username'>Username</label>
4+
<%= f.text_field :login, class: 'form-control', id: 'username', placeholder: 'Username' %>
5+
</div>
6+
<div class='form-group'>
7+
<label for='password'>Password</label>
8+
<%= f.password_field :password, class: 'form-control', id: 'password', placeholder: 'Password' %>
9+
</div>
10+
<%= f.submit "Sign in", class: "btn btn-primary login-form-button" %>
511
<% end %>

0 commit comments

Comments
 (0)