Skip to content

Commit b533339

Browse files
committed
beta release
1 parent d84256c commit b533339

File tree

8 files changed

+103
-29
lines changed

8 files changed

+103
-29
lines changed

app/assets/stylesheets/base/_atom.scss

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ a.link {
197197
color:#fff;
198198
}
199199

200-
#user_email,#user_password,.submit-button{
200+
#user_email,#user_password,#user_password_confirmation,.submit-button{
201201
width:95%;
202202
font-size:18px;
203203
height:2em;
@@ -245,3 +245,12 @@ a.link {
245245
background-color:$medium-black;
246246
color:$silver;
247247
}
248+
.requirements {
249+
padding: 0 10px 0 10px;
250+
color: #999;
251+
max-height: 0;
252+
transition: 0.28s;
253+
overflow: hidden;
254+
color: #F44336;
255+
font-style: italic;
256+
}

app/assets/stylesheets/base/_molecule.scss

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -218,39 +218,34 @@ header{
218218
justify-content: center;
219219
flex-direction: column;
220220
.signup-box{
221-
width:40%;
221+
width:60%;
222222
height:60%;
223223
margin-left:auto;
224224
margin-right:auto;
225-
background-color:rgba(255,255,255,0.7);
225+
background-color:#ecf0f1;
226+
box-shadow: 1.5em 1em 1em #000;
227+
border: 0.2em solid #fff;
228+
border-radius: 0.5em;
226229
.signup-subox{
227230
margin:10%;
231+
margin-top: 5%;
228232
h2{
229233
margin:0;
230234
}
231-
.user-email,.user-password{
232-
width:95%;
233-
height:0.5em;
234-
text-indent:1em;
235+
#user_email,#user_password,#user_password_confirmation{
236+
margin:0.5em;
235237
}
236238
.signup-button{
237239
width:95%;
238240
height:2em;
239241
background-color:$green;
240242
color:#fff;
241243
font-size:1em;
242-
border:none
244+
border:none;
245+
margin:0.5em;
243246
}
244247
}
245248
}}
246-
247-
.user-pass-confirm{
248-
width:95%;
249-
height:2.5em;
250-
text-indent:10px;
251-
margin-top:1em;
252-
margin-bottom: 2em;
253-
}
254249
.forgot-wrapper{
255250
width:100%;
256251
height:100%;

app/assets/stylesheets/base/_page.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,19 @@ ul#tabs {
3636
.github-button{
3737

3838
}
39+
.login_user,#new_user{
40+
>.field>#user_email,
41+
>.field>#user_password{
42+
&:valid{
43+
border-color: #2ecc71;
44+
}
45+
&:invalid:not(:focus):not(:placeholder-shown) {
46+
}
47+
&:invalid:focus:not(:placeholder-shown) {
48+
& ~ .requirements {
49+
max-height: 200px;
50+
padding: 0 10px 10px 10px;
51+
}
52+
}
53+
}
54+
}

app/assets/stylesheets/base/_template.scss

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ html {
66
height: 100%;
77
margin: 0;
88
font-family: $font;
9-
font-size: 10px;
109
}
1110

