Merge branch 'sw_new_course' of http://repository.trustie.net/xianbo/trustie2 into sw_new_course
commit
706415dc6e
@ -1,12 +1,19 @@
|
|||||||
class CourseMessage < ActiveRecord::Base
|
class CourseMessage < ActiveRecord::Base
|
||||||
attr_accessible :course_id, :course_message_id, :course_message_type, :user_id, :viewed
|
attr_accessible :course_id, :course_message_id, :course_message_type, :user_id, :viewed, :content, :status
|
||||||
|
|
||||||
# 多态 虚拟关联
|
# 多态 虚拟关联
|
||||||
belongs_to :course_message ,:polymorphic => true
|
belongs_to :course_message ,:polymorphic => true
|
||||||
belongs_to :course
|
belongs_to :course
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
|
has_many :message_alls, :class_name => 'MessageAll',:as =>:message, :dependent => :destroy
|
||||||
|
|
||||||
validates :user_id,presence: true
|
validates :user_id,presence: true
|
||||||
validates :course_id,presence: true
|
validates :course_id,presence: true
|
||||||
validates :course_message_id,presence: true
|
validates :course_message_id,presence: true
|
||||||
validates :course_message_type, presence: true
|
validates :course_message_type, presence: true
|
||||||
|
after_create :add_user_message
|
||||||
|
|
||||||
|
def add_user_message
|
||||||
|
self.message_alls << MessageAll.new(:user_id => self.user_id)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
class MessageAll < ActiveRecord::Base
|
||||||
|
attr_accessible :message_id, :message_type, :user_id
|
||||||
|
# 虚拟关联---项目消息表/课程消息表/用户留言消息表/贴吧消息表
|
||||||
|
belongs_to :message ,:polymorphic => true
|
||||||
|
end
|
@ -1,16 +1,36 @@
|
|||||||
<% @nav_dispaly_home_path_label = 1
|
<%= stylesheet_link_tag 'new_user'%>
|
||||||
@nav_dispaly_main_course_label = 1
|
|
||||||
@nav_dispaly_main_project_label = 1
|
<div class="homepageContentContainer " style="margin-top:20px;">
|
||||||
@nav_dispaly_main_contest_label = 1 %>
|
<div class="homepageContent BgBox">
|
||||||
<% @nav_dispaly_forum_label = 1%>
|
<h2 class="BgBox_h2">忘记密码</h2>
|
||||||
<h3><%=l(:label_password_forget)%></h3>
|
<div class="BgBoxCon">
|
||||||
|
<p class="BgBoxConP mb5">通过注册邮箱链接重设密码</p>
|
||||||
|
<input type="text" class="NomalInput mb20 " value="请输入登录邮箱地址" />
|
||||||
|
<div class="LoginButton"><a href="javascript:void(0);" class="c_white db">提交</a></div>
|
||||||
|
|
||||||
<%= form_tag(lost_password_path) do %>
|
|
||||||
<div class="box tabular">
|
|
||||||
<p>
|
|
||||||
<label for="mail"><%=l(:field_mail)%> <span class="required">*</span></label>
|
|
||||||
<%= text_field_tag 'mail', nil, :size => 40, :placeholder => '请输入注册邮箱'%>
|
|
||||||
<%= submit_tag l(:button_submit) %>
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
|
||||||
|
|
||||||
|
</div><!---BgBox end--->
|
||||||
|
</div><!---homepageContentContainer end--->
|
||||||
|
<script>
|
||||||
|
$(".resourcesList").mousedown(function(e) {
|
||||||
|
if (3 == e.which) {
|
||||||
|
document.oncontextmenu = function() {return false;}
|
||||||
|
$("#contextMenu").hide();
|
||||||
|
$("#contextMenu").attr("style","display: block; position: fixed; top:"
|
||||||
|
+ e.pageY
|
||||||
|
+ "px; left:"
|
||||||
|
+ e.pageX
|
||||||
|
+ "px; width: 80px;");
|
||||||
|
$("#contextMenu").show();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
$(".resourcesList").click(function(e) {
|
||||||
|
$("#contextMenu").hide();
|
||||||
|
document.oncontextmenu = function() {return true;}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
@ -0,0 +1,41 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="<%= current_language %>">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title><%=h html_title %></title>
|
||||||
|
<meta name="description" content="<%= Redmine::Info.app_name %>" />
|
||||||
|
<meta name="keywords" content="issue,bug,tracker" />
|
||||||
|
<%= csrf_meta_tag %>
|
||||||
|
<%= favicon %>
|
||||||
|
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %>
|
||||||
|
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
|
||||||
|
<%= javascript_heads %>
|
||||||
|
<%= javascript_include_tag "jquery.leanModal.min" %>
|
||||||
|
<%= javascript_include_tag 'seems_rateable/jRating', 'seems_rateable/rateable'%>
|
||||||
|
<%= heads_for_theme %>
|
||||||
|
<%= call_hook :view_layouts_base_html_head %>
|
||||||
|
<!-- page specific tags -->
|
||||||
|
<%= yield :header_tags -%>
|
||||||
|
<%= stylesheet_link_tag 'base','header', :media => 'all'%>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="navContainer mb10">
|
||||||
|
<% if User.current.logged? %>
|
||||||
|
<%= render :partial => 'layouts/logined_header',:locals=>{:name=>@name,:type=>@type} %>
|
||||||
|
<% else%>
|
||||||
|
<%= render :partial => 'layouts/unlogin_header',:locals=>{:name=>@name,:type=>@type} %>
|
||||||
|
<% end%>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div>
|
||||||
|
<%= yield %>
|
||||||
|
<div style="clear:both;"></div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<%= render :partial => 'layouts/footer' %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
<%= call_hook :view_layouts_base_body_bottom %>
|
||||||
|
</body>
|
||||||
|
</html>
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue