From a54edd90476c11d8176be99551d440eb54b177a3 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 29 Oct 2014 14:42:51 +0800 Subject: [PATCH 1/3] 111 --- app/views/homework_attach/new.html.erb | 49 +++++++++++++++++++------- 1 file changed, 36 insertions(+), 13 deletions(-) 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 %>
From 2a8df37cfc82c93be29d1d26e16c26be86b86276 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 29 Oct 2014 15:10:36 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=89=93=E5=8C=85=E4=B8=8B=E8=BD=BD=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/zipdown_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 7e8ab9771307bef589d598daae32947cde1b9cfa Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 29 Oct 2014 15:16:00 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E6=9C=80=E5=A4=A7=E9=95=BF=E5=BA=A6=E9=99=90=E5=88=B6=E4=B8=BA?= =?UTF-8?q?3000=E4=B8=AA=E5=AD=97=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/bid.rb | 2 +- app/views/courses/_homework_form.html.erb | 3 ++- db/migrate/20141029065917_change_bids_description_type.rb | 5 +++++ db/schema.rb | 4 ++-- 4 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 db/migrate/20141029065917_change_bids_description_type.rb 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/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"