diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index f8bf0d736..8b93d7443 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -110,7 +110,7 @@ class ZipdownController < ApplicationController #length = attach.storage_path.length homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1) end - zipping("#{user.user_extensions.student_id}_#{homeattach.user.name.to_s}.zip", homeworks_attach_path, OUTPUT_FOLDER, true) + zipping("#{homework.user.user_extensions.student_id}_#{homeattach.user.name.to_s}.zip", homeworks_attach_path, OUTPUT_FOLDER, true) #user_attaches_paths #end end diff --git a/app/models/bid.rb b/app/models/bid.rb index 02569ade1..bc00a8460 100644 --- a/app/models/bid.rb +++ b/app/models/bid.rb @@ -36,7 +36,7 @@ class Bid < ActiveRecord::Base acts_as_attachable NAME_LENGTH_LIMIT = 60 - DESCRIPTION_LENGTH_LIMIT = 250 + DESCRIPTION_LENGTH_LIMIT = 3000 validates :name, length: {maximum: NAME_LENGTH_LIMIT}, presence: true validates :description, length: {maximum: DESCRIPTION_LENGTH_LIMIT} validates :author_id, presence: true diff --git a/app/views/courses/_homework_form.html.erb b/app/views/courses/_homework_form.html.erb index 053a9c7c4..1bd248c59 100644 --- a/app/views/courses/_homework_form.html.erb +++ b/app/views/courses/_homework_form.html.erb @@ -36,7 +36,8 @@ :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %>
<% time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') %> -<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}", :onchange => "regexDeadLine();", :readonly => true) %> +
+ <%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}", :onchange => "regexDeadLine();", :readonly => true) %> <%= calendar_for('bid_deadline')%> diff --git a/app/views/homework_attach/new.html.erb b/app/views/homework_attach/new.html.erb index e8c820fbd..3cce7bdae 100644 --- a/app/views/homework_attach/new.html.erb +++ b/app/views/homework_attach/new.html.erb @@ -2,19 +2,40 @@
高校课程实践社区 | -<%= l(:label_user_location) %> : | ++ + <%= l(:label_user_location) %> : + + | |
<%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index'%> | -<%=link_to "主页", home_path %> > <%=link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %> > - <%= link_to(@bid.courses.first.name.to_s, homework_course_path(@bid.courses.first)) if @bid.courses.first%> > - <%=link_to(@bid.name, respond_path(@bid)) %> > <%= link_to "创建作业", new_homework_attach_path(@bid)%> |
+ + + <%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index'%> + + | +
+ + <%=link_to "主页", home_path %> > + <%=link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %> > + + <%= link_to(@bid.courses.first.name.to_s, homework_course_path(@bid.courses.first)) if @bid.courses.first%> + > + <%=link_to(@bid.name, respond_path(@bid)) %> > + + <%= link_to "创建作业", new_homework_attach_path(@bid)%> + + + |
<%=h l(:label_new_homework)%>
++ <%=h l(:label_new_homework)%> +
+- 提交项目 : + + 提交项目 : + <%= 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' %> -
提交项目可以为空
++ 提交项目可以为空 +
- 描 述 : + + 描 述 : + - - <%= f.text_area "description", :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => 65534 %>
diff --git a/db/migrate/20141029065917_change_bids_description_type.rb b/db/migrate/20141029065917_change_bids_description_type.rb new file mode 100644 index 000000000..2705f661e --- /dev/null +++ b/db/migrate/20141029065917_change_bids_description_type.rb @@ -0,0 +1,5 @@ +class ChangeBidsDescriptionType < ActiveRecord::Migration + def change + change_column :bids, :description, :text, default: nil + end +end diff --git a/db/schema.rb b/db/schema.rb index b380c013c..4d194b54e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20141013023400) do +ActiveRecord::Schema.define(:version => 20141029065917) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -98,7 +98,7 @@ ActiveRecord::Schema.define(:version => 20141013023400) do t.string "budget", :null => false t.integer "author_id" t.date "deadline" - t.string "description" + t.text "description" t.datetime "created_on", :null => false t.datetime "updated_on", :null => false t.integer "commit"