Updated Remember me, and Homepage widget more link

This commit is contained in:
saurabhbhatia 2013-11-11 17:21:18 +08:00
parent afff07ec89
commit 5e0696890a
9 changed files with 70 additions and 55 deletions

10
app/mailer/user_mailer.rb Normal file
View File

@ -0,0 +1,10 @@
class UserMailer < Devise::Mailer
default :from => "noreply@rulingcom.com"
def password_reset(user, password)
@user = user
@password = password
mail(:to => user.email,
:subject => 'Password Reset Notification')
end
end

View File

@ -1,22 +1,36 @@
<section id="main-wrap">
<div class="sign-in have-other-sign-in">
<!-- <p class="alert alert-error in fade">You need to sign in.</p>
-->
<h1 class="login-logo"><%= t(:ruling_site) %></h1> <div class="form">
<div id="signin-header"> <h3 class="login-logo">Reset Your Password</h3>
<h3><%= t(:forgot_password) %></h3> <div>
<input name="utf8" type="hidden" value="" />
<input name="authenticity_token" type="hidden" value="" />
</div> </div>
<div id="container" class="sign-in"> <!-- <div class="other-sign-in">
<%= form_for :user, :url => user_password_path, :html => {:class => 'user_new form-horizontal'} do |f| %> <a class="btn btn-primary" type="submit">Other Sign In</a>
<p>or</p>
</div> -->
<div class="form-block">
<div class="form-list clearfix">
<form class="content" accept-charset="UTF-8" action="/users/sign_in" method="post">
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post, :class => 'user_new form-horizontal' }) do |f| %>
<%= devise_error_messages! %> <%= devise_error_messages! %>
<div class="content">
<div class="main">
<div class="control-group clear"> <div class="control-group clear">
<%= f.label :email %> <label for="user_email">
<%= f.email_field :email, :placeholder => t(:email), :style => "width: 330px;" %> <i class="icons-mail "></i>
<span class="help-inline">Please correct the error</span> </label>
<%= f.text_field :email, :placeholder => t(:email), :id=>"user_email" %>
</div> </div>
<%= content_tag :button, "Reset Password", :type => :submit, :class => 'btn btn-primary' %>
</form>
</div> </div>
</div> </div>
<div class="form-actions clear">
<%= content_tag :button, "Send me reset password instructions", :type => :submit, :class => 'btn btn-primary pull-right' %>
</div>
<% end %> <% end %>
</div> </div>
</div>
</section>

View File

@ -1,5 +1,3 @@
<!-- Orbit Bar -->
<!--#include virtual="include/orbit_bar.html"-->
<section id="main-wrap"> <section id="main-wrap">
<div class="sign-in have-other-sign-in"> <div class="sign-in have-other-sign-in">
<!-- <p class="alert alert-error in fade">You need to sign in.</p> <!-- <p class="alert alert-error in fade">You need to sign in.</p>
@ -35,25 +33,22 @@
</label> </label>
<%= f.password_field :password, :placeholder => t(:dots), :id=>"user_password" %> <%= f.password_field :password, :placeholder => t(:dots), :id=>"user_password" %>
</div> </div>
<br/>
<label class="checkbox">
<% if devise_mapping.rememberable? -%>
<%= f.check_box :remember_me %> <small><%= f.label :remember_me %></small>
<% end -%>
</label>
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %> <%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
</form> </form>
<form class="content" accept-charset="UTF-8" action="/users/sign_in" method="post">
<div class="control-group clear">
<label for="user_email">
<i class="icon-user"></i>
</label>
<input type="text" id="user_id" name="user[id]" placeholder="帳號" />
</div>
<div class="control-group clear">
<label for="user_password">
<i class="icons-mail"></i>
</label>
<input type="text" id="user_email" name="user[email]" placeholder="電子郵件" />
</div>
</form>
</div> </div>
</div> </div>
<div class="pull-right">
<%= link_to content_tag(:small, t(:forgot_password)), new_user_password_path %>
</div>
<br/>
<!-- <div class="register"> <!-- <div class="register">
<button class="btn btn-inverse" type="submit">Register</button> <button class="btn btn-inverse" type="submit">Register</button>
</div> --> </div> -->

View File

@ -69,10 +69,10 @@
<%= f.password_field :password, class: "input-xlarge", placeholder: t(:password) %> <%= f.password_field :password, class: "input-xlarge", placeholder: t(:password) %>
</div> </div>
<div class="pull-left" style="width: 150px;"> <div class="pull-left" style="width: 150px;">
<!-- <label class="checkbox"> <label class="checkbox">
<input type="checkbox" value=""> <input type="checkbox" name="user[remember_me]" value="1" checked="checked" />
<small>Remember me</small> <small>Remember me</small>
</label> --> </label>
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %> <%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
</div> </div>
<div class="pull-right"> <div class="pull-right">

View File

@ -15,7 +15,7 @@ Orbit::Application.configure do
config.action_controller.perform_caching = true config.action_controller.perform_caching = true
# Don't care if the mailer can't send # Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false config.action_mailer.raise_delivery_errors = true
# Print deprecation notices to the Rails logger # Print deprecation notices to the Rails logger
config.active_support.deprecation = :log config.active_support.deprecation = :log

View File

@ -3,10 +3,10 @@
Devise.setup do |config| Devise.setup do |config|
# ==> Mailer Configuration # ==> Mailer Configuration
# Configure the e-mail address which will be shown in DeviseMailer. # Configure the e-mail address which will be shown in DeviseMailer.
config.mailer_sender = "please-change-me@config-initializers-devise.com" config.mailer_sender = "UserMailer"
# Configure the class responsible to send e-mails. # Configure the class responsible to send e-mails.
# config.mailer = "Devise::Mailer" config.mailer = "Devise::Mailer"
# ==> ORM configuration # ==> ORM configuration
# Load and configure the ORM. Supports :active_record (default) and # Load and configure the ORM. Supports :active_record (default) and
@ -61,7 +61,7 @@ Devise.setup do |config|
# ==> Configuration for :rememberable # ==> Configuration for :rememberable
# The time the user will be remembered without asking for credentials again. # The time the user will be remembered without asking for credentials again.
# config.remember_for = 2.weeks config.remember_for = 2.weeks
# If true, a valid remember token can be re-used between multiple browsers. # If true, a valid remember token can be re-used between multiple browsers.
# config.remember_across_browsers = true # config.remember_across_browsers = true

View File

@ -8,7 +8,7 @@ defaults: &defaults
development: development:
<<: *defaults <<: *defaults
database: orbit_site_new database: test_site
@ -24,4 +24,4 @@ production:
# password: <%= ENV['MONGOID_PASSWORD'] %> # password: <%= ENV['MONGOID_PASSWORD'] %>
# database: <%= ENV['MONGOID_DATABASE'] %> # database: <%= ENV['MONGOID_DATABASE'] %>
<<: *defaults <<: *defaults
database: orbit_site_new database: orbit_test_new

View File

@ -23,7 +23,6 @@ module ParserFrontEnd
args["tag_id"] = args["tag_id"].gsub(/\"|\[|\]/,'').split(",").each(&:strip!) if !args["tag_id"].blank? and args["tag_id"].is_a? String args["tag_id"] = args["tag_id"].gsub(/\"|\[|\]/,'').split(",").each(&:strip!) if !args["tag_id"].blank? and args["tag_id"].is_a? String
# tag = params[:tag_id].blank? ? page[:tag] : params[:tag_id] # tag = params[:tag_id].blank? ? page[:tag] : params[:tag_id]
# category = params[:category_id].blank? ? page[:category] : params[:category_id] # category = params[:category_id].blank? ? page[:category] : params[:category_id]
body = Nokogiri::HTML(page.content) body = Nokogiri::HTML(page.content)
if @edit if @edit

View File

@ -149,7 +149,6 @@
</li> </li>
<% end %> <% end %>
</ul> </ul>
<% if !@category_id.blank? %> <% if !@category_id.blank? %>
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div> <div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
<% else %> <% else %>
@ -199,7 +198,6 @@
</li> </li>
<% end %> <% end %>
</ul> </ul>
<% if !@category_id.blank? %> <% if !@category_id.blank? %>
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div> <div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
<% else %> <% else %>
@ -246,7 +244,6 @@
</li> </li>
<% end %> <% end %>
</ul> </ul>
<% if !@category_id.blank? %> <% if !@category_id.blank? %>
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div> <div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
<% else %> <% else %>