1211
header {
@@ -103,7 +102,7 @@ header {
103102
margin:0;
104103
}
105104
.git-box{
106-
width:50%;
105+
width:70%;
107106
height:50%;
108107
color:$silver;
109108
font-family:$root-font;
@@ -113,7 +112,7 @@ header {
113112
width:100%;
114113
height:100%;
115114
.url-field,{
116-
width:40%;
115+
width:60%;
117116
height:10%;
118117
text-indent: 10px;
119118
}
@@ -140,3 +139,18 @@ header {
140139
}
141140

142141
}
142+
143+
@media screen and (max-width:1000px) {
144+
.signup-wrapper{
145+
.signup-box{
146+
width:100%;
147+
height:100%;
148+
}
149+
}
150+
}
151+
152+
@media only screen and (max-width:55em){
153+
.git-box{
154+
min-width:90%;
155+
}
156+
}

app/helpers/devise_helper.rb

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
module DeviseHelper
2+
def devise_error_messages!
3+
4+
flash_alerts = []
5+
6+
if !flash.empty?
7+
flash_alerts.push(flash[:error]) if flash[:error]
8+
flash_alerts.push(flash[:alert]) if flash[:alert]
9+
flash_alerts.push(flash[:notice]) if flash[:notice]
10+
sentence = I18n.t("devise.failure.invalid") #=> "Invalid email or password."
11+
else
12+
sentence = I18n.t("errors.messages.not_saved",
13+
count: resource.errors.count,
14+
resource: resource.class.model_name.human.downcase)
15+
end
16+
17+
return "" if resource.errors.empty? && flash_alerts.empty?
18+
19+
errors = resource.errors.empty? ? flash_alerts : resource.errors.full_messages
20+
messages = errors.map { |msg| content_tag(:li, msg) }.join
21+
22+
html = <<-HTML
23+
<div class="alert alert-danger">
24+
<div id="error_explanation">
25+
<ul class="message ">#{messages}</ul>
26+
</div>
27+
</div>
28+
HTML
29+
30+
html.html_safe
31+
end
32+
end

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,23 @@
88

99
<div class="field">
1010
<%= f.label :email %><br />
11-
<%= f.email_field :email, autofocus: true, class: "user-email", placeholder: "Email" %>
11+
<%= f.email_field :email,autocomplete:"off",autofocus: true, class: "user-email", placeholder: "Email",required: true %>
12+
<div class=requirements>
13+
Must be a valid email address
14+
</div>
1215
</div>
1316

1417
<div class="field">
1518
<%= f.label :password %>
16-
<% if @minimum_password_length %>
17-
<em>(<%= @minimum_password_length %> characters minimum)</em>
18-
<% end %>
19-
<%= f.password_field :password, autocomplete: "off", class:"user-password", placeholder: "password"%>
19+
<%= f.password_field :password,pattern: "(?=.*[a-z])(?=.*[A-Z]).{6,}",autocomplete: "off", class:"user-password", placeholder: "password", required: true%>
20+
<div class="requirements">
21+
Your password must be at least 6 characters as well as contain at least one uppercase, one lowercase, and one number.
22+
</div>
2023
</div>
2124

2225
<div class="field">
2326
<%= f.label :password_confirmation %>
24-
<%= f.password_field :password_confirmation, autocomplete: "off", class:"user-pass-confirm", placeholder: "Confirm Password"%>
27+
<%= f.password_field :password_confirmation, autocomplete: "off", class:"user-pass-confirm", placeholder: "Confirm Password", required: true%>
2528
</div>
2629

2730
<div class="actions">

app/views/devise/sessions/new.html.erb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,20 @@
1717
<%=image_tag "github.png", class:"github-image"%>
1818
</div>
1919
<p class=login-text>Log in</p>
20-
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
20+
<%= form_for(resource, as: resource_name, url: session_path(resource_name), class: "login_user") do |f| %>
21+
<%= devise_error_messages! %>
2122
<div class="field email-field">
2223
<%= f.label :email %><br/>
23-
<%= f.email_field :email, autofocus: true, class: "user-email",placeholder: "Username" %>
24+
<%= f.email_field :email, autocomplete: "off",autofocus: true, class: "user-email",placeholder: "Username", required: true %>
25+
<div class="requirements">
26+
Must be a valid email address.
27+
</div>
2428
</div>
2529

2630
<div class="field password-field">
2731
<%= f.label :password %><br/>
28-
<%= f.password_field :password, autocomplete: "off", class: "user-password" ,placeholder: "Password"%>
32+
<%= f.password_field :password,autocomplete: "off", class: "user-password" ,placeholder: "Password", required: true%>
33+
2934
</div>
3035

3136
<% if devise_mapping.rememberable? -%>

config/initializers/devise.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
# session. If you need permissions, you should implement that in a before filter.
3535
# You can also supply a hash where the value is a boolean determining whether
3636
# or not authentication should be aborted when the value is not present.
37-
# config.authentication_keys = [:email]
37+
config.authentication_keys = [:email]
3838

3939
# Configure parameters from the request object used for authentication. Each entry
4040
# given should be a request method and it will automatically be passed to the

0 commit comments

Comments
 (0)