Commit b6d0bbfe by vulehuan

reskin login, sign in and register page; use recptcha mailhide, prevent user from spam

parent 92ac3cdc
...@@ -53,4 +53,5 @@ group :test do ...@@ -53,4 +53,5 @@ group :test do
gem 'factory_girl_rails' gem 'factory_girl_rails'
end end
gem 'will_paginate', '3.0.4' gem 'will_paginate', '3.0.4'
gem 'will_paginate-bootstrap' gem 'will_paginate-bootstrap'
\ No newline at end of file gem 'recaptcha-mailhide'
\ No newline at end of file
...@@ -91,6 +91,7 @@ GEM ...@@ -91,6 +91,7 @@ GEM
rake (10.1.0) rake (10.1.0)
rdoc (3.12.2) rdoc (3.12.2)
json (~> 1.4) json (~> 1.4)
recaptcha-mailhide (0.1.1)
rspec-core (2.14.6) rspec-core (2.14.6)
rspec-expectations (2.14.3) rspec-expectations (2.14.3)
diff-lcs (>= 1.1.3, < 2.0) diff-lcs (>= 1.1.3, < 2.0)
...@@ -151,6 +152,7 @@ DEPENDENCIES ...@@ -151,6 +152,7 @@ DEPENDENCIES
jquery-rails jquery-rails
mysql2 mysql2
rails (= 4.0.0) rails (= 4.0.0)
recaptcha-mailhide
rspec-rails rspec-rails
sass-rails (~> 4.0.0) sass-rails (~> 4.0.0)
sdoc sdoc
......
...@@ -435,4 +435,15 @@ footer { ...@@ -435,4 +435,15 @@ footer {
color: #c09853; color: #c09853;
background-color: #fcf8e3; background-color: #fcf8e3;
border-color: #fbeed5; border-color: #fbeed5;
}
.page-one-col {
header, .block-search {
margin-left: -15px;
}
/* form {
margin: 30px auto;
text-align: left;
max-width: 460px;
}*/
} }
\ No newline at end of file
class SessionsController < ApplicationController class SessionsController < ApplicationController
def new def new
render :layout => "application_one_col"
end end
def create def create
......
...@@ -9,6 +9,7 @@ class UsersController < ApplicationController ...@@ -9,6 +9,7 @@ class UsersController < ApplicationController
def new def new
@user = User.new @user = User.new
render :layout => "application_one_col"
end end
def show def show
...@@ -28,6 +29,7 @@ class UsersController < ApplicationController ...@@ -28,6 +29,7 @@ class UsersController < ApplicationController
def edit def edit
@user = User.find(params[:id]) @user = User.find(params[:id])
render :layout => "application_one_col"
end end
def update def update
......
<!DOCTYPE html>
<html>
<head>
<title><%= full_title(yield(:title)) %></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<%= csrf_meta_tags %>
<!-- Bootstrap core CSS -->
<link
href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"
rel="stylesheet">
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2pre/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.1.0/respond.min.js"></script>
<![endif]-->
</head>
<body class="page-one-col">
<div class="container">
<!-- header -->
<%= render 'layouts/header' %>
</div>
<div class="container">
<nav class="breadcrumb">
<span>You are in: </span>
<ul>
<li><a href="">Home</a></li>
<li class="last"><a href="">Lorem Ipsum</a></li>
</ul>
</nav>
<div class="clearfix"></div>
<% if flash.any? %>
<div id="block-message" class="hidden">
<% flash.each do |key, value| %>
<%= content_tag(:div, value, class: "alert alert-#{key}") %>
<% end %>
</div>
<% end %>
<%= yield %>
</div>
<%= render 'layouts/footer' %>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
</body>
</html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<img class="media-object" src="<%= gravatar_for(user, { size: 50, out_put_img: false }) %>" alt="<%= user.name %>" /></a> <img class="media-object" src="<%= gravatar_for(user, { size: 50, out_put_img: false }) %>" alt="<%= user.name %>" /></a>
<div class="media-body"> <div class="media-body">
<h4 class="media-heading"><%= user.name %></h4> <h4 class="media-heading"><%= user.name %></h4>
<b>Email:</b> <a href="mailto:<%= user.email %>"><%= user.email %></a> <a class="btn btn-default" target="_blank" href="<%= RecaptchaMailhide::URL.url_for(user.email) %>"><span class="glyphicon glyphicon-envelope"></span></a>
Please register or sign in to reply
<% if current_user.admin? && !current_user?(user) %> <% if current_user.admin? && !current_user?(user) %>
| <%= link_to "delete", user, method: "delete", dada: { confirm: "You sure?" } %> | <%= link_to "delete", user, method: "delete", dada: { confirm: "You sure?" } %>
<% end %> <% end %>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<img class="media-object" src="<%= gravatar_for(@user, { size: 200, out_put_img: false }) %>" alt="<%= @user.name %>" /></a> <img class="media-object" src="<%= gravatar_for(@user, { size: 200, out_put_img: false }) %>" alt="<%= @user.name %>" /></a>
<div class="media-body"> <div class="media-body">
<h4 class="media-heading"><%= @user.name %></h4> <h4 class="media-heading"><%= @user.name %></h4>
<b>Email:</b> <a href="mailto:<%= @user.email %>"><%= @user.email %></a> <a class="btn btn-default btn-lg" target="_blank" href="<%= RecaptchaMailhide::URL.url_for(@user.email) %>"><span class="glyphicon glyphicon-envelope"></span></a>
Please register or sign in to reply
</div> </div>
</li> </li>
</div> </div>
......
...@@ -3,3 +3,8 @@ require File.expand_path('../application', __FILE__) ...@@ -3,3 +3,8 @@ require File.expand_path('../application', __FILE__)
# Initialize the Rails application. # Initialize the Rails application.
VenshopApp::Application.initialize! VenshopApp::Application.initialize!
RecaptchaMailhide.configure do |c|
c.private_key = '6LfDL-kSAAAAAFDLOFADJ0GJql1-6tCTo0PlWz7L'
c.public_key = '6LfDL-kSAAAAAG8JuwZhxLaT8X8iHZYpWu-7DAFe'
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment