\n"
else
ancestors.pop
s << ""
diff --git a/app/helpers/contests_helper.rb b/app/helpers/contests_helper.rb
index 184fc7c40..01c7d544f 100644
--- a/app/helpers/contests_helper.rb
+++ b/app/helpers/contests_helper.rb
@@ -173,6 +173,18 @@ module ContestsHelper
end
tmp
end
-
+
+ #作品分类下拉框
+ def work_type_opttion
+ type = []
+ #work_types = WorksCategory.all
+ WorksCategory.all.each do |work_type|
+ option = []
+ option << work_type.category
+ option << work_type.category
+ type << option
+ end
+ type
+ end
end
\ No newline at end of file
diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb
index 033b6405c..59acc188b 100644
--- a/app/helpers/courses_helper.rb
+++ b/app/helpers/courses_helper.rb
@@ -371,7 +371,7 @@ module CoursesHelper
#获取作业的教师评分
def teacher_score_for_homework homework
- member = searchTeacherAndAssistant(homework.bid.courses.first).first#searchPeopleByRoles(homework.bid.courses.first,TeacherRoles).first
+ member = searchTeacherAndAssistant(homework.bid.courses.first).first#searchPeopleByRoles(homework.bid.courses.first,TeacherRoles).first
if member.nil?
return "0.00"
end
diff --git a/app/models/course.rb b/app/models/course.rb
index 04b0535bd..1c2828adc 100644
--- a/app/models/course.rb
+++ b/app/models/course.rb
@@ -34,7 +34,7 @@ class Course < ActiveRecord::Base
acts_as_attachable :view_permission => :view_files,
:delete_permission => :manage_files
- validates_presence_of :password, :term,:name
+ validates_presence_of :password, :term,:name ,:class_period
validates_format_of :class_period, :with =>/^\d*$/
#validates_format_of :name,:with =>/^[a-zA-Z0-9_\u4e00-\u9fa5]+$/
diff --git a/app/models/works_category.rb b/app/models/works_category.rb
new file mode 100644
index 000000000..d8aeecd4e
--- /dev/null
+++ b/app/models/works_category.rb
@@ -0,0 +1,3 @@
+class WorksCategory < ActiveRecord::Base
+ attr_accessible :category
+end
diff --git a/app/views/bids/_homework_form.html.erb b/app/views/bids/_homework_form.html.erb
index 92b162035..f7c753b45 100644
--- a/app/views/bids/_homework_form.html.erb
+++ b/app/views/bids/_homework_form.html.erb
@@ -33,7 +33,7 @@
<%= f.text_field :deadline, :required => true, :size => 60, :style => "width:150px;" %><%= calendar_for('bid_deadline')%>
<%= f.select :is_evaluation, is_evaluation_option %>
diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb
index cb6024e29..26aa3ccd4 100644
--- a/app/views/contests/show_attendingcontest.html.erb
+++ b/app/views/contests/show_attendingcontest.html.erb
@@ -91,7 +91,7 @@
<%= l(:label_work_name) %>
* :
- <%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %> |
+ <%= f.text_field :name, :required => true, :size => 60, :style => "width:350px;" %> |
(<%= l(:label_workname_lengthlimit) %>)
@@ -101,17 +101,32 @@
<%= l(:label_running_platform) %>
* :
- <%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %> |
+ <%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:350px;" %> |
+
+
+
+ <%= l(:label_work_type) %>
+ * :
+
+
+ <%#= select_tag 'app_type_name', work_type_opttion, {:name => 'app_type_name',:style => "width:358px;"} %>
+
+ <%= f.select :app_type_name,work_type_opttion, {},{:style => "width:358px;"} %>
+ <%#= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %>
+ |
+
+
+
<%= l(:label_work_description) %>
* :
- <%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %> |
+ <%= f.text_field :description, :required => true, :size => 60, :style => "width:350px;" %> |
(<%= l(:label_workdescription_lengthlimit) %>)
@@ -121,7 +136,7 @@
<%= l(:label_softapplication_developers) %>
* :
- <%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:400px;" %> |
+ <%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:350px;" %> |
@@ -130,8 +145,9 @@
<%= l(:label_work_deposit_project) %>:
- <%= select_tag 'project', options_for_select(select_option_helper(@option)), :name => 'project', :class => 'grayline2' %>
+ <%= select_tag 'project', options_for_select(select_option_helper(@option)), :name => 'project', :class => 'grayline2',:style => "width:358px;" %>
<%= link_to l(:label_create_new_projects),{:controller => 'projects',:action => 'new',course: 0, project_type: 0,host: Setting.project_domain}, :target => '_blank' %>
+ <%= link_to l(:label_create_new_projects), new_project_path(course: 0, project_type: 0), :target => '_blank' %>
@@ -240,7 +256,10 @@
<%= l(:label_profile) %>: |
- <%= c_project.project.description.truncate(90, omission: '...') %> |
+
+ <%#= c_project.project.description.truncate(90, omission: '...') %>
+ <%= c_project.project.description %>
+ |
@@ -276,7 +295,10 @@
<%= l(:label_profile) %>: |
- <%= c_softapplication.softapplication.description.truncate(90, omission: '...') %> |
+
+ <%#= c_softapplication.softapplication.description.truncate(90, omission: '...') %>
+ <%= c_softapplication.softapplication.description %>
+ |
diff --git a/app/views/homework_attach/new.html.erb b/app/views/homework_attach/new.html.erb
index 9f0b69f58..6f5c56c5a 100644
--- a/app/views/homework_attach/new.html.erb
+++ b/app/views/homework_attach/new.html.erb
@@ -28,7 +28,7 @@
提交项目 :
- <%= f.select :project_id, options_for_select(user_projects_option),:name => "project_id", :required => true, :style => "width:490px;"%>
+ <%= f.select :project_id,options_for_select(user_projects_option), {},{:style => "width:490px;"} %>
<%= link_to '创建项目', new_project_path(course: 0, project_type: 0), :target => '_blank' %>
提交项目可以为空
diff --git a/app/views/layouts/_base_header.html.erb b/app/views/layouts/_base_header.html.erb
index 7e11d8357..17f0d1e60 100644
--- a/app/views/layouts/_base_header.html.erb
+++ b/app/views/layouts/_base_header.html.erb
@@ -41,6 +41,7 @@
<%=link_to_user(User.current)%>