From 2e253d00c39db6d5d4b0a303b6e9080a28460d1e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 29 Oct 2014 09:52:33 +0800 Subject: [PATCH 1/6] =?UTF-8?q?#1333=E4=BF=AE=E5=A4=8Dcourse=E7=BD=91?= =?UTF-8?q?=E7=AB=99=E7=9A=84=E5=AF=B9=E4=BD=9C=E4=B8=9A=E7=95=99=E8=A8=80?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E6=97=A0=E6=B3=95=E6=88=90=E5=8A=9F=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E7=9A=84BUg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/words_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index e6ba74874..c6a5d2819 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -236,11 +236,10 @@ class WordsController < ApplicationController #modify by nwb #添加对课程留言的支持 referer = request.headers["Referer"] + #referer = "http://forge.trustie.net/words/create_reply" obj_id = referer.match(%r(/([0-9]{1,})(/|\?|$)))[1] if referer.match(/project/) obj = Project.find_by_id(obj_id) - elsif referer.match(/course/) - obj = Course.find_by_id(obj_id) elsif referer.match(/user/) obj = User.find_by_id(obj_id) elsif ( referer.match(/bids/) || referer.match(/calls/) ) @@ -251,6 +250,8 @@ class WordsController < ApplicationController obj = Softapplication.find_by_id(obj_id) elsif ( referer.match(/homework_attach/) || referer.match(/homework_attach/) ) #new added obj = HomeworkAttach.find_by_id(obj_id) + elsif referer.match(/course/) + obj = Course.find_by_id(obj_id) else raise "create reply obj unknow type.#{referer}" end From e52fbd0f19e17b686bf898274db9289f0e8a6fec Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 29 Oct 2014 10:53:56 +0800 Subject: [PATCH 2/6] =?UTF-8?q?#1419=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=E5=90=8E=E5=8E=8B=E7=BC=A9?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D=E4=B8=BA=E5=AD=A6=E5=8F=B7+?= =?UTF-8?q?=E5=90=8D=E5=AD=97?= 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 df834f13c..f8bf0d736 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("#{homeattach.user.name.to_s}_#{Time.now.to_i}.zip", homeworks_attach_path, OUTPUT_FOLDER, true) + zipping("#{user.user_extensions.student_id}_#{homeattach.user.name.to_s}.zip", homeworks_attach_path, OUTPUT_FOLDER, true) #user_attaches_paths #end end 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 3/6] 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 4/6] =?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 5/6] =?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" From 435e5a4d51ba44b34a34637aedbbd9a6d07daec1 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 29 Oct 2014 16:03:44 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8A=A8=E6=80=81=E5=A2=9E=E5=8A=A0=E6=82=AC?= =?UTF-8?q?=E6=B5=AE=E6=A1=86=E6=98=BE=E7=A4=BA=E5=8A=A8=E6=80=81=E6=89=80?= =?UTF-8?q?=E6=9C=89=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/welcome_helper.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index 8de7f4ec4..27caa8306 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -317,27 +317,27 @@ module WelcomeHelper str << content_tag("span", "发表了") << content_tag("span", find_all_event_type(event)) << ': '.html_safe << - link_to(strip_tags(event.event_description).gsub(/ /,''), event.event_url) + link_to(strip_tags(event.event_description).gsub(/ /,''), event.event_url, {:title => event.event_description}) when 'issue', 'message' , 'bid' , 'wiki-page' , 'document' str << content_tag("span", "发表了") << content_tag("span", find_all_event_type(event)) << ': '.html_safe << - link_to(event.event_title, event.event_url) + link_to(event.event_title, event.event_url, {:title => event.event_title}) when 'reply' ,'Reply', 'Memo' str << content_tag("span", "发表了") << content_tag("span", find_all_event_type(event)) << ': '.html_safe << - link_to(strip_tags(event.event_description).gsub(/ /,''), event.event_url) + link_to(strip_tags(event.event_description).gsub(/ /,''), event.event_url, {:title => event.event_description}) when 'attachment' str << content_tag('span', '上传了') << content_tag('span', find_all_event_type(event)) << ': '.html_safe << - link_to(event.event_title, event.event_url) << + link_to(event.event_title, event.event_url, {:title => event.event_title}) << link_to((' ['.html_safe+l(:label_downloads_list).to_s << ']'), project_files_path(event.container.project), :class => "attachments_list_color") else str << content_tag("span", "更新了") << content_tag("span", find_all_event_type(event)) << - ': '.html_safe << link_to(event.event_title, event.event_url) + ': '.html_safe << link_to(event.event_title, event.event_url, {:title => event.event_title}) end str rescue Exception => e