This commit is contained in:
z9hang 2014-06-20 14:04:24 +08:00
commit 55b28296a0
2 changed files with 5 additions and 1 deletions

View File

@ -59,7 +59,11 @@ module HomeworkAttachHelper
cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1" cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1"
memberships = User.current.memberships.all(:conditions => cond) memberships = User.current.memberships.all(:conditions => cond)
projects = memberships.map(&:project) projects = memberships.map(&:project)
not_have_project = []
not_have_project << "<<NULL>>"
not_have_project << 0
type = [] type = []
type << not_have_project
projects.each do |project| projects.each do |project|
if project != nil if project != nil
option = [] option = []

View File

@ -28,7 +28,7 @@
</p> </p>
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;"> <p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
<strong>提交项目:</strong> <strong>提交项目:</strong>
<%= f.select :project_id, options_for_select(user_projects_option),:name => "project_id", :required => true%> <%= f.select :project_id, options_for_select(user_projects_option),:name => "project_id", :required => true, :style => "width:490px;"%>
<%= link_to '创建项目', new_project_path(course: 0, project_type: 0), :target => '_blank' %> <%= link_to '创建项目', new_project_path(course: 0, project_type: 0), :target => '_blank' %>
<p class="font_lighter" style="padding-left:120px;clear:left;">提交项目可以为空</p> <p class="font_lighter" style="padding-left:120px;clear:left;">提交项目可以为空</p>
</p> </p>