1.修改新建作业及视图

2.修改编辑作业及视图
This commit is contained in:
nwb 2014-06-17 11:32:41 +08:00
parent 099e8a0912
commit 78612488e5
10 changed files with 346 additions and 221 deletions

View File

@ -375,7 +375,7 @@ class BidsController < ApplicationController
unless(membership.project.project_type==1)
membership.member_roles.each{|role|
if(role.role_id == 3)
@option << membership.project
@option << membership.project
end
}
end
@ -397,18 +397,18 @@ class BidsController < ApplicationController
end
@bidding_project = @temp
else
#added by nie
@temp = []
@bidding_project.each do |pro|
if pro.project && pro.project.project_status
@temp << pro
#added by nie
@temp = []
@bidding_project.each do |pro|
if pro.project && pro.project.project_status
@temp << pro
end
@temp
end
@temp
end
if @temp.size > 0
if @temp.size > 0
@bidding_project = @temp.sort {|a,b| b.project.project_status.grade <=> a.project.project_status.grade}
end
#ended
end
#ended
end
if @bid.homework_type == 1
@ -419,9 +419,9 @@ class BidsController < ApplicationController
if params[:student_id].present?
@temp = []
@homework_list.each do |pro|
if /#{params[:student_id]}/ =~ pro.user.user_extensions.student_id
@temp << pro
end
if /#{params[:student_id]}/ =~ pro.user.user_extensions.student_id
@temp << pro
end
@temp
end
@homework_list = @temp
@ -430,17 +430,94 @@ class BidsController < ApplicationController
respond_to do |format|
if @bid.reward_type == 3
format.html {
render :layout => 'base_homework'
}
format.html {
render :layout => 'base_homework'
}
elsif @bid.reward_type == 1
format.html {
render :layout => 'base_bids'
}
render :layout => 'base_bids'
}
else
format.html {
render :layout => 'base_contest'
}
format.html {
render :layout => 'base_contest'
}
end
format.api
end
end
# 显示作业课程
# add by nwb
def show_course
# flash[:notice] = ""
@membership = User.current.coursememberships.all(:conditions => Course.visible_condition(User.current))
@option = []
@membership.each do |membership|
membership.member_roles.each{|role|
if(role.role_id == 3)
@option << membership.course
end
}
end
@user = @bid.author
@bidding_project = @bid.biding_projects.all
if params[:student_id].present?
@temp = []
@bidding_project.each do |pro|
if pro.project && pro.project.project_status
if /#{params[:student_id]}/ =~ pro.user.user_extensions.student_id
@temp << pro
end
end
@temp
end
@bidding_project = @temp
else
#added by nie
@temp = []
@bidding_project.each do |pro|
if pro.project && pro.project.project_status
@temp << pro
end
@temp
end
if @temp.size > 0
@bidding_project = @temp.sort {|a,b| b.project.project_status.grade <=> a.project.project_status.grade}
end
#ended
end
if @bid.homework_type == 1
@homework = HomeworkAttach.new
#@homework_list = @bid.homeworks
#增加作业按评分排序,
@homework_list = @bid.homeworks.eager_load(:rate_averages, :user, :attachments).order('seems_rateable_cached_ratings.avg DESC').order("#{HomeworkAttach.table_name}.created_at ASC")
if params[:student_id].present?
@temp = []
@homework_list.each do |pro|
if /#{params[:student_id]}/ =~ pro.user.user_extensions.student_id
@temp << pro
end
@temp
end
@homework_list = @temp
end
end
respond_to do |format|
if @bid.reward_type == 3
format.html {
render :layout => 'base_homework'
}
elsif @bid.reward_type == 1
format.html {
render :layout => 'base_bids'
}
else
format.html {
render :layout => 'base_contest'
}
end
format.api
end
@ -724,14 +801,16 @@ class BidsController < ApplicationController
render file: 'courses/new_homework', layout: 'base_courses'
end
end
# modify by nwb\
# 编辑作业
def edit
@bid = Bid.find(params[:bid_id])
if (User.current.admin?||User.current.id==@bid.author_id)
@project_id = params[:project_id]
@course_id = params[:course_id]
respond_to do |format|
format.html {
@project = Project.find(params[:project_id])
@course = Course.find(params[:course_id])
@user= User.find(User.current.id)
render :layout => 'base_courses'
}
@ -743,11 +822,11 @@ class BidsController < ApplicationController
def update
@bid = Bid.find(params[:id])
@project = @bid.courses.first#Project.find(params[:course_id])
@course = @bid.courses.first#Project.find(params[:course_id])
@bid.save_attachments(params[:attachments] || (params[:bid] && params[:bid][:uploads]))
if @bid.update_attributes(params[:bid]) && @bid.save
flash[:notice] = l(:label_update_homework_succeed)
redirect_to project_homework_path(@project)
redirect_to course_homework_path(@course)
else
@bid.safe_attributes = params[:bid]
render :action => 'edit', :layout =>'base_courses'

View File

@ -42,7 +42,7 @@ module AvatarHelper
end
def get_avatar?(source)
if File.exist?(disk_filename(source.class,source.id))
if source && File.exist?(disk_filename(source.class,source.id))
return true
else
return false

View File

@ -51,6 +51,19 @@ module CoursesHelper
end
#是否启动互评下拉框
def is_evaluation_option
type = []
option1 = []
option2 = []
option1 << l(:lable_start_mutual_evaluation)
option1 << 1
option2 << l(:lable_close_mutual_evaluation)
option2 << 2
type << option1
type << option2
end
# garble count 混淆数量
# alias projectCountOrigin projectCount
# def projectCount project

View File

@ -21,12 +21,12 @@ class Bid < ActiveRecord::Base
belongs_to :author, :class_name => 'User', :foreign_key => :author_id
belongs_to :course
has_many :biding_projects, :dependent => :destroy
has_many :projects, :through => :biding_projects
has_many :projects_member, :class_name => 'User', :through => :projects
has_many :courses, :through => :biding_courses
has_many :courses_member, :class_name => 'User', :through => :courses
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
has_many :homework_for_courses, :dependent => :destroy
has_many :courses, :through => :homework_for_courses, :source => :project
has_many :courses, :through => :homework_for_courses, :source => :course
has_many :homeworks, :class_name => 'HomeworkAttach', :dependent => :destroy
has_many :join_in_contests, :dependent => :destroy
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy

View File

@ -1,8 +1,8 @@
class HomeworkForCourse < ActiveRecord::Base
attr_accessible :bid_id, :project_id
attr_accessible :bid_id, :course_id
belongs_to :bid
belongs_to :project
belongs_to :course
end

View File

@ -13,9 +13,9 @@
<span class="font_lighter"><%= l(:label_user_create_project_homework) %></span>
<span><%= link_to(bid.name, respond_path(bid), :class => 'bid_path') %></span>
<span style="float: right">
<% if(User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0)) %>
<% if(User.current.logged? && (!Member.where('user_id = ? and course_id = ?', User.current.id, bid.courses.first.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0)) %>
<%# 提交作业按钮 %>
<!--<%= link_to l(:label_commit_homework), '#OpenWindow', rel: 'leanModal', onclick: "showSubH(#{bid.id}, '#{bid.name}');" if User.current.member_of?(@project) %>-->
<!--<%= link_to l(:label_commit_homework), '#OpenWindow', rel: 'leanModal', onclick: "showSubH(#{bid.id}, '#{bid.name}');" if User.current.member_of?(@course) %>-->
<% cur_user_homework = cur_user_homework_for_bid(bid) %>
<% if cur_user_homework!= nil && cur_user_homework.count == 0 %>
<%= link_to l(:label_commit_homework),new_homework_attach_path(bid) %>
@ -26,7 +26,7 @@
<% if (User.current.admin?||User.current.id==bid.author_id) %>
<%= link_to(
l(:button_edit),
{:action => 'edit', :controller=>'bids', :project_id =>@project.id, :bid_id => bid.id},
{:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id},
:class => 'icon icon-edit'
) %>
<%= link_to(
@ -51,9 +51,9 @@
end
%>
<% if bid.homework_type == 1%>
<%= l(:label_x_homework_project, :count => bid.homeworks.count) %>(<strong><%= link_to bid.homeworks.count, project_for_bid_path(bid.id) %></strong>)
<%= l(:label_x_homework_project, :count => bid.homeworks.count) %>(<strong><%= link_to bid.homeworks.count, course_for_bid_path(bid.id) %></strong>)
<% else %>
<%= l(:label_x_homework_project, :count => @temp.count) %>(<strong><%= link_to @temp.count, project_for_bid_path(bid.id) %></strong>)
<%= l(:label_x_homework_project, :count => @temp.count) %>(<strong><%= link_to @temp.count, course_for_bid_path(bid.id) %></strong>)
<% end %></span>
<span class="font_lighter"><%= l(:label_x_responses, :count => bid.commit) %>(<strong><%= link_to bid.commit, respond_path(bid) %></strong>)</span>
<span style="float: right">

View File

@ -21,7 +21,6 @@
</script>
<%= error_messages_for 'bid' %>
<!--[form:course]-->
<p><%= l(:label_homeworks_form_new_description) %></p>
<p><%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT %></p>

View File

@ -18,214 +18,226 @@
<%= yield :header_tags -%>
</head>
<body class="<%= h body_css_classes %>">
<% project = @bid.courses.includes(:course_extra).first %>
<% course = project.course_extra %>
<div id="wrapper">
<div id="wrapper2">
<div id="wrapper3">
<%= render :partial => 'layouts/base_header'%>
<div id="main">
<!--added by huang-->
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf">高校课程实践社区</td>
<td style="width: auto; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<% course = @bid.courses.first %>
<% if course %>
<div id="wrapper">
<div id="wrapper2">
<div id="wrapper3">
<%= render :partial => 'layouts/base_header' %>
<div id="main">
<!--added by huang-->
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf">高校课程实践社区</td>
<td style="width: auto; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
</tr>
<tr>
<td style="padding-left: 8px"><a><%= link_to request.host()+"/courses", :controller => 'projects', :action => 'course'%></a></td>
<td><p class="top-content-list-homework"><%=link_to "主页", home_path %> > <%=link_to l(:label_course_practice), :controller => 'projects', :action => 'course' %> >
<span><%= link_to(@bid.courses.first.name.to_s, homework_project_path(@bid.courses.first)) if @bid.courses.first%></span> >
<%=link_to(@bid.name, respond_path(@bid)) %></p></td>
</tr>
</table>
</div>
<!--end-->
</tr>
<tr>
<td style="padding-left: 8px">
<a><%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index' %></a></td>
<td><p class="top-content-list-homework"><%= link_to "主页", home_path %>
> <%= link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %> >
<span><%= link_to(@bid.courses.first.name.to_s, homework_course_path(@bid.courses.first)) if @bid.courses.first %></span>
>
<%= link_to(@bid.name, respond_path(@bid)) %></p></td>
</tr>
</table>
</div>
<!--end-->
<div id="sidebar">
<div class="main_context">
<div class="spaceleft">
<div>
<table>
<tr>
<td style="padding-left:8px ">
<% if get_avatar?(project) %>
<%= image_tag(url_to_avatar(project),:style => "width:80px;height:80px" ) %>
<% else %>
<%= image_tag('../images/avatars/Project/course.jpg', :style => "width:80px;height:80px") %>
<% end %>
</td>
<td>
<table>
<tr>
<td style="vertical-align: top;font-size: 16px;text-align: center;" >
<div id="sidebar">
<div class="main_context">
<div class="spaceleft">
<div>
<table>
<tr>
<td style="padding-left:8px ">
<% if get_avatar?(course) %>
<%= image_tag(url_to_avatar(course), :style => "width:80px;height:80px") %>
<% else %>
<%= image_tag('../images/avatars/course/course.jpg', :style => "width:80px;height:80px") %>
<% end %>
</td>
<td>
<table>
<tr>
<td style="vertical-align: top;font-size: 16px;text-align: center;">
<span style=" word-wrap: break-word; word-break: break-all">
<strong>
<%= link_to @bid.courses.first.name.to_s, homework_project_path(@bid.courses.first) if @bid.courses.first %>
<%= link_to @bid.courses.first.name.to_s, homework_course_path(@bid.courses.first) if @bid.courses.first %>
</strong>
</span>
</td>
</tr>
<tr>
<td style=" word-wrap: break-word; word-break: break-all;font-size: 16px;text-align: center">
</td>
</tr>
<tr>
<td style=" word-wrap: break-word; word-break: break-all;font-size: 16px;text-align: center">
<span style=" color:#ed8924">
<strong><%= h @bid.name %></strong>
</span>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div class="user_underline"></div>
<!--count-->
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div class="user_underline"></div>
<!--count-->
<div class="inf_user_image">
<table>
<tr>
<td valign="top" colspan="2" style="font-size: 16px;padding-left: 8px;"><strong><%= l(:label_new_course_description) %> :</strong></td>
</tr>
<div class="inf_user_image">
<table>
<tr>
<td valign="top" colspan="2" style="font-size: 16px;padding-left: 8px;">
<strong><%= l(:label_new_course_description) %> :</strong></td>
</tr>
<tr>
<td class="font_lighter_sidebar" colspan="2" style="padding-left: 8px;"><%= textilizable project.description %></td>
</tr>
<tr>
<td class="font_lighter_sidebar" colspan="2" style="padding-left: 8px;"><%= textilizable course.description %></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_create_time) %> :</td>
<td class="font_lighter_sidebar"><%= format_time course.created_at %></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_create_time) %> :</td>
<td class="font_lighter_sidebar"><%= format_time course.created_at %></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px; width:60px">主讲老师 :</td>
<td class="font_lighter_sidebar"><%= link_to(@user.lastname+@user.firstname, user_path(@user)) %></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px; width:60px">主讲老师 :</td>
<td class="font_lighter_sidebar"><%= link_to(@user.lastname+@user.firstname, user_path(@user)) %></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_class_period) %> :</td>
<td class="font_lighter_sidebar"><%= course.class_period.to_s %>&nbsp;<%= l(:label_class_hour) %></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_class_period) %> :</td>
<td class="font_lighter_sidebar"><%= course.class_period.to_s %>&nbsp;<%= l(:label_class_hour) %></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_main_term) %> :</td>
<td class="font_lighter_sidebar"><%= course.time.to_s %> <%= course.term %></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_main_term) %> :</td>
<td class="font_lighter_sidebar"><%= course.time.to_s %> <%= course.term %></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_teacher_work_unit) %> :</td>
<td class="font_lighter_sidebar"><%= @user.user_extensions.occupation %></td>
</tr>
</table>
</div>
<div class="user_underline"></div>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_teacher_work_unit) %> :</td>
<td class="font_lighter_sidebar"><%= @user.user_extensions.occupation %></td>
</tr>
</table>
</div>
<div class="user_underline"></div>
<!-- info -->
<div class="inf_user_image">
<table>
<!-- info -->
<div class="inf_user_image">
<table>
<tr>
<td><%= l(:label_limit_time) %>: <%= @bid.deadline %></td>
</tr>
<tr>
<td>作业类型: <%=@bid.homework_type==Bid::HomeworkFile ? "提交文件" : "提交项目"%></td>
</tr>
<% unless @bid.parent_id.nil?%>
<tr>
<td>
<div style=" color: rgb(255, 0, 0); width:200px">
<% author=Bid.find(@bid.parent_id).author%>
作业来源于<%= link_to(author.lastname+author.firstname, user_path(Bid.find(@bid.parent_id).author))%>的需求:<%= link_to(Bid.find(@bid.parent_id).name, respond_path(Bid.find(@bid.parent_id))) %>
</div></td>
</tr>
<% end %>
</table>
</div>
<tr>
<td><%= l(:label_limit_time) %>: <%= @bid.deadline %></td>
</tr>
<tr>
<td>作业类型: <%= @bid.homework_type==Bid::HomeworkFile ? "提交文件" : "提交项目" %></td>
</tr>
<% unless @bid.parent_id.nil? %>
<tr>
<td>
<div style=" color: rgb(255, 0, 0); width:200px">
<% author=Bid.find(@bid.parent_id).author %>
作业来源于<%= link_to(author.lastname+author.firstname, user_path(Bid.find(@bid.parent_id).author)) %>
的需求:<%= link_to(Bid.find(@bid.parent_id).name, respond_path(Bid.find(@bid.parent_id))) %>
</div>
</td>
</tr>
<% end %>
</table>
</div>
<!-- tags -->
<div class="user_fans">
<div class="user_underline"></div>
<table style="font-family:'微软雅黑'; padding-left: 8px">
<tr>
<td><!-- added by william -for tag --> <%= render :partial => 'tags/tag', :locals => {:obj => @bid, :object_flag => "4"}%> </td>
</tr>
</table>
<!-- tags -->
<div class="user_fans">
<div class="user_underline"></div>
<table style="font-family:'微软雅黑'; padding-left: 8px">
<tr>
<td><!-- added by william -for tag --> <%= render :partial => 'tags/tag', :locals => {:obj => @bid, :object_flag => "4"} %> </td>
</tr>
</table>
</div>
</div>
<!--homework-->
<div class="user_fans">
<!--homework-->
<div class="user_fans">
<div class="user_underline"></div>
<div class="font_title_left">
<strong><%= l(:label_commit_homework) %></strong>
</div>
<div class="left_wf">
<table>
<tr>
<td style="padding-top: 5px"> <% if @bid.homework_type == 1%>
<% if @bid.homeworks.size>0 %>
<% for homework in @bid.homeworks.eager_load(:user) %>
<%= link_to image_tag(url_to_avatar(homework.user), :class => "avatar", :title => homework.user.name), user_path(homework.user), :class => "avatar" %> <% end %>
<% else %>
<p class="font_lighter">
<%= l(:label_no_course_project) %>
</p> <% end %>
<% else %>
<% if @bid.projects.size>0 %>
<% for project in @bid.projects%>
<%= link_to image_tag(url_to_avatar(project), :class => "avatar", :title => project.name), project_path(project), :class => "avatar" %> <% end %>
<% else %>
<p class="font_lighter">
<%= l(:label_no_course_project) %>
</p> <% end %>
<% end %> </td>
</tr>
</table>
</div>
</div>
<div class="user_underline"></div>
</div>
</div>
<!-- end -->
</div>
<div id="content">
<div class="tabs_new">
<ul>
<li>
<%= link_to l(:label_question_student), {:controller => 'bids', :action => 'show' },:class => link_class(:respond)%>
</li>
<% if User.current.member_of? @bid.courses.first%>
<li>
<% if User.current.logged? && @bid.courses.first && (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0) %>
<%= link_to l(:label_homework_commit), {:controller => 'bids', :action => 'show_project' },:class => link_class(:project)%>
<% else %>
<%= link_to l(:label_homework_info), {:controller => 'bids', :action => 'show_project' },:class => link_class(:project)%>
<% end %>
</li>
<div class="user_underline"></div>
<div class="font_title_left">
<strong><%= l(:label_commit_homework) %></strong>
</div>
<div class="left_wf">
<table>
<tr>
<td style="padding-top: 5px">
<% if @bid.homework_type == 1 %>
<% if @bid.homeworks.size>0 %>
<% for homework in @bid.homeworks.eager_load(:user) %>
<%= link_to image_tag(url_to_avatar(homework.user), :class => "avatar", :title => homework.user.name), user_path(homework.user), :class => "avatar" %>
<% end %>
<% else %>
<p class="font_lighter">
<%= l(:label_no_course_project) %>
</p>
<% end %>
<!-- <li><%= link_to l(:label_homework_statistics), { :controller => 'bids', :action => 'homework_statistics' },:class => link_class(:homework_statistics)%></li> -->
<!-- <li><%= link_to l(:label_homework_respond), { :controller => 'bids', :action => 'homework_respond' },:class => link_class(:homework_respond)%></li>
<% else %>
<% if @bid.courses.size>0 %>
<% for course in @bid.courses %>
<%= link_to image_tag(url_to_avatar(course), :class => "avatar", :title => course.name), course_path(course), :class => "avatar" %>
<% end %>
<% else %>
<p class="font_lighter">
<%= l(:label_no_course_project) %>
</p>
<% end %>
<% end %> </td>
</tr>
</table>
</div>
</div>
<div class="user_underline"></div>
</div>
</div>
<!-- end -->
</div>
<div id="content">
<div class="tabs_new">
<ul>
<li>
<%= link_to l(:label_question_student), {:controller => 'bids', :action => 'show'}, :class => link_class(:respond) %>
</li>
<% if User.current.member_of? @bid.courses.first %>
<li>
<% if User.current.logged? && @bid.courses.first && (!Member.where('user_id = ? and course_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?', 5, 10, 7)).size >0) %>
<%= link_to l(:label_homework_commit), {:controller => 'bids', :action => 'show_course'}, :class => link_class(:course) %>
<% else %>
<%= link_to l(:label_homework_info), {:controller => 'bids', :action => 'show_course'}, :class => link_class(:course) %>
<% end %>
</li>
<% end %>
<!-- <li><%= link_to l(:label_homework_statistics), {:controller => 'bids', :action => 'homework_statistics'}, :class => link_class(:homework_statistics) %></li> -->
<!-- <li><%= link_to l(:label_homework_respond), {:controller => 'bids', :action => 'homework_respond'}, :class => link_class(:homework_respond) %></li>
--></ul>
</div>
</div>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
<div style="clear:both;"></div>
</div>
<%= render :partial => 'layouts/base_footer'%>
</div>
</div>
</div>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
<div style="clear:both;"></div>
</div>
<%= render :partial => 'layouts/base_footer' %>
</div>
</div>
</div>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
</div>
<div id="ajax-modal" style="display:none;"></div>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
</div>
<div id="ajax-modal" style="display:none;"></div>
</div>
<%= call_hook :view_layouts_base_body_bottom %>
</div>
<%= call_hook :view_layouts_base_body_bottom %>
<% end %>
</body>
</html>

View File

@ -591,6 +591,7 @@ RedmineApp::Application.routes.draw do
end
resources :news, :except => [:show, :edit, :update, :destroy]
resources :boards
match '/homework', :controller => 'courses', :action => 'homework', :as => 'homework', :via => :get
end # end of resources :courses
match 'courses/:id/feedback', :to => 'courses#feedback', :via => :get, :as => 'course_feedback'
match '/courses/search', :controller => 'courses', :action => 'search', :via => [:get, :post]
@ -632,6 +633,7 @@ RedmineApp::Application.routes.draw do
match 'calls/new_bid', :controller => 'bids', :action => 'new_bid'
match 'contest/new_contest', :controller => 'bids', :action => 'new_contest' #huang
match 'calls/:id/show_project', :controller => 'bids', :action => 'show_project', :as => 'project_for_bid'
match 'calls/:id/show_course', :controller => 'bids', :action => 'show_course', :as => 'course_for_bid' # nwb added
match 'calls/:id/new_exercise_book', :controller => 'homework_attach', :action => 'new', :as => 'new_homework_attach'
match 'calls/:id/add', :controller => 'bids', :action => 'add'
match 'calls/:id/delete', :controller => 'bids', :action => 'delete'

View File

@ -207,6 +207,17 @@ ActiveRecord::Schema.define(:version => 20140611161801) do
t.string "reward"
end
create_table "contestnotifications", :force => true do |t|
t.integer "contest_id"
t.string "title"
t.string "summary"
t.string "description"
t.integer "author_id"
t.integer "notificationcomments_count"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "contests", :force => true do |t|
t.string "name"
t.string "budget", :default => ""
@ -595,6 +606,15 @@ ActiveRecord::Schema.define(:version => 20140611161801) do
t.datetime "updated_at", :null => false
end
create_table "notificationcomments", :force => true do |t|
t.string "notificationcommented_type"
t.integer "notificationcommented_id"
t.integer "author_id"
t.text "notificationcomments"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "open_id_authentication_associations", :force => true do |t|
t.integer "issued"
t.integer "lifetime"