-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added style to the Devise views and a Sign out button to the header.
- Loading branch information
Showing
16 changed files
with
251 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
class InlineErrorsBuilder < ActionView::Helpers::FormBuilder | ||
def errors_for(meth, options = {}) | ||
@template.content_tag :p, @object.errors[meth].join('<br>').html_safe, :class => 'help-block' if has_errors?(meth) | ||
end | ||
|
||
def validation_class(meth, *klasses) | ||
klasses << 'has-error' if has_errors?(meth) | ||
klasses.compact.join(' ').html_safe | ||
end | ||
|
||
private | ||
|
||
def has_errors?(meth) | ||
@object.present? ? @object.errors[meth].present? : false | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
module HomeHelper | ||
def resource | ||
current_user || User.new | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<p>Hello <%= @resource.email %>!</p> | ||
|
||
<p>Someone has requested a link to change your password. You can do this through the link below.</p> | ||
|
||
<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @token) %></p> | ||
|
||
<p>If you didn't request this, please ignore this email.</p> | ||
<p>Your password won't change until you access the link above and create a new one.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<div class="clearfix top-space"></div> | ||
<div class="row"> | ||
<div class="col-md-4 col-md-offset-4 panel panel-default"> | ||
<div class="pull-left"> | ||
<h4>Change your password</h4> | ||
</div> | ||
<div class="clearfix"></div> | ||
<hr /> | ||
|
||
<%= form_for resource, :url => user_password_path, | ||
:builder => InlineErrorsBuilder, | ||
:method => :PUT, | ||
:role => :form do |f| %> | ||
<div> | ||
<%= content_tag :div, :class => f.validation_class(:password, "form-group") do %> | ||
<%= f.text_field :password, :placeholder => "New Password", :class => 'form-control', :autofocus => true %> | ||
<%= f.errors_for :password %> | ||
<% end %> | ||
|
||
<%= f.hidden_field :reset_password_token %> | ||
|
||
<div class="form-group or-links"> | ||
<%= f.submit "Change my password", :class => "btn btn-primary pull-left" %> | ||
<div style="padding-top: 8px;"></div> | ||
- or - | ||
<%= link_to "Sign in", new_user_session_path, :class => "pull-right" %><br /> | ||
</div> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<div class="clearfix top-space"></div> | ||
<div class="row"> | ||
<div class="col-md-4 col-md-offset-4 panel panel-default"> | ||
<div class="pull-left"> | ||
<h4>Forgot your password?</h4> | ||
</div> | ||
<div class="clearfix"></div> | ||
<hr /> | ||
|
||
<%= form_for resource, :url => user_password_path, | ||
:builder => InlineErrorsBuilder, | ||
:method => :POST, | ||
:role => :form do |f| %> | ||
|
||
<div> | ||
<%= content_tag :div, :class => f.validation_class(:email, "form-group") do %> | ||
<%= f.text_field :email, :placeholder => "Email", :class => 'form-control', :autofocus => true %> | ||
<%= f.errors_for :email %> | ||
<% end %> | ||
|
||
<div class="form-group or-links"> | ||
<%= f.submit "Send me instructions", :class => "btn btn-primary pull-left" %> | ||
<div style="padding-top: 8px;"></div> | ||
- or - | ||
<%= link_to "Sign up", new_user_registration_path, :class => "pull-right" %><br /> | ||
</div> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<div class="clearfix top-space"></div> | ||
<div class="row"> | ||
<div class="col-md-4 col-md-offset-4 panel panel-default"> | ||
<div class="pull-left"> | ||
<h4>Edit My Account</h4> | ||
</div> | ||
<div class="clearfix"></div> | ||
<hr /> | ||
|
||
<%= form_for resource, :url => user_registration_path, | ||
:builder => InlineErrorsBuilder, | ||
:method => :put, | ||
:role => :form do |f| %> | ||
|
||
<div> | ||
<%= content_tag :div, :class => f.validation_class(:name, "form-group") do %> | ||
<%= f.text_field :name, :placeholder => "Full Name", :class => 'form-control', :autofocus => true %> | ||
<%= f.errors_for :name %> | ||
<% end %> | ||
|
||
<%= content_tag :div, :class => f.validation_class(:username, "form-group") do %> | ||
<%= f.text_field :username, :placeholder => "Username", :class => 'form-control', :autofocus => true %> | ||
<%= f.errors_for :username %> | ||
<% end %> | ||
|
||
<%= content_tag :div, :class => f.validation_class(:email, "form-group") do %> | ||
<%= f.text_field :email, :placeholder => "Email", :class => 'form-control', :autofocus => true %> | ||
<%= f.errors_for :email %> | ||
<% end %> | ||
|
||
<%= content_tag :div, :class => f.validation_class(:password, "form-group") do %> | ||
<%= f.password_field :password, :placeholder => "Password (if changing)", :class => 'form-control', :autocomplete => "off" %> | ||
<%= f.errors_for :password %> | ||
<% end %> | ||
|
||
<%= content_tag :div, :class => f.validation_class(:current_password, "form-group") do %> | ||
<%= f.password_field :current_password, :placeholder => "Current Password", :class => 'form-control', :autocomplete => "off" %> | ||
<%= f.errors_for :current_password %> | ||
<% end %> | ||
|
||
|
||
<div class="form-group tall"> | ||
<%= link_to "Back", :back, :class => "btn btn-default pull-left" %> | ||
<%= f.submit "Update", :class => "btn btn-warning pull-right" %> | ||
</div> | ||
</div> | ||
<% end %> | ||
|
||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<div class="clearfix top-space"></div> | ||
<%= render :partial => 'home/sign_up' %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div class="clearfix top-space"></div> | ||
<%= render :partial => 'home/sign_in' %> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<div class="row"> | ||
<div class="col-md-4 col-md-offset-4 panel panel-default"> | ||
<%= form_for :user, :url => user_session_path, | ||
:builder => InlineErrorsBuilder, | ||
:method => :POST, | ||
:role => :form do |f| %> | ||
<div> | ||
<%= content_tag :div, :class => f.validation_class(:email, "form-group") do %> | ||
<%= f.text_field :email, :placeholder => "Username or email", :class => 'form-control' %> | ||
<%= f.errors_for :email %> | ||
<% end %> | ||
|
||
<%= content_tag :div, :class => f.validation_class(:password, "form-group") do %> | ||
<%= f.password_field :password, :placeholder => "Password", :class => 'form-control left' %> | ||
<%= f.errors_for :password %> | ||
<%= f.submit "Sign in", :class => "btn btn-primary pull-right" %> | ||
<% end %> | ||
|
||
<div class="clearfix"></div> | ||
|
||
<div class="form-group"> | ||
<div class="pull-left"> | ||
<label><%= f.check_box :remember_me %> Remember me</label> - | ||
<%= link_to "Forgot password?", new_user_password_path %> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<div class="row"> | ||
<div class="col-md-4 col-md-offset-4 panel panel-default"> | ||
<div class="pull-left"> | ||
<h4>New to Twitter? <span>Sign up</span></h4> | ||
</div> | ||
<div class="clearfix"></div> | ||
<hr /> | ||
<%= form_for resource, :url => user_registration_path, | ||
:builder => InlineErrorsBuilder, | ||
:method => :POST, | ||
:role => :form do |f| %> | ||
<div> | ||
<%= content_tag :div, :class => f.validation_class(:name, "form-group") do %> | ||
<%= f.text_field :name, :placeholder => "Full name", :class => 'form-control' %> | ||
<%= f.errors_for :name %> | ||
<% end %> | ||
|
||
<%= content_tag :div, :class => f.validation_class(:username, "form-group") do %> | ||
<%= f.text_field :username, :placeholder => "Username", :class => 'form-control' %> | ||
<%= f.errors_for :username %> | ||
<% end %> | ||
|
||
<%= content_tag :div, :class => f.validation_class(:email, "form-group") do %> | ||
<%= f.text_field :email, :placeholder => "Email", :class => 'form-control' %> | ||
<%= f.errors_for :email %> | ||
<% end %> | ||
|
||
<%= content_tag :div, :class => f.validation_class(:password, "form-group") do %> | ||
<%= f.password_field :password, :placeholder => "Password", :class => 'form-control' %> | ||
<%= f.errors_for :password %> | ||
<% end %> | ||
|
||
<div class="form-group tall"> | ||
<%= f.submit "Sign up for Twitter", :class => "btn btn-warning pull-right" %> | ||
</div> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,3 @@ | ||
<div class="row" style="margin-top: 120px;"> | ||
<div class="col-md-4 col-md-offset-4 panel panel-default"> | ||
<%= form_for :user, :url => user_session_path, :method => :POST, :role => :form do |f| %> | ||
<div> | ||
<div class="form-group"> | ||
<%= f.text_field :email, :placeholder => "Username or email", :class => "form-control" %> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<%= f.password_field :password, :class => "form-control" %> | ||
<%= f.submit "Sign in", :class => "btn btn-primary" %> | ||
</div> | ||
|
||
<div class="clearfix"></div> | ||
|
||
<div class="form-group"> | ||
<div class="pull-left"> | ||
<label><%= f.check_box :remember_me %> Remember me</label> - | ||
<%= link_to "Forgot password?", new_user_password_path %> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="col-md-4 col-md-offset-4 panel panel-default"> | ||
<div class="pull-left"> | ||
<h4>New to Twitter? <span>Sign up</span></h4> | ||
</div> | ||
<div class="clearfix"></div> | ||
<hr /> | ||
<%= form_for :user, :url => user_registration_path, :method => :POST, :role => :form do |f| %> | ||
<div> | ||
<div class="form-group"> | ||
<%= f.text_field :name, :placeholder => "Full name", :class => "form-control" %> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<%= f.text_field :email, :placeholder => "Email", :class => "form-control" %> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<%= f.password_field :password, :class => "form-control", :placeholder => "Password" %> | ||
</div> | ||
|
||
<div class="form-group tall"> | ||
<%= f.submit "Sign up for Twitter", :class => "btn btn-warning" %> | ||
</div> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
|
||
|
||
<div class="clearfix top-space"></div> | ||
<%= render :partial => 'sign_in' %> | ||
<%= render :partial => 'sign_up' %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters