Permalink
Browse files

添加回用户校验

  • Loading branch information...
1 parent 56656f6 commit 281306281fab406bf252a3d79efa1f2563cec3aa @mouse-lin committed Mar 24, 2012
@@ -1,6 +1,5 @@
class ApplicationController < ActionController::Base
- #目前暂时取消登录界面
- #before_filter :authenticate_user!
+ before_filter :authenticate_user!
layout :render_by_login_session
protect_from_forgery
@@ -1,12 +1,12 @@
<%= stylesheet_link_tag "login-box.css" %>
<div style="padding: 80px 0 0 400px;">
<div id="login-box">
- <H3>学生自动评分系统</H3>
+ <H3>中学生自动评分系统</H3>
<br />
<br />
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
<div style="margin-left:100px;"><font color="red"><p class="alert"><%= alert %></p></font></div>
- <div id="login-box-name" style="margin-top:20px;">账户:</div><div id="login-box-field" style="margin-top:20px;">
+ <div id="login-box-name" style="margin-top:20px;">邮箱:</div><div id="login-box-field" style="margin-top:20px;">
<input name="user[email]" class="form-login" title="Username" value="" size="30" maxlength="2048" />
</div>
<div id="login-box-name">密码:</div><div id="login-box-field">
@@ -51,14 +51,10 @@
<div class="dock-container2">
<a class="dock-item2" href="/homes"><span>主页</span><img src="../images/home.png" alt="home" /></a>
<a class="dock-item2" href="/homes/comment_student"><span>评价学生</span><img src="../images/email.png" alt="contact" /></a>
- <a class="dock-item2" href="#"><span>Portfolio</span><img src="../images/portfolio.png" alt="portfolio" /></a>
- <a class="dock-item2" href="#"><span>Music</span><img src="../images/music.png" alt="music" /></a>
- <a class="dock-item2" href="#"><span>Video</span><img src="../images/video.png" alt="video" /></a>
- <a class="dock-item2" href="#"><span>History</span><img src="../images/history.png" alt="history" /></a>
<a class="dock-item2" href="/settings/comment"><span>评语设置</span><img src="/images/calendar.png" alt="calendar" /></a>
<a class="dock-item2" href="/settings/classes"><span>班别科目主档</span><img src="/images/link.png" alt="links" /></a>
<a class="dock-item2" href="/settings"><span>主档设置</span><img src="/images/rss.png" alt="rss" /></a>
- <a class="dock-item2" href="logout"><span>退出</span><img src="/images/rss2.png" alt="rss" /></a>
+ <a class="dock-item2" href="/logout"><span>退出</span><img src="/images/rss2.png" alt="rss" /></a>
</div>
</div>
@@ -16,9 +16,9 @@ namespace :data do
ps = [
{
:name => "小明",
- :phone => "10086",
+ :phone => "13811302112",
:home => "广东移不动",
- :number => "10086110120",
+ :number => "0814021",
:sex => "",
:type => "Student",
:classes => Classes.all.first,
@@ -79,27 +79,33 @@ namespace :data do
cmses = [
{ :content => "好评" },
- { :content => "差评" },
- { :content => "中评" },
- { :content => "A" },
- { :content => "B" },
- { :content => "C" },
+ { :content => "表现良好" },
+ { :content => "很好" },
+ { :content => "表现很一般, 还需要努力" },
+ { :content => "进步很大" },
+ { :content => "very good" },
+ { :content => "good good study day day up" },
]
Comment.destroy_all
cms = Comment.create(cmses)
cmtses = [
{ :name => "思想德语" },
{ :name => "学风" },
+ { :name => "生活习惯" },
]
CommentType.destroy_all
cmts = CommentType.create(cmtses)
CommentType.first.comments << Comment.limit(3).order("id ASC")
CommentType.last.comments << Comment.limit(3).order("id DESC")
+ puts "=== creating user data === "
+ User.create(:email => "houzi@qq.com", :password => "000000")
+
rescue Exception => e
puts "--------errors: #{e}---------"
raise ActiveRecord::Rollback
end
end
end
+
end
@@ -1,4 +1,4 @@
-body{background: #808040}
+body{background: #D0D0D0}
#login-box {
width:333px;
height: 352px;

0 comments on commit 2813062

Please sign in to comment.