Skip to content

Commit

Permalink
Merge fa1f89d into 94a6a1d
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonpettus committed Jul 19, 2015
2 parents 94a6a1d + fa1f89d commit 0032b74
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 24 deletions.
17 changes: 17 additions & 0 deletions app/assets/stylesheets/evening-edition.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,20 @@ p {
padding: 0.75em;
border-radius: 15px 15px 0 0;
}

.form_box {
text-align: center;
margin: auto;
padding: 4em;
}

.form_box input {
font-family: 'Lusitana', serif;
font-size: 1.25em;
width: 40%;
}

.login_box input {
font-family: 'Lusitana', serif;
font-size: 12px;
}
1 change: 1 addition & 0 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def create

def new
@user = User.new
@page_name = "Create Account"
end

def show
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ def user_logged_in?
end

def current_user
user_logged_in ? nil : User.find(session['user_id'])
user_logged_in? ? User.find(session['user_id']) : nil
end
end
2 changes: 1 addition & 1 deletion app/views/application/_drawerbanner.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
</div>

<header class="mdl-layout__header mdl-color--orange-300">
<span id="banner" class="mdl-typography--display-3">World</span>
<span id="banner" class="mdl-typography--display-3"><%= page_name %></span>
</header>
8 changes: 8 additions & 0 deletions app/views/application/_login.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="form_box">
<%= form_tag("/users/login", method: 'POST') do %>
<p><%= text_field_tag "email", placeholder: "Email" %></p>
<p><%= text_field_tag "password", placeholder: "Password" %></p>
<p><%= text_field_tag "password_confirmation", placeholder: 'Password Confirmation' %></p>
<p><%= submit_tag "Login" %></p>
<% end %>
</div>
7 changes: 4 additions & 3 deletions app/views/application/_masthead.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
<div class="login mdl-color--orange-900">
<span class="mdl-typography--caption">
<% if user_logged_in? %>
<%= link_to "Log out", users_logout_path %>
Personalized for <%= current_user.email %> / <%= link_to "Log out", users_logout_path %>
<% else %>
Members receive personalized subscriptions,
personalized sections, and personalized delivery times.<br>
<%= link_to "Create a free account", users_new_path %> or <%= link_to "log in", users_login_path %> now.
personalized sections, and personalized delivery times.
<%= link_to "Create a free account now.", users_new_path %><br>
<%= render 'login' %>
<% end %>
</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<body>

<%= render "application/masthead" %>
<%= render "application/drawerbanner" %>
<%= render partial: "application/drawerbanner", locals: {page_name: @page_name} %>
<main class="mdl-layout__content">
<div class="page-content mdl-color--blue-grey">
<%= yield %>
Expand Down
Binary file added app/views/users/.DS_Store
Binary file not shown.
13 changes: 7 additions & 6 deletions app/views/users/_login.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<%= form_tag("/users/login", method: 'POST') do %>
<%= text_field_tag "email", placeholder: "Email" %>
<%= text_field_tag "password", placeholder: "Password" %>
<%= text_field_tag "password_confirmation", placeholder: 'Password Confirmation' %>
<%= submit_tag "Login" %>
<% end %>
<div class="login_box">
<%= form_tag("/users/login", method: 'POST') do %>
<%= text_field_tag 'email', nil, placeholder: 'Email' %>
<%= text_field_tag 'password', nil, placeholder: 'Password' %>
<%= submit_tag 'Login' %>
<% end %>
</div>
26 changes: 14 additions & 12 deletions app/views/users/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<% if @user.errors.any? %>
<ul>
<% @user.errors.full_messages.each do |error_message| %>
<li><%= error_message %></li>
<% end %>
</ul>
<% end %>
<div class="form_box">
<% if @user.errors.any? %>
<ul>
<% @user.errors.full_messages.each do |error_message| %>
<li><%= error_message %></li>
<% end %>
</ul>
<% end %>
<%= form_for @user do |f| %>
<%= f.text_field :email, placeholder: 'email' %>
<%= f.text_field :password, placeholder: 'password' %>
<%= f.submit value: 'Create Account' %>
<% end %>
<%= form_for @user do |f| %>
<p><%= f.text_field :email, placeholder: 'email' %></p>
<p><%= f.text_field :password, placeholder: 'password' %></p>
<p><%= f.submit value: 'Create Account' %></p>
<% end %>
</div>
1 change: 1 addition & 0 deletions app/views/users/show.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

0 comments on commit 0032b74

Please sign in to comment.