From f4e30f77cc61b1b75f728ddd703ce4cc75160965 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 10 Jan 2015 10:55:37 +0800 Subject: [PATCH 001/169] =?UTF-8?q?1.=E6=89=93=E5=8C=85=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E6=8D=95=E8=8E=B7=E5=8E=BB=E9=99=A4=202.?= =?UTF-8?q?=E6=89=93=E5=8C=85=E4=B8=8B=E8=BD=BD=E5=AF=BB=E6=89=BE=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E3=80=81=E9=A1=B9=E7=9B=AE=E6=96=B9=E6=B3=95=E9=9A=90?= =?UTF-8?q?=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/zipdown_controller.rb | 36 +++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index 12637e2fb..ac8a74379 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -7,17 +7,6 @@ class ZipdownController < ApplicationController SAVE_FOLDER = "#{Rails.root}/files" OUTPUT_FOLDER = "#{Rails.root}/tmp/archiveZip" - #通过作业Id找到项目(课程) - def find_project_by_bid_id - obj_class = params[:obj_class] - obj_id = params[:obj_id] - obj = obj_class.constantize.find(obj_id) - case obj.class.to_s.to_sym - when :Bid - @project = obj.courses[0] - end - end - def assort if params[:obj_class] == "Bid" bid = Bid.find params[:obj_id] @@ -33,8 +22,8 @@ class ZipdownController < ApplicationController end send_file zipfile, :filename => bid.name + ".zip", :type => detect_content_type(zipfile) if zipfile - rescue Exception => e - render file: 'public/no_file_found.html' + #rescue Exception => e + # render file: 'public/no_file_found.html' end #下载某一学生的作业的所有文件 @@ -56,12 +45,23 @@ class ZipdownController < ApplicationController else render_403 end - rescue => e - render file: 'public/file_not_found.html' + #rescue => e + # render file: 'public/file_not_found.html' end private + #通过作业Id找到项目(课程) + def find_project_by_bid_id + obj_class = params[:obj_class] + obj_id = params[:obj_id] + obj = obj_class.constantize.find(obj_id) + case obj.class.to_s.to_sym + when :Bid + @project = obj.courses[0] + end + end + def zip_bid(bid) # Todo: User Access Controll bid_homework_path = [] @@ -113,9 +113,9 @@ class ZipdownController < ApplicationController end end zipfile_name - rescue Errno => e - logger.error "[zipdown#zipping] ===> #{e}" - @error = e + #rescue Errno => e + # logger.error "[zipdown#zipping] ===> #{e}" + # @error = e end def detect_content_type(name) content_type = Redmine::MimeType.of(name) From 477f4801751dbb6e863606f5e5971e7b0da0045a Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 10 Jan 2015 16:06:33 +0800 Subject: [PATCH 002/169] =?UTF-8?q?=E5=A2=9E=E5=8A=A0EXCEL=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E7=9A=84gem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gemfile b/Gemfile index 634af9683..498a4fca6 100644 --- a/Gemfile +++ b/Gemfile @@ -15,6 +15,8 @@ gem "coderay", "~> 1.0.6" gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby] gem "builder", "3.0.0" gem 'acts-as-taggable-on', '2.4.1' +gem 'spreadsheet' +gem 'ruby-ole' group :development do gem 'better_errors', path: 'lib/better_errors' From 41679a8d5c04463883174f3ace0d158d30b317f0 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 10 Jan 2015 16:20:36 +0800 Subject: [PATCH 003/169] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=BC=BA=E5=B0=91=E6=97=B6=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/zh.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/zh.yml b/config/locales/zh.yml index d6e7815f9..36c26625e 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2239,5 +2239,5 @@ zh: label_course_prompt: 课程: label_contain_resource: 已包含资源: label_quote_resource_failed: ",此资源引用失败! " - label_file_lost: 以下文件在服务器丢失,请联系相关人员重新上传: + label_file_lost: 以下无法成功下载,请联系相关人员重新上传: From bf7eaa7a8084f76c0189f8f0279b1528161970d8 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 10 Jan 2015 17:41:50 +0800 Subject: [PATCH 004/169] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8C=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=AD=A6=E7=94=9F=E6=8F=90=E4=BA=A4=E7=9B=B8=E5=90=8C?= =?UTF-8?q?=E7=9A=84=E6=96=87=E4=BB=B6=E5=90=8E=EF=BC=8C=E6=89=93=E5=8C=85?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=BC=82=E5=B8=B8=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/zipdown_controller.rb | 12 +++++++++++- config/locales/zh.yml | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index ac8a74379..b329e4c27 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -101,10 +101,20 @@ class ZipdownController < ApplicationController Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile| input_filename.each do |filename| + flag = true + index = 1 rename_file = ic.iconv( (File.basename(filename)) ).to_s rename_file = ic.iconv( filename_to_real( File.basename(filename))).to_s if is_attachment - zipfile.add(rename_file, filename) + begin + zipfile.add(rename_file, filename) + flag = false + rescue Exception => e + zipfile.get_output_stream('FILE_NOTICE.txt') do |os| + os.write l(:label_file_exist) + end + next + end end unless not_exist_file.empty? zipfile.get_output_stream('FILE_LOST.txt') do |os| diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 36c26625e..568a60cac 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2240,4 +2240,5 @@ zh: label_contain_resource: 已包含资源: label_quote_resource_failed: ",此资源引用失败! " label_file_lost: 以下无法成功下载,请联系相关人员重新上传: + label_file_exist: 该作品中有重复命名文件,请通过文件名学号和姓名信息进入该作业详细界面手动下载 From 2b59f2fc445b2b471e0101e78cbaa11f2271fb68 Mon Sep 17 00:00:00 2001 From: zhuhao Date: Mon, 12 Jan 2015 14:19:51 +0800 Subject: [PATCH 005/169] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=BC=B9=E7=AA=97=E6=8C=89=E9=92=AE=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/resource.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/resource.css b/public/stylesheets/resource.css index 885423143..f0f969b4a 100644 --- a/public/stylesheets/resource.css +++ b/public/stylesheets/resource.css @@ -118,7 +118,7 @@ a.yellowBtn{ display:inline-block;color:#0d90c3; height:22px;} .upload_con { } .upload_con h2{ display:block; background:#eaeaea; font-size:14px; color:#343333; height:31px; width: auto; margin-top:25px; padding-left:20px; padding-top:5px;} .upload_box{ width:430px; margin:15px auto;} -a.upload_btn{ display:block; float:left; margin-top:15px; width:80px; height:30px; text-align: center; color:#fff; font-size:14px; background:#15bccf; margin-right:15px;} +a.upload_btn{ display:block; float:left; margin-top:15px; width:80px; height:30px; text-align: center; color:#fff; font-size:14px; background:#15bccf; margin-right:15px;padding-top: 10px;} a:hover.upload_btn{ background:#55a1b9;} a.upload_btn_grey{background:#a3a3a3;} a:hover.upload_btn_grey{background:#8a8a8a;} From 9f807438d6bbc3ee035b0f396d625327fb1756a1 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Mon, 12 Jan 2015 14:58:11 +0800 Subject: [PATCH 006/169] =?UTF-8?q?=E6=95=99=E5=B8=88=E6=95=B0=E7=9B=AE?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=EF=BC=9A-1=20=EF=BC=8C=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=A4=A7=E9=87=8F=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E3=80=82=E6=98=AF=E4=B8=8D=E6=98=AF=E5=8F=AA=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E8=BF=91=E6=9C=9F3=E4=B8=AA=E6=9C=88=E7=9A=84=EF=BC=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: alan <547533434@qq.com> --- Gemfile | 24 +++++++++---------- app/controllers/courses_controller.rb | 4 ++-- app/controllers/projects_controller.rb | 8 +++---- app/views/welcome/_search_course.html.erb | 2 +- app/views/welcome/_search_project.html.erb | 2 +- .../20150112024820_add_data_for_members.rb | 10 ++++++++ db/schema.rb | 2 +- .../lib/acts_as_activity_provider.rb | 16 +++++++++---- lib/redmine/activity/fetcher.rb | 4 ++-- 9 files changed, 44 insertions(+), 28 deletions(-) create mode 100644 db/migrate/20150112024820_add_data_for_members.rb diff --git a/Gemfile b/Gemfile index 6bb141404..6c2101345 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ -source 'http://ruby.taobao.org' +source 'http://rubygems.org' #source 'http://ruby.sdutlinux.org/' unless RUBY_PLATFORM =~ /w32/ @@ -33,21 +33,21 @@ group :test do gem 'selenium-webdriver', '~> 2.42.0' - platforms :mri, :mingw do - group :rmagick do - # RMagick 2 supports ruby 1.9 - # RMagick 1 would be fine for ruby 1.8 but Bundler does not support - # different requirements for the same gem on different platforms - gem "rmagick", ">= 2.0.0" - end - end + # platforms :mri, :mingw do + # group :rmagick do + # # RMagick 2 supports ruby 1.9 + # # RMagick 1 would be fine for ruby 1.8 but Bundler does not support + # # different requirements for the same gem on different platforms + # gem "rmagick", ">= 2.0.0" + # end + #end end group :development, :test do - gem "guard-rails", '~> 0.5.3' + # gem "guard-rails", '~> 0.5.3' gem 'spork-testunit', '~> 0.0.8' - gem 'guard-spork', '~> 1.5.1' - gem 'guard-test', '~> 1.0.0' + # gem 'guard-spork', '~> 1.5.1' + # gem 'guard-test', '~> 1.0.0' gem 'ruby-prof', '~> 0.15.1' unless RUBY_PLATFORM =~ /w32/ gem 'pry' gem 'pry-nav' diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index e76fa31dc..9d35b9fb0 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -810,9 +810,9 @@ class CoursesController < ApplicationController # modify by nwb # 添加私密性判断 if User.current.member_of_course?(@course)|| User.current.admin? - events = @activity.events(@date_from, @date_to) + events = @activity.events(@days, @course.created_at) else - events = @activity.events(@date_from, @date_to, :is_public => 1) + events = @activity.events(@days, @course.created_at, :is_public => 1) end # 无新动态时,显示老动态 diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 0b7cbbb5f..5d43a4e20 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -597,8 +597,8 @@ class ProjectsController < ApplicationController "show_wiki_edits"=>true, "show_journals_for_messages" => true } - @date_to ||= Date.today + 1 - @date_from = @date_to - @days-1.years + + @with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1') @author = (params[:user_id].blank? ? nil : User.active.find(params[:user_id])) # 决定显示所用用户或单个用户活动 @@ -612,9 +612,9 @@ class ProjectsController < ApplicationController # modify by nwb # 添加私密性判断 if User.current.member_of?(@project)|| User.current.admin? - events = @activity.events(@date_from, @date_to) + events = @activity.events(@days) else - events = @activity.events(@date_from, @date_to, :is_public => 1) + events = @activity.events(@days,nil, :is_public => 1) end @offset, @limit = api_offset_and_limit({:limit => 10}) diff --git a/app/views/welcome/_search_course.html.erb b/app/views/welcome/_search_course.html.erb index 5721af9fb..895f696fb 100644 --- a/app/views/welcome/_search_course.html.erb +++ b/app/views/welcome/_search_course.html.erb @@ -49,7 +49,7 @@ form #search_type{ <%= form_tag({controller: :welcome, action: :search }, method: :get) do %>
diff --git a/config/locales/zh.yml b/config/locales/zh.yml index abf20e370..f3e6d4d8d 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2242,4 +2242,5 @@ zh: label_file_lost: 以下无法成功下载,请联系相关人员重新上传: label_file_exist: 该作品中有重复命名文件,请通过文件名学号和姓名信息进入该作业详细界面手动下载 label_poll_new: 未命名问卷 + label_poll: 问卷调查 From 8080ca80643c84eac04e0ba9ee140debbf8c9220 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 12 Jan 2015 17:02:35 +0800 Subject: [PATCH 014/169] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E7=9A=84css?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/polls.css | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 public/stylesheets/polls.css diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css new file mode 100644 index 000000000..8621c20dc --- /dev/null +++ b/public/stylesheets/polls.css @@ -0,0 +1,40 @@ +/* CSS Document */ +body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;} +div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;} +div,img,tr,td{ border:0;} +table,tr,td{border:0; cellspacing:0; cellpadding:0;} +ul,li{ list-style-type:none} +.cl{ clear:both; overflow:hidden; } +a{ text-decoration:none; } +a:hover{ text-decoration:underline; } +.ml10{ margin-left:10px;} +.ml20{ margin-left:20px;} +.mr10{ margin-right:10px;} +.fl{ float: left;} +.fr{ float:right;} + +/*问卷列表*/ +.polls_content{ width:677px;} +.polls_head{ width:677px; height:48px; background:#eaeaea;} +.polls_head h2{ float:left; font-size:14px; color:#585858; margin:11px 0 0 10px;} +.polls_head span{ font-weight:normal; color:#15bccf;} +a.newbtn{ float:right; display:block; width:80px; height:30px; background:#64bdd9; color:#fff; font-size:14px; margin:10px; text-align:center;} +a:hover.newbtn{ background:#55a1b9; text-decoration:none;} +.polls_list ul{ padding-left:10px; border-bottom:1px dashed #c9c9c9; height:32px; padding-top:8px;} +a.polls_title{ font-weight:bold; color:#3e6d8e;} +a.pollsbtn{ display:block; width:66px; height:22px; text-align:center; border:1px solid #64bdd9; color:#64bdd9;} +a:hover.pollsbtn{ background:#64bdd9; color:#fff; text-decoration:none;} +.polls_date{ color:#666666;} +.polls_de{ color:#6883b6;} +/****翻页***/ +.wlist{} +.wlist a{ float:right; border:1px solid #64bdd9; padding:0 5px; margin-left:3px; color:#64bdd9;} +.wlist a:hover{border:1px solid #64bdd9; background-color:#64bdd9; color:#fff; text-decoration:none;} +.wlist_select a { background-color:#48aac9; color:#fff;} + +/*问卷内容*/ +.polls_box{ border:1px solid #dcdcdc; padding:15px 30px 30px;} +.ur_page_title{ font-size:16px; text-align:center; color:#353535;} +.ur_prefix_content{ color:#656565; text-indent:30px; margin-top:10px; } +.ur_card{border-top:1px solid #dcdcdc;margin-top:20px;} +.ur_title{ padding:5px 0px 15px; border-bottom:1px solid #dcdcdc; } From f54cf536632c8b380180b07b66c92400e922971a Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 12 Jan 2015 17:25:48 +0800 Subject: [PATCH 015/169] =?UTF-8?q?1.=E9=97=AE=E5=8D=B7=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=8A=A8=E6=80=81=E6=98=BE=E7=A4=BA=EF=BC=8C?= =?UTF-8?q?=202.=E9=97=AE=E5=8D=B7=E8=B0=83=E6=9F=A5=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=BC=95=E8=B5=B7base=5Fcourse=E7=9A=84=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/index.html.erb | 52 ++++++++++++++++++++++++++++++++++- public/stylesheets/polls.css | 24 ++++++++-------- 2 files changed, 63 insertions(+), 13 deletions(-) diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb index 3c78c257e..68d16f4f7 100644 --- a/app/views/poll/index.html.erb +++ b/app/views/poll/index.html.erb @@ -1 +1,51 @@ -1111111111111 \ No newline at end of file + + + + + 问卷调查_列表 + <%= stylesheet_link_tag 'polls', :media => 'all' %> + + + +
+
+

所有问卷 + (<%= @polls.count%>) +

+ 新建问卷 +
+
+
+ <% @polls.each do |poll|%> + +
+ <% end%> + + +
+
+ +
+ + diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css index 8621c20dc..9d3059245 100644 --- a/public/stylesheets/polls.css +++ b/public/stylesheets/polls.css @@ -1,17 +1,17 @@ /* CSS Document */ -body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;} +#polls{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;} div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;} -div,img,tr,td{ border:0;} -table,tr,td{border:0; cellspacing:0; cellpadding:0;} -ul,li{ list-style-type:none} -.cl{ clear:both; overflow:hidden; } -a{ text-decoration:none; } -a:hover{ text-decoration:underline; } -.ml10{ margin-left:10px;} -.ml20{ margin-left:20px;} -.mr10{ margin-right:10px;} -.fl{ float: left;} -.fr{ float:right;} +#polls div,img,tr,td{ border:0;} +#polls table,tr,td{border:0; cellspacing:0; cellpadding:0;} +#polls ul,li{ list-style-type:none} +#polls .cl{ clear:both; overflow:hidden; } +#polls a{ text-decoration:none; } +#polls a:hover{ text-decoration:underline; } +#polls .ml10{ margin-left:10px;} +#polls .ml20{ margin-left:20px;} +#polls .mr10{ margin-right:10px;} +#polls .fl{ float: left;} +#polls .fr{ float:right;} /*问卷列表*/ .polls_content{ width:677px;} From 450c4b203dd2138cd3919ecb730b4bd29765eb41 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 12 Jan 2015 17:30:33 +0800 Subject: [PATCH 016/169] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E9=97=AE=E5=8D=B7=E6=8C=89=E9=92=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/index.html.erb | 2 +- app/views/poll/new.html.erb | 1 + config/locales/zh.yml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb index 68d16f4f7..7c1529406 100644 --- a/app/views/poll/index.html.erb +++ b/app/views/poll/index.html.erb @@ -12,7 +12,7 @@

所有问卷 (<%= @polls.count%>)

- 新建问卷 + <%= link_to l(:label_new_poll), new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => "newbtn" %>
diff --git a/app/views/poll/new.html.erb b/app/views/poll/new.html.erb index e69de29bb..9d07aa0df 100644 --- a/app/views/poll/new.html.erb +++ b/app/views/poll/new.html.erb @@ -0,0 +1 @@ +111 \ No newline at end of file diff --git a/config/locales/zh.yml b/config/locales/zh.yml index f3e6d4d8d..b6a293c6a 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2243,4 +2243,5 @@ zh: label_file_exist: 该作品中有重复命名文件,请通过文件名学号和姓名信息进入该作业详细界面手动下载 label_poll_new: 未命名问卷 label_poll: 问卷调查 + label_new_poll: 新建问卷 From 6efe9ff5c6116c3a9a46de9847971179b740fc20 Mon Sep 17 00:00:00 2001 From: z9hang Date: Mon, 12 Jan 2015 17:34:26 +0800 Subject: [PATCH 017/169] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=8E=89=E6=97=A0?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E6=96=B9=E6=B3=95=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 0fcf35aff..7b4d488a9 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -41,7 +41,7 @@ class UsersController < ApplicationController :activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index, :activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index] before_filter :auth_user_extension, only: :show - before_filter :rest_user_score, only: :show + #before_filter :rest_user_score, only: :show #before_filter :select_entry, only: :user_projects accept_api_auth :index, :show, :create, :update, :destroy,:tag_save , :tag_saveEx From d0dc01b99215177f7495e8fad7090277e9a96c72 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 12 Jan 2015 17:55:22 +0800 Subject: [PATCH 018/169] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=97=AE=E5=8D=B7?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E7=9B=B8=E5=85=B3js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 4 ++-- app/views/poll/destroy.js.erb | 5 ++++- app/views/poll/index.html.erb | 9 ++++++--- config/locales/zh.yml | 1 + 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 2a190166f..5f0119022 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -1,5 +1,5 @@ class PollController < ApplicationController - before_filter :find_poll_and_course, :only => [:edit,:update,:destory] + before_filter :find_poll_and_course, :only => [:edit,:update,:destroy] before_filter :find_container, :only => [:new,:create, :index] def index @@ -59,7 +59,7 @@ class PollController < ApplicationController end def destroy - if @poll.destroy + if @poll && @poll.destroy respond_to do |format| format.js end diff --git a/app/views/poll/destroy.js.erb b/app/views/poll/destroy.js.erb index a9efe790e..abfecb167 100644 --- a/app/views/poll/destroy.js.erb +++ b/app/views/poll/destroy.js.erb @@ -1 +1,4 @@ -alert("删除成功"); \ No newline at end of file +<% if @poll%> + $("#polls_<%= @poll.id%>").remove(); +<%else%> +<% end %> diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb index 7c1529406..39230774b 100644 --- a/app/views/poll/index.html.erb +++ b/app/views/poll/index.html.erb @@ -17,17 +17,20 @@
<% @polls.each do |poll|%> -
    +
    • <%= poll.polls_name%>
    • - 统计结果 + + <%= l(:label_statistical_results)%> +
    • - 删除 + <%= link_to(l(:button_delete), poll, + method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml20 mr10") %>
    • <%= format_time poll.created_at%> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index b6a293c6a..7c93f8e98 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2244,4 +2244,5 @@ zh: label_poll_new: 未命名问卷 label_poll: 问卷调查 label_new_poll: 新建问卷 + label_statistical_results: 统计结果 From 90925edce29199019eb1176bac9fc3297230d785 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Mon, 12 Jan 2015 17:56:09 +0800 Subject: [PATCH 019/169] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E6=84=8F?= =?UTF-8?q?=E8=A7=81=E5=8F=8D=E9=A6=88=E9=A1=B5=E9=9D=A2css=E5=BC=95?= =?UTF-8?q?=E8=B5=B7=E7=9A=84css=E9=94=99=E4=B9=B1=E3=80=8B=E5=92=8C?= =?UTF-8?q?=E3=80=8A=E8=AF=BE=E7=A8=8B=E9=A6=96=E9=A1=B5=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=A4=AA=E5=B0=91=E3=80=8Bbug=20Signed-off-by:=20alan=20<54753?= =?UTF-8?q?3434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_feedback.html.erb | 6 +++--- .../lib/acts_as_activity_provider.rb | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb index 859ed0361..62b3a01e3 100644 --- a/app/views/layouts/_base_feedback.html.erb +++ b/app/views/layouts/_base_feedback.html.erb @@ -62,7 +62,7 @@ function f_submit() - <%= radio_button "poll_vote","poll_answer_id",pa.id,:class=>"ur_radio",:onclick =>"click_#{pa.id}(this);return false;",:checked => answer_be_selected?(pa,User.current) %> + <%= radio_button "poll_vote","poll_answer_id",pa.id,:class=>"ur_radio",:onclick =>"click_#{pa.id}(this);return false;",:checked => answer_be_selected?(pa,User.current),:disabled => !@can_edit_poll %> <%= pa.answer_text %> @@ -130,7 +130,7 @@ }); } - > + <%= @can_edit_poll?"":"disabled=disabled" %> > <%= pa.answer_text %> @@ -171,7 +171,7 @@ } - + >
<% elsif pq.question_type == 4 %> @@ -203,7 +203,7 @@ }); } -
<%= get_anwser_vote_text(pq.id,User.current.id) %>
+
" onblur="onblur_<%= pq.id %>(this);"><%= get_anwser_vote_text(pq.id,User.current.id) %>
diff --git a/public/plugin_assets/redmine_code_review/stylesheets/window_js/mac_os_x_dialog.css b/public/plugin_assets/redmine_code_review/stylesheets/window_js/mac_os_x_dialog.css index 4c89f602d..e663e3c5e 100644 --- a/public/plugin_assets/redmine_code_review/stylesheets/window_js/mac_os_x_dialog.css +++ b/public/plugin_assets/redmine_code_review/stylesheets/window_js/mac_os_x_dialog.css @@ -1,160 +1,160 @@ -.overlay_mac_os_x_dialog { - background-color: #FF7224; - filter:alpha(opacity=60); - -moz-opacity: 0.6; - opacity: 0.6; -} - -.mac_os_x_dialog_nw { - background: transparent url(mac_os_x_dialog/L.png) repeat-y top left; - width:16px; - height:16px; -} - -.mac_os_x_dialog_n { - background: transparent url(mac_os_x_dialog/bg.gif) repeat 0 0; - height:18px; -} - -.mac_os_x_dialog_ne { - background: transparent url(mac_os_x_dialog/R.png) repeat-y top left; - width:16px; - height:16px; -} - -.mac_os_x_dialog_w { - background: transparent url(mac_os_x_dialog/L.png) repeat-y top left; - width:16px; -} - -.mac_os_x_dialog_e { - background: transparent url(mac_os_x_dialog/R.png) repeat-y top right; - width:16px; -} - -.mac_os_x_dialog_sw { - background: transparent url(mac_os_x_dialog/BL.png) no-repeat 0 0; - width:31px; - height:40px; -} - -.mac_os_x_dialog_s { - background: transparent url(mac_os_x_dialog/B.png) repeat-x 0 0; - height:40px; -} - -.mac_os_x_dialog_se, .mac_os_x_dialog_sizer { - background: transparent url(mac_os_x_dialog/BR.png) no-repeat 0 0; - width:31px; - height:40px; -} - -.mac_os_x_dialog_sizer { - cursor:se-resize; -} - -.mac_os_x_dialog_close { - width: 19px; - height: 19px; - background: transparent url(mac_os_x_dialog/close.gif) no-repeat 0 0; - position:absolute; - top:12px; - left:25px; - cursor:pointer; - z-index:1000; -} - -.mac_os_x_dialog_minimize { - width: 19px; - height: 19px; - background: transparent url(mac_os_x_dialog/minimize.gif) no-repeat 0 0; - position:absolute; - top:12px; - left:45px; - cursor:pointer; - z-index:1000; -} - -.mac_os_x_dialog_maximize { - width: 19px; - height: 19px; - background: transparent url(mac_os_x_dialog/maximize.gif) no-repeat 0 0; - position:absolute; - top:12px; - left:65px; - cursor:pointer; - z-index:1000; -} - -.mac_os_x_dialog_title { - float:left; - height:14px; - font-family: Tahoma, Arial, sans-serif; - font-size:12px; - text-align:center; - margin-top:6px; - width:100%; - color:#000; -} - -.mac_os_x_dialog_content { - overflow:auto; - color: #222; - font-family: Tahoma, Arial, sans-serif; - font-size: 10px; - background: transparent url(mac_os_x_dialog/bg.gif) repeat 0 0; -} - -.mac_os_x_dialog_buttons { - text-align: center; -} -/* FOR IE */ -* html .mac_os_x_dialog_nw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/L.png", sizingMethod="scale"); -} - - -* html .mac_os_x_dialog_ne { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/R.png", sizingMethod="scale"); -} - -* html .mac_os_x_dialog_w { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/L.png", sizingMethod="scale"); -} - -* html .mac_os_x_dialog_e { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/R.png", sizingMethod="scale"); -} - -* html .mac_os_x_dialog_sw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BL.png", sizingMethod="crop"); -} - -* html .mac_os_x_dialog_s { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/B.png", sizingMethod="scale"); -} - -* html .mac_os_x_dialog_se { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BR.png", sizingMethod="crop"); -} - -* html .mac_os_x_dialog_sizer { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BR.png", sizingMethod="crop"); -} - +.overlay_mac_os_x_dialog { + background-color: #FF7224; + filter:alpha(opacity=60); + -moz-opacity: 0.6; + opacity: 0.6; +} + +.mac_os_x_dialog_nw { + background: transparent url(mac_os_x_dialog/L.png) repeat-y top left; + width:16px; + height:16px; +} + +.mac_os_x_dialog_n { + background: transparent url(mac_os_x_dialog/bg.gif) repeat 0 0; + height:18px; +} + +.mac_os_x_dialog_ne { + background: transparent url(mac_os_x_dialog/R.png) repeat-y top left; + width:16px; + height:16px; +} + +.mac_os_x_dialog_w { + background: transparent url(mac_os_x_dialog/L.png) repeat-y top left; + width:16px; +} + +.mac_os_x_dialog_e { + background: transparent url(mac_os_x_dialog/R.png) repeat-y top right; + width:16px; +} + +.mac_os_x_dialog_sw { + background: transparent url(mac_os_x_dialog/BL.png) no-repeat 0 0; + width:31px; + height:40px; +} + +.mac_os_x_dialog_s { + background: transparent url(mac_os_x_dialog/B.png) repeat-x 0 0; + height:40px; +} + +.mac_os_x_dialog_se, .mac_os_x_dialog_sizer { + background: transparent url(mac_os_x_dialog/BR.png) no-repeat 0 0; + width:31px; + height:40px; +} + +.mac_os_x_dialog_sizer { + cursor:se-resize; +} + +.mac_os_x_dialog_close { + width: 19px; + height: 19px; + background: transparent url(mac_os_x_dialog/close.gif) no-repeat 0 0; + position:absolute; + top:12px; + left:25px; + cursor:pointer; + z-index:1000; +} + +.mac_os_x_dialog_minimize { + width: 19px; + height: 19px; + background: transparent url(mac_os_x_dialog/minimize.gif) no-repeat 0 0; + position:absolute; + top:12px; + left:45px; + cursor:pointer; + z-index:1000; +} + +.mac_os_x_dialog_maximize { + width: 19px; + height: 19px; + background: transparent url(mac_os_x_dialog/maximize.gif) no-repeat 0 0; + position:absolute; + top:12px; + left:65px; + cursor:pointer; + z-index:1000; +} + +.mac_os_x_dialog_title { + float:left; + height:14px; + font-family: Tahoma, Arial, sans-serif; + font-size:12px; + text-align:center; + margin-top:6px; + width:100%; + color:#000; +} + +.mac_os_x_dialog_content { + overflow:auto; + color: #222; + font-family: Tahoma, Arial, sans-serif; + font-size: 10px; + background: transparent url(mac_os_x_dialog/bg.gif) repeat 0 0; +} + +.mac_os_x_dialog_buttons { + text-align: center; +} +/* FOR IE */ +* html .mac_os_x_dialog_nw { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/L.png", sizingMethod="scale"); +} + + +* html .mac_os_x_dialog_ne { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/R.png", sizingMethod="scale"); +} + +* html .mac_os_x_dialog_w { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/L.png", sizingMethod="scale"); +} + +* html .mac_os_x_dialog_e { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/R.png", sizingMethod="scale"); +} + +* html .mac_os_x_dialog_sw { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BL.png", sizingMethod="crop"); +} + +* html .mac_os_x_dialog_s { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/B.png", sizingMethod="scale"); +} + +* html .mac_os_x_dialog_se { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BR.png", sizingMethod="crop"); +} + +* html .mac_os_x_dialog_sizer { + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BR.png", sizingMethod="crop"); +} + diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css index b13cb1da2..e89e50be4 100644 --- a/public/stylesheets/polls.css +++ b/public/stylesheets/polls.css @@ -27,6 +27,7 @@ a.newbtn{ float:right; display:block; width:80px; height:30px; background:#64bdd a:hover.newbtn{ background:#55a1b9; text-decoration:none;} .polls_list ul{ padding-left:10px; border-bottom:1px dashed #c9c9c9; height:32px; padding-top:8px;} a.polls_title{ font-weight:bold; color:#3e6d8e;} +.polls_title{ font-weight:bold; color:#3e6d8e;} a.pollsbtn{ display:block; width:66px; height:22px; text-align:center; border:1px solid #64bdd9; color:#64bdd9;} a:hover.pollsbtn{ background:#64bdd9; color:#fff; text-decoration:none;} .polls_date{ color:#666666;} From 9fb0275563b12d3416662f35a7e9b71bbc478724 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 16 Jan 2015 10:43:05 +0800 Subject: [PATCH 069/169] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=8D=95=E9=80=89=E9=A2=98=E6=97=B6=E9=A1=B5=E9=9D=A2js?= =?UTF-8?q?=E7=9A=84=E5=88=B7=E6=96=B0=202.=E4=BF=AE=E6=94=B9=E5=8D=95?= =?UTF-8?q?=E9=80=89=E9=A2=98=E6=97=B6=E5=88=A0=E9=99=A4=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E6=9C=89=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 2 +- app/views/poll/_poll_question.html.erb | 12 ++++++++++++ app/views/poll/update_poll_question.js.erb | 8 ++++++-- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 app/views/poll/_poll_question.html.erb diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 2f3c344cb..c82b9a385 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -122,7 +122,7 @@ class PollController < ApplicationController ################处理选项 if params[:question_answer] @poll_question.poll_answers.each do |answer| - @poll_question.poll_answers.destroy answer unless params[:question_answer].keys.include? answer.id.to_s + answer.destroy unless params[:question_answer].keys.include? answer.id.to_s end for i in 1..params[:question_answer].count question = @poll_question.poll_answers.find_by_id params[:question_answer].keys[i-1] diff --git a/app/views/poll/_poll_question.html.erb b/app/views/poll/_poll_question.html.erb new file mode 100644 index 000000000..7731c9821 --- /dev/null +++ b/app/views/poll/_poll_question.html.erb @@ -0,0 +1,12 @@ + +<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %> + + + + + +<% end %> + \ No newline at end of file diff --git a/app/views/poll/update_poll_question.js.erb b/app/views/poll/update_poll_question.js.erb index 267a27ae2..39d0fcfd6 100644 --- a/app/views/poll/update_poll_question.js.erb +++ b/app/views/poll/update_poll_question.js.erb @@ -1,2 +1,6 @@ - -pollQuestionCancel(<%= @poll_question.id%>); \ No newline at end of file +$("#poll_questions_<%= @poll_question.id%>").html("
" + + "<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @poll_question}) %>" + + "
" + + ""); From 34b8ffeb5bbde39d7a5d666904775ad4a4f7708a Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 16 Jan 2015 10:51:08 +0800 Subject: [PATCH 070/169] tongji --- app/controllers/poll_controller.rb | 16 ++++++++++++++-- app/controllers/projects_controller.rb | 4 ++-- app/views/poll/_choice_show.html.erb | 5 +++-- app/views/poll/statistics_result.html.erb | 8 +++++--- db/schema.rb | 2 +- 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 084c43545..774923404 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -78,12 +78,24 @@ class PollController < ApplicationController end def statistics_result - @poll_questions = PollQuestion.all + @poll = Poll.find(params[:id]) + @offset, @limit = api_offset_and_limit({:limit => 10}) + @poll_questions = @poll.poll_questions + @poll_questions_count = @poll_questions.count + @poll_questions_pages = Paginator.new @poll_questions_count, @limit, params['page'] respond_to do |format| format.html{render :layout => 'base_courses'} end end + def get_poll_totalcount poll_question + @total_questions_count = poll_question.poll_votes.count + end + + def get_poll_everycount poll_answer + @every_answer_count = poll_answer.poll_votes.count + end + #添加单选题 def create_poll_question question_title = params[:poll_questions_title].nil? || params[:poll_questions_title].empty? ? l(:label_enter_single_title) : params[:poll_questions_title] @@ -111,7 +123,7 @@ class PollController < ApplicationController end end - private + private def find_poll_and_course @poll = Poll.find params[:id] @course = Course.find @poll.polls_group_id diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 5d43a4e20..5ff9a3f17 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -116,8 +116,8 @@ class ProjectsController < ApplicationController joins("LEFT JOIN #{ProjectStatus.table_name} ON #{Project.table_name}.id = #{ProjectStatus.table_name}.project_id").joins("LEFT JOIN #{ProjectScore.table_name} ON #{Project.table_name}.id = #{ProjectScore.table_name}.project_id"). where("#{Project.table_name}.project_type = ? ", Project::ProjectType_project) - @project_count = @projects_all.count - @project_pages = Paginator.new @project_count, per_page_option, params['page'] + @poll_questions_count = @projects_all.count + @poll_questions_pages = Paginator.new @project_count, per_page_option, params['page'] #gcm activity count diff --git a/app/views/poll/_choice_show.html.erb b/app/views/poll/_choice_show.html.erb index a37ca148a..aa425e748 100644 --- a/app/views/poll/_choice_show.html.erb +++ b/app/views/poll/_choice_show.html.erb @@ -1,3 +1,4 @@ +
@@ -9,13 +10,13 @@ <% poll_question.poll_answers.each do |poll_answer| %> - + <% end %> - + diff --git a/app/views/poll/statistics_result.html.erb b/app/views/poll/statistics_result.html.erb index f0f992c90..1bdbb0ff1 100644 --- a/app/views/poll/statistics_result.html.erb +++ b/app/views/poll/statistics_result.html.erb @@ -17,19 +17,21 @@
  1. - 第1题:问题描述问题描述<%= poll_question.question_title %> [单选题]<% poll_question.poll_answers %> + 第<%= poll_question.question_number %>题:<%= poll_question.question_title %> [单选题]<% poll_question.poll_answers %>
    <%= render :partial =>'choice_show', :locals =>{ :poll_question => poll_question } %>
+ <% end %>
-
答题已完成 0%
- +
答题已完成 0%
diff --git a/db/schema.rb b/db/schema.rb index 6c2a9f58a..f9ea40ae9 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 => 20150112090810) do +ActiveRecord::Schema.define(:version => 20150114022710) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false From 0dc0ba3a4a36070971f9413c419b7713e3aa24c5 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 16 Jan 2015 10:59:25 +0800 Subject: [PATCH 071/169] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=9D=83=E9=99=90=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/index.html.erb | 68 ++++++++++++++++++++--------------- app/views/poll/show.html.erb | 4 ++- 2 files changed, 43 insertions(+), 29 deletions(-) diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb index e45bdfabb..0e5e956ca 100644 --- a/app/views/poll/index.html.erb +++ b/app/views/poll/index.html.erb @@ -11,34 +11,46 @@
<% @polls.each do |poll|%> -
    -
  • - <% if has_commit_poll?(poll.id ,User.current) %> - <%= poll.polls_name %> - <% else %> - <%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %> - <% end %> -
  • -
  • - <%if @is_teacher%> - <%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%> - <% end%> -
  • -
  • - <% if @is_teacher%> - <%= link_to(l(:button_delete), poll, - method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml20 mr10") %> - <% end%> -
  • -
  • - <% if @is_teacher%> - <%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml20"%> - <% end%> -
  • -
  • - <%= format_time poll.created_at%> -
  • -
+ + <% unless !@is_teacher && poll.polls_status != 2 %> +
    +
  • + <% if @is_teacher %> + <% if has_commit_poll?(poll.id ,User.current) %> + <%= poll.polls_name %> + <% else %> + <%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %> + <% end %> + <% else %> + <% if has_commit_poll?(poll.id ,User.current) && poll.polls_status == 2 %> + <%= poll.polls_name %> + <% elsif (!has_commit_poll?(poll.id ,User.current)) && poll.polls_status == 2 %> + <%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %> + <% end %> + <% end %> +
  • +
  • + <%if @is_teacher%> + <%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%> + <% end%> +
  • +
  • + <% if @is_teacher && poll.polls_status == 1 #新建状态的问卷可删除%> + <%= link_to(l(:button_delete), poll, + method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml20 mr10") %> + <% end%> +
  • +
  • + <% if @is_teacher && poll.polls_status == 1 #新建状态的问卷可编辑%> + <%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml20"%> + <% end%> +
  • +
  • + <%= format_time poll.created_at%> +
  • +
+ <% end %> +
<% end%> diff --git a/app/views/poll/show.html.erb b/app/views/poll/show.html.erb index dca45c25c..2db0045f6 100644 --- a/app/views/poll/show.html.erb +++ b/app/views/poll/show.html.erb @@ -217,7 +217,9 @@
- <%= link_to "提交",commit_poll_poll_path(@poll), :method => :post,:class => "ur_button",:format => 'js',:remote=>true %> + <% if @poll.polls_status == 2 %> + <%= link_to "提交",commit_poll_poll_path(@poll), :method => :post,:class => "ur_button",:format => 'js',:remote=>true %> + <% end %>
答题已完成 0%
From a683acf85c465cc75c7b7a41d54c2c8f2826fab1 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 16 Jan 2015 11:05:04 +0800 Subject: [PATCH 072/169] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E9=97=AE=E5=8D=B7=E6=97=B6=E5=88=B7=E6=96=B0=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E4=BC=9A=E6=96=B0=E5=BB=BA=E4=B8=80=E4=B8=AA=E9=97=AE?= =?UTF-8?q?=E5=8D=B7=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index a843e9d9b..9c5f810c6 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -46,9 +46,7 @@ class PollController < ApplicationController } @poll = Poll.create option if @poll - respond_to do |format| - format.html{render :layout => 'base_courses'} - end + redirect_to edit_poll_url @poll.id end elsif @project #项目的问卷调查相关代码 From a5cf1576f1626d7eeebe79c812270e129418d4de Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 16 Jan 2015 13:44:20 +0800 Subject: [PATCH 073/169] =?UTF-8?q?=E5=B0=86=E6=96=B0=E5=A2=9E=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E6=A0=8F=E6=94=BE=E5=88=B0=E9=97=AE=E9=A2=98=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E4=B8=8B=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_poll_form.html.erb | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb index 598ef1207..1c2afc27c 100644 --- a/app/views/poll/_poll_form.html.erb +++ b/app/views/poll/_poll_form.html.erb @@ -60,6 +60,19 @@
+ +
+ <%= render :partial => 'show_head', :locals => {:poll => @poll}%> +
+ + + +
+ <%= render :partial => 'poll_content', :locals => {:poll => @poll}%> +
+
  • @@ -86,19 +99,6 @@
- -
- <%= render :partial => 'show_head', :locals => {:poll => @poll}%> -
- - - -
- <%= render :partial => 'poll_content', :locals => {:poll => @poll}%> -
-
From 2954bba4117c7d852a1e7a5f88b7db51f01fb07e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 16 Jan 2015 13:54:06 +0800 Subject: [PATCH 074/169] =?UTF-8?q?j=E8=BF=9B=E5=85=A5=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E3=80=81=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E9=97=AE=E5=8D=B7=E5=A4=B4=E6=98=BE=E7=A4=BA=E4=B8=BA=E5=8F=AF?= =?UTF-8?q?=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_poll_form.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb index 1c2afc27c..1b30c973d 100644 --- a/app/views/poll/_poll_form.html.erb +++ b/app/views/poll/_poll_form.html.erb @@ -61,10 +61,10 @@
-
+ - +<% end%> \ No newline at end of file diff --git a/app/views/poll/_new_MC.html.erb b/app/views/poll/_new_MC.html.erb index 013bf0ed0..f4f1ef676 100644 --- a/app/views/poll/_new_MC.html.erb +++ b/app/views/poll/_new_MC.html.erb @@ -1,6 +1,5 @@ <%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%> -
- +
@@ -35,11 +34,10 @@
-
<% end%> \ No newline at end of file diff --git a/app/views/poll/_new_MCQ.html.erb b/app/views/poll/_new_MCQ.html.erb index 6739c233e..23f216427 100644 --- a/app/views/poll/_new_MCQ.html.erb +++ b/app/views/poll/_new_MCQ.html.erb @@ -1,33 +1,41 @@ -
+<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>
- + + - - + +
    -
  • - - - - +
  • + + + +
  • -
    -
  • - - - - +
    +
  • + + + +
  • -
    +
    +
  • + + + + +
  • +
-
\ No newline at end of file +<% end%> \ No newline at end of file diff --git a/app/views/poll/_show_MC.html.erb b/app/views/poll/_show_MC.html.erb index f3fc9c8b5..594baea9d 100644 --- a/app/views/poll/_show_MC.html.erb +++ b/app/views/poll/_show_MC.html.erb @@ -7,7 +7,7 @@ <%if poll_question.is_necessary == 1%> * <%end%> - + (单选题)
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id), method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %> diff --git a/app/views/poll/_show_MCQ.html.erb b/app/views/poll/_show_MCQ.html.erb index e56de53b9..64e39523a 100644 --- a/app/views/poll/_show_MCQ.html.erb +++ b/app/views/poll/_show_MCQ.html.erb @@ -1,28 +1,31 @@
- 第2题: 多选题 * + + 第<%= poll_question.question_number%>题: + + <%= poll_question.question_title %> + <%if poll_question.is_necessary == 1%> + * + <%end%> + (多选题)
- - + <%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id), + method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %> +
<%= poll_answer.answer_text %> 24 <% poll_answer.poll_votes.count %>
75%
本题有效填写人次 26<%= poll_question.poll_votes.count %>  
- - - - - - - - - + <% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %> + + + + <% end %>
- -
- -
- -
+ +
diff --git a/app/views/poll/create_poll_question.js.erb b/app/views/poll/create_poll_question.js.erb index 18f999157..ac44ebb4c 100644 --- a/app/views/poll/create_poll_question.js.erb +++ b/app/views/poll/create_poll_question.js.erb @@ -1,10 +1,26 @@ $("#new_poll_question").html(""); $("#poll_content").append("
" + "
" + + "<% if @poll_questions.question_type == 1%>" + "<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @poll_questions}) %>" + + "<% elsif @poll_questions.question_type == 2%>" + + "<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:poll_question => @poll_questions}) %>" + + "<% elsif @poll_questions.question_type == 3%>" + + "<%= escape_javascript(render :partial => 'show_single', :locals => {:poll_question => @poll_questions}) %>" + + "<% elsif @poll_questions.question_type == 4%>" + + "<%= escape_javascript(render :partial => 'show_mulit', :locals => {:poll_question => @poll_questions}) %>" + + "<% end%>" + "
" + "" + "
"); From f46c8e8adc8cdd6c626667f538249520a168d9e4 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 16 Jan 2015 14:47:09 +0800 Subject: [PATCH 077/169] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E5=8D=95=E9=80=89?= =?UTF-8?q?=E3=80=81=E5=A4=9A=E9=80=89=E5=8F=96=E6=B6=88=E4=B9=8B=E5=90=8E?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E7=BB=A7=E7=BB=AD=E6=96=B0=E5=BB=BA=E7=9A=84?= =?UTF-8?q?BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_new_MC.html.erb | 2 +- app/views/poll/_new_MCQ.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/poll/_new_MC.html.erb b/app/views/poll/_new_MC.html.erb index f4f1ef676..5ff70e9eb 100644 --- a/app/views/poll/_new_MC.html.erb +++ b/app/views/poll/_new_MC.html.erb @@ -35,7 +35,7 @@
diff --git a/app/views/poll/_new_MCQ.html.erb b/app/views/poll/_new_MCQ.html.erb index 23f216427..d94964bbf 100644 --- a/app/views/poll/_new_MCQ.html.erb +++ b/app/views/poll/_new_MCQ.html.erb @@ -34,7 +34,7 @@
From 65a3ddce41b921f5f3b0ec13867db4f451aad6d1 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 16 Jan 2015 15:05:30 +0800 Subject: [PATCH 078/169] =?UTF-8?q?1=E3=80=81=E5=A2=9E=E5=8A=A0=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=8D=95=E8=A1=8C=E6=96=87=E5=AD=97=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=202=E3=80=81=E4=BF=AE=E6=94=B9=E9=A2=98=E7=9B=AE=E5=90=8E?= =?UTF-8?q?=E6=80=BB=E6=98=AF=E6=98=BE=E7=A4=BA=E4=B8=BA=E5=8D=95=E9=80=89?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 3 +-- app/views/poll/_edit_single.html.erb | 14 +++++++---- app/views/poll/_new_single.html.erb | 29 ++++++++++++---------- app/views/poll/_show_single.html.erb | 14 ++++++++--- app/views/poll/update_poll_question.js.erb | 20 +++++++++++++-- 5 files changed, 55 insertions(+), 25 deletions(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 9c5f810c6..fc23166ff 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -119,8 +119,7 @@ class PollController < ApplicationController #修改单选题 def update_poll_question @poll_question = PollQuestion.find params[:poll_question] - @poll = @poll_question.poll - + #@poll = @poll_question.poll @poll_question.is_necessary = params[:is_necessary]=="true" ? 1 : 0 @poll_question.question_title = params[:poll_questions_title].nil? || params[:poll_questions_title].empty? ? l(:label_enter_single_title) : params[:poll_questions_title] ################处理选项 diff --git a/app/views/poll/_edit_single.html.erb b/app/views/poll/_edit_single.html.erb index 4e98babe4..b8157ee6c 100644 --- a/app/views/poll/_edit_single.html.erb +++ b/app/views/poll/_edit_single.html.erb @@ -1,13 +1,17 @@ +<%= form_for("",:url => update_poll_question_poll_index_path(:poll_question => poll_question.id),:remote => true) do |f|%>
- - + + + />
-
\ No newline at end of file + +<% end%> \ No newline at end of file diff --git a/app/views/poll/_new_single.html.erb b/app/views/poll/_new_single.html.erb index b7d5a9725..ec06933a8 100644 --- a/app/views/poll/_new_single.html.erb +++ b/app/views/poll/_new_single.html.erb @@ -1,13 +1,16 @@ -
-
- - - - -
- -
-
\ No newline at end of file +<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%> +
+
+ + + + + +
+ +
+
+<% end%> \ No newline at end of file diff --git a/app/views/poll/_show_single.html.erb b/app/views/poll/_show_single.html.erb index 437e38044..d9ef2abc7 100644 --- a/app/views/poll/_show_single.html.erb +++ b/app/views/poll/_show_single.html.erb @@ -1,9 +1,17 @@
- 第3题: 单行文字 + + 第<%= poll_question.question_number%>题: + + <%= poll_question.question_title %> + <%if poll_question.is_necessary == 1%> + * + <%end%> + (单行文字)
- - + <%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id), + method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %> +
diff --git a/app/views/poll/update_poll_question.js.erb b/app/views/poll/update_poll_question.js.erb index 39d0fcfd6..e0727df67 100644 --- a/app/views/poll/update_poll_question.js.erb +++ b/app/views/poll/update_poll_question.js.erb @@ -1,6 +1,22 @@ $("#poll_questions_<%= @poll_question.id%>").html("
" + - "<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @poll_question}) %>" + + "<% if @poll_question.question_type == 1%>" + + "<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @poll_question}) %>" + + "<% elsif @poll_question.question_type == 2%>" + + "<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:poll_question => @poll_question}) %>" + + "<% elsif @poll_question.question_type == 3%>" + + "<%= escape_javascript(render :partial => 'show_single', :locals => {:poll_question => @poll_question}) %>" + + "<% elsif @poll_question.question_type == 4%>" + + "<%= escape_javascript(render :partial => 'show_mulit', :locals => {:poll_question => @poll_question}) %>" + + "<% end%>" + "
" + ""); From 0a367249ae3b7f3fb32072316c5324f55ed570e8 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 16 Jan 2015 15:32:09 +0800 Subject: [PATCH 079/169] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=BA=A6=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 90 +++++++++++++++++++++------ app/views/poll/_commit_alert.html.erb | 2 +- app/views/poll/show.html.erb | 27 ++++++-- 3 files changed, 95 insertions(+), 24 deletions(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index a843e9d9b..8f89c1a9e 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -24,6 +24,7 @@ class PollController < ApplicationController render_403 else @can_edit_poll = (!has_commit_poll?(@poll.id,User.current.id)) || User.current.admin? + @percent = get_percent(@poll,User.current) poll_questions = @poll.poll_questions @poll_questions = paginateHelper poll_questions,3 #分页 respond_to do |format| @@ -172,7 +173,7 @@ class PollController < ApplicationController def commit_answer pq = PollQuestion.find(params[:poll_question_id]) if has_commit_poll?(@poll.id,User.current.id) && (!User.current.admin?) - render :text => 'failure' + render :json => {:text => "failure"} return end if pq.question_type == 1 @@ -185,9 +186,10 @@ class PollController < ApplicationController end pv.poll_answer_id = params[:poll_answer_id] if pv.save - render :text => "ok" + @percent = get_percent(@poll,User.current) + render :json => {:text => "ok" ,:percent => format("%.2f" ,@percent)} else - render :text => "failure" + render :json => {:text => "failure"} end elsif pq.question_type == 2 pv = PollVote.find_by_poll_answer_id_and_user_id(params[:poll_answer_id],User.current.id) @@ -197,38 +199,64 @@ class PollController < ApplicationController pv.poll_question_id = params[:poll_question_id] pv.poll_answer_id = params[:poll_answer_id] if pv.save - render :text => "true" + @percent = get_percent(@poll,User.current) + render :json => {:text => "true",:percent => format("%.2f" ,@percent)} else - render :text => "failure" + render :json => {:text => "failure"} end else if pv.delete - render :text => "false" + @percent = get_percent(@poll,User.current) + render :json => {:text => "false" ,:percent => format("%.2f" ,@percent)} else - render :text => "failure" + render :json => {:text => "failure"} end end elsif pq.question_type == 3 || pq.question_type == 4 pv = PollVote.find_by_poll_question_id_and_user_id(params[:poll_question_id],User.current.id) if pv.nil? - pv = PollVote.new - pv.user_id = User.current.id - pv.poll_question_id = params[:poll_question_id] - end - pv.vote_text = params[:vote_text] - if pv.save - render :text => pv.vote_text + if params[:vote_text].nil? || params[:vote_text].blank? + @percent = get_percent(@poll,User.current) + render :json => {:text => pv.vote_text,:percent => format("%.2f" ,@percent)} + else + pv = PollVote.new + pv.user_id = User.current.id + pv.poll_question_id = params[:poll_question_id] + pv.vote_text = params[:vote_text] + if pv.save + @percent = get_percent(@poll,User.current) + render :json => {:text => pv.vote_text,:percent => format("%.2f" ,@percent)} + else + render :json => {:text => "failure"} + end + end else - render :text => "failure" + if params[:vote_text].nil? || params[:vote_text].blank? + if pv.delete + @percent = get_percent(@poll,User.current) + render :json => {:text => pv.vote_text,:percent => format("%.2f" ,@percent)} + else + render :json => {:text => "failure"} + end + else + pv.vote_text = params[:vote_text] + if pv.save + @percent = get_percent(@poll,User.current) + render :json => {:text => pv.vote_text,:percent => format("%.2f" ,@percent)} + else + render :json => {:text => "failure"} + end + end end + else - render :text => "failure" + render :json => {:text => "failure"} end end #提交问卷 def commit_poll - @uncomplete_question = get_uncomplete_question(@poll) + @uncomplete_question = get_uncomplete_question(@poll,User.current) if @uncomplete_question.count < 1 pu = get_poll_user(@poll.id,User.current.id) pu.user_id = User.current.id @@ -277,17 +305,41 @@ class PollController < ApplicationController end #获取未完成的题目 - def get_uncomplete_question poll + def get_uncomplete_question poll,user necessary_questions = poll.poll_questions.where("#{PollQuestion.table_name}.is_necessary = 1") uncomplete_question = [] necessary_questions.each do |question| - if question.poll_votes.nil? || question.poll_votes.count < 1 + answers = get_user_answer(question,user) + if answers.nil? || answers.count < 1 uncomplete_question << question end end uncomplete_question end + #获取用户对某个问题的答案 + def get_user_answer(question,user) + user_answer = question.poll_votes.where("#{PollVote.table_name}.user_id = #{user.id}") + user_answer + end + + def get_complete_question(poll,user) + questions = poll.poll_questions + complete_question = [] + questions.each do |question| + answers = get_user_answer(question,user) + if !(answers.nil? || answers.count < 1) + complete_question << question + end + end + complete_question + end + + def get_percent poll,user + complete_count = get_complete_question(poll,user).count + (complete_count.to_f / poll.poll_questions.count.to_f)*100 + end + #PollUser记录用户是否已提交问卷有对应的记录则已提交,没有则新建一个 def get_poll_user poll_id,user_id pu = PollUser.find_by_poll_id_and_user_id(poll_id,user_id) diff --git a/app/views/poll/_commit_alert.html.erb b/app/views/poll/_commit_alert.html.erb index 76bbda416..3910bc8b5 100644 --- a/app/views/poll/_commit_alert.html.erb +++ b/app/views/poll/_commit_alert.html.erb @@ -3,7 +3,7 @@

提交成功!

<%= link_to "确定", poll_index_path(:polls_group_id => @course.id,:polls_type => 'Course'),:class => 'commit'%> <% elsif status == 1 %> -

您还有尚未作答的题目请完成后在提交!

+

您还有尚未作答的必答题目请完成后再提交!

<%= link_to "确定", "javascript:void(0)",:onclick => 'hidden_atert_form();',:class => 'commit'%> <% else %>

发生未知错误,请检查您的网络。

diff --git a/app/views/poll/show.html.erb b/app/views/poll/show.html.erb index 2db0045f6..42818dd34 100644 --- a/app/views/poll/show.html.erb +++ b/app/views/poll/show.html.erb @@ -72,7 +72,10 @@ poll_question_id: <%= pq.id %> }, success: function (data) { - obj.checked = true; + var dataObj = eval(data); + obj.checked = true; + var span = $('#percent'); + span.html(dataObj.percent); } }); } @@ -118,7 +121,8 @@ poll_question_id: <%= pq.id %> }, success: function (data) { - if(data == "true") + var dataObj = eval(data); + if(dataObj.text == "true") { obj.checked = true; } @@ -126,6 +130,8 @@ { obj.checked = false; } + var span = $('#percent'); + span.html(dataObj.percent); } }); } @@ -165,6 +171,9 @@ vote_text: obj.value }, success: function (data) { + var dataObj = eval(data); + var span = $('#percent'); + span.html(dataObj.percent); // obj.value = data; } }); @@ -198,7 +207,17 @@ vote_text: obj.innerHTML }, success: function (data) { -// obj.value = data; + var dataObj = eval(data); + if(dataObj.text != 'failure') + { + var span = $('#percent'); + span.html(dataObj.percent); + } + else + { + alert("error"); + } + } }); } @@ -222,7 +241,7 @@ <% end %>
-
答题已完成 0%
+
答题已完成 <%= format "%.2f" ,@percent %>%
From fe3a84c8db35c648478d900bd2c1faa9433f5af9 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 16 Jan 2015 15:34:25 +0800 Subject: [PATCH 080/169] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=A4=9A=E8=A1=8C=E6=96=87=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_edit_mulit.html.erb | 19 +++++++++++-------- app/views/poll/_new_mulit.html.erb | 21 ++++++++++++--------- app/views/poll/_show_mulit.html.erb | 14 +++++++++++--- 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/app/views/poll/_edit_mulit.html.erb b/app/views/poll/_edit_mulit.html.erb index c4a9e0e0f..684a285e3 100644 --- a/app/views/poll/_edit_mulit.html.erb +++ b/app/views/poll/_edit_mulit.html.erb @@ -1,18 +1,21 @@ +<%= form_for("",:url => update_poll_question_poll_index_path(:poll_question => poll_question.id),:remote => true) do |f|%>
- - + + + />
- - , - + + +
-
\ No newline at end of file + +<% end%> \ No newline at end of file diff --git a/app/views/poll/_new_mulit.html.erb b/app/views/poll/_new_mulit.html.erb index 6c3528473..e034e54af 100644 --- a/app/views/poll/_new_mulit.html.erb +++ b/app/views/poll/_new_mulit.html.erb @@ -1,18 +1,21 @@ +<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>
- - - + + + +
- - , - + + +
-
\ No newline at end of file + +<% end%> \ No newline at end of file diff --git a/app/views/poll/_show_mulit.html.erb b/app/views/poll/_show_mulit.html.erb index 35e37ef06..23bdbe6eb 100644 --- a/app/views/poll/_show_mulit.html.erb +++ b/app/views/poll/_show_mulit.html.erb @@ -1,10 +1,18 @@
- 第4题: 多行主观 + + 第<%= poll_question.question_number%>题: + + <%= poll_question.question_title %> + <%if poll_question.is_necessary == 1%> + * + <%end%> + (多行主观)
- - + <%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id), + method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %> +
From 7177303eeb4899010db5af9c831b85504813970b Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 16 Jan 2015 15:49:22 +0800 Subject: [PATCH 081/169] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=9C=80=E7=BB=88=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 2 +- app/helpers/poll_helper.rb | 18 ++++++++- app/views/poll/_choice_show.html.erb | 49 ++++++++++++----------- app/views/poll/statistics_result.html.erb | 10 ++--- config/locales/zh.yml | 5 +++ 5 files changed, 53 insertions(+), 31 deletions(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 3de4e8339..3b4bf3694 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -86,7 +86,7 @@ class PollController < ApplicationController def statistics_result @poll = Poll.find(params[:id]) poll_questions = @poll.poll_questions - @poll_questions = paginateHelper poll_questions,3 #分页 + @poll_questions = paginateHelper poll_questions, 5 respond_to do |format| format.html{render :layout => 'base_courses'} end diff --git a/app/helpers/poll_helper.rb b/app/helpers/poll_helper.rb index 7816d8e37..1a8fabae3 100644 --- a/app/helpers/poll_helper.rb +++ b/app/helpers/poll_helper.rb @@ -27,7 +27,7 @@ module PollHelper false end end - + #获取文本题答案 def get_anwser_vote_text(question_id,user_id) pv = PollVote.find_by_poll_question_id_and_user_id(question_id,user_id) @@ -47,4 +47,20 @@ module PollHelper true end end + + #统计答题百分比 + def statistics_result_percentage(e, t) + return e*100/t + end + + def options_show p + case p + when 1 + "单选题" + when 2 + "多选题" + else + "问答题" + end + end end \ No newline at end of file diff --git a/app/views/poll/_choice_show.html.erb b/app/views/poll/_choice_show.html.erb index aa425e748..16971d5ad 100644 --- a/app/views/poll/_choice_show.html.erb +++ b/app/views/poll/_choice_show.html.erb @@ -1,25 +1,28 @@ -
- - - - - - - - <% poll_question.poll_answers.each do |poll_answer| %> - - - - - - <% end %> - - - - - - -
选项 小计 比例
<%= poll_answer.answer_text %> <% poll_answer.poll_votes.count %>
75%
本题有效填写人次 <%= poll_question.poll_votes.count %> 
-
+ + + + + + + + <% poll_question.poll_answers.each do |poll_answer| %> + + + + + + <% end %> + + + + + + +
<%= l(:label_poll_options) %> <%= l(:label_poll_subtotal) %> <%= l(:label_poll_proportion) %>
<%= poll_answer.answer_text %> <%= poll_answer.poll_votes.count %> +
+ +
+ <%= statistics_result_percentage(poll_answer.poll_votes.count, @poll.users.count) %>%
<%= l(:label_poll_valid_commit) %> <%= poll_question.poll_votes.count %> 
+
diff --git a/app/views/poll/statistics_result.html.erb b/app/views/poll/statistics_result.html.erb index d6181fb1a..dea18f8d8 100644 --- a/app/views/poll/statistics_result.html.erb +++ b/app/views/poll/statistics_result.html.erb @@ -2,14 +2,14 @@ - 问卷调查_问卷结果 + <%= l(:label_poll_result) %> <%= stylesheet_link_tag 'polls', :media => 'all' %>
-

某问卷统计

+

<%= @poll.polls_name %> <%= l(:label_poll) %>

<% @poll_questions.each do |poll_question| %> @@ -17,7 +17,8 @@
  1. - 第<%= poll_question.question_number %>题:<%= poll_question.question_title %> [单选题]<% poll_question.poll_answers %> + 第<%= poll_question.question_number %>题:<%= poll_question.question_title %> + [<%= options_show(poll_question.question_type) %>]
    <%= render :partial =>'choice_show', :locals =>{ :poll_question => poll_question } %>
  2. @@ -28,11 +29,8 @@
    - -
    -
    答题已完成 0%
diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 95ab07d5d..5c2925b90 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2253,5 +2253,10 @@ zh: label_new_answer: 新建选项 label_poll_title: 问卷标题 label_poll_description: 问卷描述 + label_poll_options: 选项 + label_poll_subtotal: 小计 + label_poll_proportion: 比例 + label_poll_valid_commit: 本题有效填写人次 + label_poll_result: 问卷调查_问卷统计 From dd42c89ee6972d08237fe549dffe51503c4f279a Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 16 Jan 2015 15:51:26 +0800 Subject: [PATCH 082/169] =?UTF-8?q?=E7=99=BE=E5=88=86=E6=AF=94=E9=99=A4?= =?UTF-8?q?=E6=95=B0=E4=B8=BA0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index d77f7c872..221c482c7 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -178,20 +178,26 @@ class PollController < ApplicationController #单选题 pv = PollVote.find_by_poll_question_id_and_user_id(params[:poll_question_id],User.current.id) if pv.nil? + #尚未答该题,添加答案 pv = PollVote.new pv.user_id = User.current.id pv.poll_question_id = params[:poll_question_id] end + #修改该题对应答案 pv.poll_answer_id = params[:poll_answer_id] if pv.save + #保存成功返回成功信息及当前以答题百分比 @percent = get_percent(@poll,User.current) render :json => {:text => "ok" ,:percent => format("%.2f" ,@percent)} else + #返回失败信息 render :json => {:text => "failure"} end elsif pq.question_type == 2 + #多选题 pv = PollVote.find_by_poll_answer_id_and_user_id(params[:poll_answer_id],User.current.id) if pv.nil? + #尚未答该题,添加答案 pv = PollVote.new pv.user_id = User.current.id pv.poll_question_id = params[:poll_question_id] @@ -203,6 +209,7 @@ class PollController < ApplicationController render :json => {:text => "failure"} end else + #pv不为空,则当前选项之前已被选择,再次点击则是不再选择该项,故删除该答案 if pv.delete @percent = get_percent(@poll,User.current) render :json => {:text => "false" ,:percent => format("%.2f" ,@percent)} @@ -211,12 +218,16 @@ class PollController < ApplicationController end end elsif pq.question_type == 3 || pq.question_type == 4 + #单行文本,多行文本题 pv = PollVote.find_by_poll_question_id_and_user_id(params[:poll_question_id],User.current.id) if pv.nil? + #pv为空之前尚未答题,添加答案 if params[:vote_text].nil? || params[:vote_text].blank? + #用户提交空答案,视作不作答 @percent = get_percent(@poll,User.current) render :json => {:text => pv.vote_text,:percent => format("%.2f" ,@percent)} else + #添加答案 pv = PollVote.new pv.user_id = User.current.id pv.poll_question_id = params[:poll_question_id] @@ -229,7 +240,9 @@ class PollController < ApplicationController end end else + #pv不为空说明用户之前已作答 if params[:vote_text].nil? || params[:vote_text].blank? + #用户提交空答案,视为删除答案 if pv.delete @percent = get_percent(@poll,User.current) render :json => {:text => pv.vote_text,:percent => format("%.2f" ,@percent)} @@ -237,6 +250,7 @@ class PollController < ApplicationController render :json => {:text => "failure"} end else + #用户修改答案 pv.vote_text = params[:vote_text] if pv.save @percent = get_percent(@poll,User.current) @@ -335,7 +349,11 @@ class PollController < ApplicationController def get_percent poll,user complete_count = get_complete_question(poll,user).count - (complete_count.to_f / poll.poll_questions.count.to_f)*100 + if poll.poll_questions.count == 0 + return 0 + else + return (complete_count.to_f / poll.poll_questions.count.to_f)*100 + end end #PollUser记录用户是否已提交问卷有对应的记录则已提交,没有则新建一个 From 79ad33a90f40ed65569d337c9c5f3fc876da12a6 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 16 Jan 2015 15:57:49 +0800 Subject: [PATCH 083/169] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E9=97=AE=E5=8D=B7=E7=9A=84=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 11 ++++++++--- config/routes.rb | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 28c44f0cb..2e7d95478 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -90,7 +90,7 @@ class PollController < ApplicationController end end - #添加单选题 + #添加题目 def create_poll_question question_title = params[:poll_questions_title].nil? || params[:poll_questions_title].empty? ? l(:label_enter_single_title) : params[:poll_questions_title] option = { @@ -117,7 +117,7 @@ class PollController < ApplicationController end end - #修改单选题 + #修改题目 def update_poll_question @poll_question = PollQuestion.find params[:poll_question] #@poll = @poll_question.poll @@ -150,7 +150,7 @@ class PollController < ApplicationController end end - #删除单选题 + #删除题目 def delete_poll_question @poll_question = PollQuestion.find params[:poll_question] @poll = @poll_question.poll @@ -166,6 +166,11 @@ class PollController < ApplicationController end end + #发布问卷 + def publish_poll + + end + #提交答案 def commit_answer pq = PollQuestion.find(params[:poll_question_id]) diff --git a/config/routes.rb b/config/routes.rb index dc8205e2d..bd1b27dee 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -64,6 +64,7 @@ RedmineApp::Application.routes.draw do post 'commit_answer' post 'create_poll_question' post 'commit_poll' + get 'publish_poll' end collection do delete 'delete_poll_question' From bbf4c4629b69a93d70847fd76d5e0edffa6d28e3 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 16 Jan 2015 16:13:03 +0800 Subject: [PATCH 084/169] =?UTF-8?q?=E9=97=AE=E5=8D=B7show=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/show.html.erb | 22 +++++++++++----------- config/locales/en.yml | 6 ++++-- config/locales/zh.yml | 4 ++++ 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/app/views/poll/show.html.erb b/app/views/poll/show.html.erb index 42818dd34..c1ac5d377 100644 --- a/app/views/poll/show.html.erb +++ b/app/views/poll/show.html.erb @@ -2,7 +2,7 @@ - 问卷调查_问卷页面 + <%= l(:label_poll_title) %> <%= stylesheet_link_tag 'polls', :media => 'all' %> + + + + + +
+
+

问卷发布

+

+ 问卷发布后将无法 + 修改 +
+ 是否确定发布该问卷? +

+
+ <%= link_to "确 定",publish_poll_poll_path(poll.id), :class => "tijiao", :onclick => "clickCanel();" %> + + 取  消 + +
+
+
+ + + From d16d5fd362179d62fde4efebf24bd8f9cb91f8b3 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 16 Jan 2015 17:31:04 +0800 Subject: [PATCH 087/169] =?UTF-8?q?=E5=8D=95=E8=A1=8C=E6=96=87=E5=AD=97/?= =?UTF-8?q?=E5=A4=9A=E8=A1=8C=E6=96=87=E5=AD=97=20-->=20=E5=8D=95=E8=A1=8C?= =?UTF-8?q?=E4=B8=BB=E8=A7=82/=E5=A4=9A=E8=A1=8C=E4=B8=BB=E8=A7=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_edit_mulit.html.erb | 2 +- app/views/poll/_edit_single.html.erb | 2 +- app/views/poll/_new_mulit.html.erb | 2 +- app/views/poll/_new_single.html.erb | 2 +- app/views/poll/_show_single.html.erb | 2 +- config/locales/zh.yml | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/poll/_edit_mulit.html.erb b/app/views/poll/_edit_mulit.html.erb index 684a285e3..f4e079c17 100644 --- a/app/views/poll/_edit_mulit.html.erb +++ b/app/views/poll/_edit_mulit.html.erb @@ -3,7 +3,7 @@
- + />
diff --git a/app/views/poll/_edit_single.html.erb b/app/views/poll/_edit_single.html.erb index b8157ee6c..b172d955c 100644 --- a/app/views/poll/_edit_single.html.erb +++ b/app/views/poll/_edit_single.html.erb @@ -4,7 +4,7 @@ + name="poll_questions_title" placeholder="请输入单行主观标题" value="<%= poll_question.question_title%>"/> />
diff --git a/app/views/poll/_new_mulit.html.erb b/app/views/poll/_new_mulit.html.erb index e034e54af..155f208c4 100644 --- a/app/views/poll/_new_mulit.html.erb +++ b/app/views/poll/_new_mulit.html.erb @@ -3,7 +3,7 @@
- +
diff --git a/app/views/poll/_new_single.html.erb b/app/views/poll/_new_single.html.erb index ec06933a8..fb052a7a3 100644 --- a/app/views/poll/_new_single.html.erb +++ b/app/views/poll/_new_single.html.erb @@ -3,7 +3,7 @@
- +
diff --git a/app/views/poll/_show_single.html.erb b/app/views/poll/_show_single.html.erb index d9ef2abc7..bfea07d86 100644 --- a/app/views/poll/_show_single.html.erb +++ b/app/views/poll/_show_single.html.erb @@ -7,7 +7,7 @@ <%if poll_question.is_necessary == 1%> * <%end%> - (单行文字) + (单行主观) <%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id), method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 5c2925b90..e607214b5 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2247,8 +2247,8 @@ zh: label_statistical_results: 统计结果 label_MC: 单选题 label_MCQ: 多选题 - label_single: 单行文字 - label_mulit: 多行文字 + label_single: 单行主观 + label_mulit: 多行主观 label_enter_single_title: 请输入单选题标题 label_new_answer: 新建选项 label_poll_title: 问卷标题 From 3acec4b7c10c082c25b1f4e79cadc8b5e1adc013 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 17 Jan 2015 10:14:07 +0800 Subject: [PATCH 088/169] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E6=80=BB?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/poll_helper.rb | 8 +++++--- app/views/poll/_choice_show.html.erb | 2 +- app/views/poll/statistics_result.html.erb | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/helpers/poll_helper.rb b/app/helpers/poll_helper.rb index 55418faf2..36b5deccb 100644 --- a/app/helpers/poll_helper.rb +++ b/app/helpers/poll_helper.rb @@ -48,15 +48,16 @@ module PollHelper end end - #统计答题百分比 + #统计答题百分比,统计结果保留两位小数 def statistics_result_percentage(e, t) e = e.to_f t = t.to_f t == 0 ? 0 : format("%.2f", e*100/t) end - def options_show p - case p + #页面体型显示 + def options_show pq + case pq when 1 "单选题" when 2 @@ -65,4 +66,5 @@ module PollHelper "问答题" end end + end \ No newline at end of file diff --git a/app/views/poll/_choice_show.html.erb b/app/views/poll/_choice_show.html.erb index 16971d5ad..4ccc5b938 100644 --- a/app/views/poll/_choice_show.html.erb +++ b/app/views/poll/_choice_show.html.erb @@ -19,7 +19,7 @@ <% end %> <%= l(:label_poll_valid_commit) %> - <%= poll_question.poll_votes.count %> + <%= @poll.users.count %>   diff --git a/app/views/poll/statistics_result.html.erb b/app/views/poll/statistics_result.html.erb index 057314a9c..3ef29eb48 100644 --- a/app/views/poll/statistics_result.html.erb +++ b/app/views/poll/statistics_result.html.erb @@ -27,7 +27,7 @@
- + From 9487ce1245894efa0a9a45314c4ec6de7f93ebd1 Mon Sep 17 00:00:00 2001 From: z9hang Date: Sat, 17 Jan 2015 11:02:09 +0800 Subject: [PATCH 089/169] =?UTF-8?q?#1807=E8=AF=BE=E7=A8=8B--=E9=97=AE?= =?UTF-8?q?=E5=8D=B7=E8=B0=83=E6=9F=A5=EF=BC=9A=E7=AD=94=E9=A2=98=E5=A4=9A?= =?UTF-8?q?=E8=A1=8C=E4=B8=BB=E8=A7=82=E5=90=8E=EF=BC=8C=E5=86=8D=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E6=89=93=E5=BC=80=E7=AD=94=E9=A2=98=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E5=A6=82=E5=9B=BE=EF=BC=8C=E6=98=BE=E7=A4=BAhtml?= =?UTF-8?q?=E5=85=83=E7=B4=A0
?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/show.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/poll/show.html.erb b/app/views/poll/show.html.erb index c1ac5d377..bc5136718 100644 --- a/app/views/poll/show.html.erb +++ b/app/views/poll/show.html.erb @@ -180,7 +180,7 @@ } - > + > <% elsif pq.question_type == 4 %> @@ -222,7 +222,7 @@ }); } -
" onblur="onblur_<%= pq.id %>(this);"><%= get_anwser_vote_text(pq.id,User.current.id) %>
+
" onblur="onblur_<%= pq.id %>(this);"><%= get_anwser_vote_text(pq.id,User.current.id).html_safe %>
From e14deeb4ddde7393a007615920ad9bd2e53a148d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 17 Jan 2015 11:05:38 +0800 Subject: [PATCH 090/169] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=99=90=E5=88=B6?= =?UTF-8?q?=EF=BC=9A=E9=97=AE=E5=8D=B7=E6=A0=87=E9=A2=98=E6=9C=80=E5=A4=9A?= =?UTF-8?q?100=E5=AD=97=EF=BC=8C=E9=97=AE=E5=8D=B7=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E6=9C=80=E5=A4=9A300=E5=AD=97=EF=BC=8C=E9=97=AE=E5=8D=B7?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E6=9C=80=E5=A4=9A250=E5=AD=97=EF=BC=8C?= =?UTF-8?q?=E9=97=AE=E5=8D=B7=E9=80=89=E9=A1=B9=E6=9C=80=E5=A4=9A200?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_edit_MC.html.erb | 4 ++-- app/views/poll/_edit_MCQ.html.erb | 4 ++-- app/views/poll/_edit_head.html.erb | 4 ++-- app/views/poll/_edit_mulit.html.erb | 2 +- app/views/poll/_edit_single.html.erb | 2 +- app/views/poll/_new_MC.html.erb | 8 ++++---- app/views/poll/_new_MCQ.html.erb | 8 ++++---- app/views/poll/_new_mulit.html.erb | 2 +- app/views/poll/_new_single.html.erb | 2 +- app/views/poll/_poll_form.html.erb | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/app/views/poll/_edit_MC.html.erb b/app/views/poll/_edit_MC.html.erb index 12dc9f92b..505e9acc1 100644 --- a/app/views/poll/_edit_MC.html.erb +++ b/app/views/poll/_edit_MC.html.erb @@ -4,7 +4,7 @@
- + />
@@ -13,7 +13,7 @@ <% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
  • - +
  • diff --git a/app/views/poll/_edit_MCQ.html.erb b/app/views/poll/_edit_MCQ.html.erb index f34319569..5e267b03e 100644 --- a/app/views/poll/_edit_MCQ.html.erb +++ b/app/views/poll/_edit_MCQ.html.erb @@ -2,7 +2,7 @@
    - + />
    @@ -11,7 +11,7 @@ <% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
  • - +
  • diff --git a/app/views/poll/_edit_head.html.erb b/app/views/poll/_edit_head.html.erb index ea36cbedf..802832601 100644 --- a/app/views/poll/_edit_head.html.erb +++ b/app/views/poll/_edit_head.html.erb @@ -1,10 +1,10 @@ <%= form_for @poll,:remote => true do |f|%>
    - +
    - +
    diff --git a/app/views/mailer/issue_add.html.erb b/app/views/mailer/issue_add.html.erb index f51dad121..4db0113b9 100644 --- a/app/views/mailer/issue_add.html.erb +++ b/app/views/mailer/issue_add.html.erb @@ -5,4 +5,5 @@
    +
    <%= link_to("退订该邮件?", @user_url) %>
    diff --git a/app/views/mailer/issue_add.text.erb b/app/views/mailer/issue_add.text.erb index b50a39260..31d9632db 100644 --- a/app/views/mailer/issue_add.text.erb +++ b/app/views/mailer/issue_add.text.erb @@ -1,2 +1,3 @@ <%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %> +<%= link_to("退订该邮件?", @user_url) %> \ No newline at end of file diff --git a/app/views/mailer/issue_edit.html.erb b/app/views/mailer/issue_edit.html.erb index 3cbd1b02a..0c46b5e60 100644 --- a/app/views/mailer/issue_edit.html.erb +++ b/app/views/mailer/issue_edit.html.erb @@ -11,3 +11,5 @@ <%= l(:field_content)%>:<%= @journal.notes %>
    <%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %> +
    <%= link_to("退订该邮件?", @user_url) %>
    + diff --git a/app/views/mailer/issue_edit.text.erb b/app/views/mailer/issue_edit.text.erb index 5b93b6fe0..70e4186c4 100644 --- a/app/views/mailer/issue_edit.text.erb +++ b/app/views/mailer/issue_edit.text.erb @@ -12,3 +12,5 @@ <% end -%> ---------------------------------------- <%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %> + +<%= link_to("退订该邮件?", @user_url) %> \ No newline at end of file From abcf06ccc7cbd8e14713c7670247834c0ccd2f35 Mon Sep 17 00:00:00 2001 From: z9hang Date: Mon, 19 Jan 2015 15:00:46 +0800 Subject: [PATCH 120/169] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E5=BC=95=E7=94=A8=E9=97=AE=E9=A2=98=E3=80=82?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=EF=BC=9A15=E5=B9=B41-3=E6=9C=88=E8=83=BD?= =?UTF-8?q?=E5=B1=9E=E4=BA=8E2014=E5=B9=B4=E7=A7=8B=E5=AD=A3=E5=AD=A6?= =?UTF-8?q?=E6=9C=9F=EF=BC=8C=E4=BB=A3=E7=A0=81=E5=8D=B4=E5=B0=86=E5=85=B6?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E4=B8=BA15=E5=B9=B4=E7=A7=8B=E5=AD=A3?= =?UTF-8?q?=E5=AD=A6=E6=9C=9F=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index a862753ef..411de1dcf 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -561,12 +561,13 @@ module CoursesHelper def course_in_current_or_next_term course is_current_term = false is_next_term = false - if course.time == Time.now.year && course.term == cur_course_term + year_now = Time.now.month < 3 ? Time.now.year - 1:Time.now.year + if course.time == year_now && course.term == cur_course_term is_current_term = true end - if cur_course_term == "秋季学期" && course.time == (Time.now.year + 1) && course.term == "春季学期" + if cur_course_term == "秋季学期" && course.time == (year_now + 1) && course.term == "春季学期" is_next_term = true - elsif cur_course_term == "春季学期" && course.time == Time.now.year && course.term == "秋季学期" + elsif cur_course_term == "春季学期" && course.time == year_now && course.term == "秋季学期" is_next_term = true end is_current_term || is_next_term From 493b7ca695f7666f8a5edd8ebbd7096bbce268a0 Mon Sep 17 00:00:00 2001 From: z9hang Date: Mon, 19 Jan 2015 16:05:18 +0800 Subject: [PATCH 121/169] =?UTF-8?q?#1821=20=E8=AF=BE=E7=A8=8B--=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=EF=BC=9A=E5=AF=BC=E5=87=BAexcel=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20=E8=B0=83=E6=95=B4=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/zh.yml | 2 +- public/stylesheets/course_group.css | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/locales/zh.yml b/config/locales/zh.yml index ac7c52fe2..681dfadc1 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2110,7 +2110,7 @@ zh: excel_homework_list: 作品列表 excel_been_rated: 已评 excel_not_rated: 未评 - label_export_excel: 导出Excel + label_export_excel: 导出列表 label_softapplication: 应用软件 label_attending_contest: 参加竞赛 diff --git a/public/stylesheets/course_group.css b/public/stylesheets/course_group.css index 71f870a9a..b6c7f4f8c 100644 --- a/public/stylesheets/course_group.css +++ b/public/stylesheets/course_group.css @@ -41,8 +41,9 @@ input.f_2 { .st_search{ margin:10px 0;} .st_search span{ font-size:14px; font-weight:bold; color:#606060; margin-right:35px;} .st_search input{ border:1px solid #1c9ec7; height:20px; width:200px;} - a:hover.xls{ background: url('../images/icon_excel.gif') no-repeat scroll 1px 50% transparent !important; - padding: 2px 0px 3px 16px; + a:hover.xls{ /*background: url('../images/icon_excel.gif') no-repeat scroll 1px 50% transparent !important;*/ + /*padding: 2px 0px 3px 16px;*/ + background:#ffffff !important; font-family:微软雅黑 !important; font-size: 12px !important; color: #136b3b !important; From 14a1f31a1270eaef0bbaa6211026dccf203fc9cf Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 19 Jan 2015 16:43:21 +0800 Subject: [PATCH 122/169] =?UTF-8?q?1=E3=80=81=E9=A1=B9=E7=9B=AE=E5=8A=A8?= =?UTF-8?q?=E6=80=81=20->=20=E8=BF=91=E6=9C=9F=E5=8A=A8=E6=80=81=202?= =?UTF-8?q?=E3=80=81=E4=BF=AE=E5=A4=8D=E6=96=B0=E5=BB=BA=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=97=B6=EF=BC=8C=E6=8F=8F=E8=BF=B0=E4=BC=9A?= =?UTF-8?q?=E6=9C=89=E4=B8=80=E8=A1=8C=E7=A9=BA=E7=99=BD=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_course_form.html.erb | 4 +--- config/locales/zh.yml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/views/courses/_course_form.html.erb b/app/views/courses/_course_form.html.erb index c48d24935..d293f9ed1 100644 --- a/app/views/courses/_course_form.html.erb +++ b/app/views/courses/_course_form.html.erb @@ -127,9 +127,7 @@ <%= l(:label_new_course_description) %>      - +

    diff --git a/config/locales/zh.yml b/config/locales/zh.yml index ac7c52fe2..061baa932 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -748,7 +748,7 @@ zh: label_news_view_all: 查看所有新闻 label_news_added: 新闻已添加 label_settings: 配置 - label_overview: 项目动态 + label_overview: 近期动态 label_course_overview: "课程动态" label_question_student: 作业交流 #bai label_homework_commit: 提交作业 #huang From 7b9d88ecfeefd465be895efb398d961e6782be8b Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 20 Jan 2015 11:42:28 +0800 Subject: [PATCH 123/169] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E8=B0=83=E6=9F=A5?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=87=8D=E6=96=B0=E5=8F=91=E5=B8=83=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 20 +++++++++++-- app/views/poll/_poll.html.erb | 43 ++++++++++++++++++++++++++++ app/views/poll/index.html.erb | 39 +------------------------ app/views/poll/republish_poll.js.erb | 1 + config/routes.rb | 1 + 5 files changed, 63 insertions(+), 41 deletions(-) create mode 100644 app/views/poll/_poll.html.erb create mode 100644 app/views/poll/republish_poll.js.erb diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 739adfe1c..6890b8dd7 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -1,8 +1,8 @@ class PollController < ApplicationController - before_filter :find_poll_and_course, :only => [:edit,:update,:destroy,:show,:statistics_result,:create_poll_question,:commit_poll,:commit_answer,:publish_poll] + before_filter :find_poll_and_course, :only => [:edit,:update,:destroy,:show,:statistics_result,:create_poll_question,:commit_poll,:commit_answer,:publish_poll,:republish_poll] before_filter :find_container, :only => [:new,:create, :index] before_filter :is_member_of_course, :only => [:index,:show] - before_filter :is_course_teacher, :only => [:new,:create,:edit,:update,:destroy,:publish_poll] + before_filter :is_course_teacher, :only => [:new,:create,:edit,:update,:destroy,:publish_poll,:republish_poll] include PollHelper def index if @course @@ -311,6 +311,19 @@ class PollController < ApplicationController end end + #重新发布问卷 + def republish_poll + @poll.poll_questions.each do |poll_question| + poll_question.poll_votes.destroy_all + end + @poll.poll_users.destroy_all + @poll.polls_status = 1 + @poll.save + respond_to do |format| + format.js + end + end + private def find_poll_and_course @poll = Poll.find params[:id] @@ -337,7 +350,8 @@ class PollController < ApplicationController end def is_course_teacher - render_403 unless(@course && User.current.allowed_to?(:as_teacher,@course)) + @is_teacher = User.current.allowed_to?(:as_teacher,@course) + render_403 unless(@course && @is_teacher) end #获取未完成的题目 diff --git a/app/views/poll/_poll.html.erb b/app/views/poll/_poll.html.erb new file mode 100644 index 000000000..8ae766516 --- /dev/null +++ b/app/views/poll/_poll.html.erb @@ -0,0 +1,43 @@ +

  • + <% if @is_teacher %> + <% if has_commit_poll?(poll.id ,User.current) %> + <%= poll.polls_name %> + <% else %> + <%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %> + <% end %> + <% else %> + <% if has_commit_poll?(poll.id ,User.current) && poll.polls_status == 2 %> + + <%= poll.polls_name %> + + <% elsif (!has_commit_poll?(poll.id ,User.current)) && poll.polls_status == 2 %> + <%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %> + <% end %> + <% end %> +
  • +
  • + <%if @is_teacher && poll.polls_status == 2%> + <%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%> + <% end%> +
  • +
  • + <% if @is_teacher %> + + <%= link_to(l(:button_delete), poll, + method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml20 mr10") %> + <% end%> +
  • +
  • + <% if @is_teacher && poll.polls_status == 1%> + + <%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml20"%> + <% end%> +
  • +
  • + <% if @is_teacher && poll.polls_status == 2%> + <%= link_to "重新发布", republish_poll_poll_path(poll.id), :remote => true, :class => 'polls_de fr ml20' %> + <% end %> +
  • +
  • + <%= format_time poll.created_at%> +
  • \ No newline at end of file diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb index e57674c7a..fa378fc7b 100644 --- a/app/views/poll/index.html.erb +++ b/app/views/poll/index.html.erb @@ -12,44 +12,7 @@
    <% @polls.each do |poll|%>
      -
    • - <% if @is_teacher %> - <% if has_commit_poll?(poll.id ,User.current) %> - <%= poll.polls_name %> - <% else %> - <%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %> - <% end %> - <% else %> - <% if has_commit_poll?(poll.id ,User.current) && poll.polls_status == 2 %> - - <%= poll.polls_name %> - - <% elsif (!has_commit_poll?(poll.id ,User.current)) && poll.polls_status == 2 %> - <%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %> - <% end %> - <% end %> -
    • -
    • - <%if @is_teacher && poll.polls_status == 2%> - <%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%> - <% end%> -
    • -
    • - <% if @is_teacher %> - - <%= link_to(l(:button_delete), poll, - method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml20 mr10") %> - <% end%> -
    • -
    • - <% if @is_teacher && poll.polls_status == 1%> - - <%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml20"%> - <% end%> -
    • -
    • - <%= format_time poll.created_at%> -
    • + <%= render :partial => 'poll', :locals => {:poll => poll} %>
    <% end%> diff --git a/app/views/poll/republish_poll.js.erb b/app/views/poll/republish_poll.js.erb new file mode 100644 index 000000000..a7399af5b --- /dev/null +++ b/app/views/poll/republish_poll.js.erb @@ -0,0 +1 @@ +$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>"); \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index bd1b27dee..67b0118b0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -65,6 +65,7 @@ RedmineApp::Application.routes.draw do post 'create_poll_question' post 'commit_poll' get 'publish_poll' + get 'republish_poll' end collection do delete 'delete_poll_question' From 40d6c3b19cdb06be75220d60f9669ae592941681 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Tue, 20 Jan 2015 16:33:59 +0800 Subject: [PATCH 124/169] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E3=80=8A=E9=82=AE?= =?UTF-8?q?=E7=AE=B1=E5=9C=B0=E5=9D=80=E9=AA=8C=E8=AF=81=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E5=8F=8A=E5=9B=BD=E9=99=85=E5=8C=96=E7=9A=84?= =?UTF-8?q?=E7=BC=96=E5=86=99=E3=80=8B=E5=8A=9F=E8=83=BD=20Signed-off-by:?= =?UTF-8?q?=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 4 +++- app/controllers/account_controller.rb | 3 +++ app/models/user.rb | 2 +- config/application.rb | 5 +++++ config/environments/development.rb | 2 +- config/locales/en.yml | 11 +++++++++++ config/locales/zh.yml | 17 +++++++++++++++++ 7 files changed, 41 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 6c2101345..5045cb822 100644 --- a/Gemfile +++ b/Gemfile @@ -18,6 +18,7 @@ gem "builder", "3.0.0" gem 'acts-as-taggable-on', '2.4.1' gem 'spreadsheet' gem 'ruby-ole' +gem 'email_verifier' group :development do gem 'better_errors', path: 'lib/better_errors' @@ -51,7 +52,8 @@ group :development, :test do gem 'ruby-prof', '~> 0.15.1' unless RUBY_PLATFORM =~ /w32/ gem 'pry' gem 'pry-nav' - + gem 'rspec-rails' , '2.13.1' + gem 'guard-rspec','2.5.0' end diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 6c95294d7..69c2d3002 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -345,7 +345,10 @@ class AccountController < ApplicationController if user.save and token.save UserStatus.create(:user_id => user.id, :changsets_count => 0, :watchers_count => 0) Mailer.register(token).deliver + + flash[:notice] = l(:notice_account_register_done) + render action: 'email_valid', locals: {:mail => user.mail} else yield if block_given? diff --git a/app/models/user.rb b/app/models/user.rb index 52619b038..bef65fe54 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -188,7 +188,7 @@ class User < Principal validates_confirmation_of :password, :allow_nil => true validates_inclusion_of :mail_notification, :in => MAIL_NOTIFICATION_OPTIONS.collect(&:first), :allow_blank => true validate :validate_password_length - + validates_email_realness_of :mail before_create :set_mail_notification before_save :update_hashed_password before_destroy :remove_references_before_destroy diff --git a/config/application.rb b/config/application.rb index d37a9eae2..716e3875d 100644 --- a/config/application.rb +++ b/config/application.rb @@ -16,6 +16,11 @@ module RedmineApp # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. + # verifier if email is real + EmailVerifier.config do |config| + config.verifier_email = "lizanle521@126.com" + end + # Custom directories with classes and modules you want to be autoloadable. config.autoload_paths += %W(#{config.root}/lib) diff --git a/config/environments/development.rb b/config/environments/development.rb index 9d3cbf244..8bec9789c 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -13,7 +13,7 @@ RedmineApp::Application.configure do config.action_controller.perform_caching = false # Don't care if the mailer can't send - config.action_mailer.raise_delivery_errors = false + config.action_mailer.raise_delivery_errors = true config.active_support.deprecation = :log end diff --git a/config/locales/en.yml b/config/locales/en.yml index dd79a546c..d25ba6ae2 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -71,6 +71,14 @@ en: one: "almost 1 year" other: "almost %{count} years" + errors: + messages: + email_verifier: + email_not_real: must point to a real mail account + out_of_mail_server: appears to point to dead mail server + no_mail_server: appears to point to domain which doesn't handle e-mail + failure: could not be checked if is real + exception: could not be sent number: format: separator: "." @@ -130,6 +138,9 @@ en: circular_dependency: "This relation would create a circular dependency" cant_link_an_issue_with_a_descendant: "An issue cannot be linked to one of its subtasks" + + + actionview_instancetag_blank_option: Please select attachment_all: "All" diff --git a/config/locales/zh.yml b/config/locales/zh.yml index ac7c52fe2..ea045f29b 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2,6 +2,10 @@ # Chinese (China) translations for Ruby on Rails # by tsechingho (http://github.com/tsechingho) zh: + + + + # Text direction: Left-to-Right (ltr) or Right-to-Left (rtl) direction: ltr jquery: @@ -30,6 +34,17 @@ zh: - :month - :day + + errors: + messages: + email_verifier: + email_not_real: 必须指定一个真实的邮箱地址 + out_of_mail_server: 指向了一个已停用的邮箱服务器 + no_mail_server: 域名地址没有邮件功能 + failure: 邮箱地址不能被验证 + exception: 邮箱不能发送成功 + + time: formats: default: "%Y年%b%d日 %A %H:%M:%S" @@ -138,6 +153,8 @@ zh: circular_dependency: "此关联将导致循环依赖" cant_link_an_issue_with_a_descendant: "问题不能关联到它的子任务" + + actionview_instancetag_blank_option: 请选择 attachment_all: "全部" From 77cb2b08934bc5569c0e702db6ab06978665808f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 20 Jan 2015 16:50:16 +0800 Subject: [PATCH 125/169] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E5=B7=B2=E5=AE=8C=E6=88=90=E7=9A=84=E9=97=AE=E5=8D=B7=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E8=BF=87=E9=95=BF=E6=97=B6=E6=98=BE=E7=A4=BA=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=202.=E5=A2=9E=E5=8A=A0=E5=8F=96=E6=B6=88=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E6=97=B6=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_poll.html.erb | 4 ++- app/views/poll/_poll_republish.html.erb | 44 +++++++++++++++++++++++++ app/views/poll/index.html.erb | 27 +++++++++++++++ public/stylesheets/polls.css | 2 +- 4 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 app/views/poll/_poll_republish.html.erb diff --git a/app/views/poll/_poll.html.erb b/app/views/poll/_poll.html.erb index 8ae766516..dea4e175b 100644 --- a/app/views/poll/_poll.html.erb +++ b/app/views/poll/_poll.html.erb @@ -35,7 +35,9 @@
  • <% if @is_teacher && poll.polls_status == 2%> - <%= link_to "重新发布", republish_poll_poll_path(poll.id), :remote => true, :class => 'polls_de fr ml20' %> + + 取消发布 + <% end %>
  • diff --git a/app/views/poll/_poll_republish.html.erb b/app/views/poll/_poll_republish.html.erb new file mode 100644 index 000000000..3688ba883 --- /dev/null +++ b/app/views/poll/_poll_republish.html.erb @@ -0,0 +1,44 @@ + + + + + + + +
    +
    +
    +

    + 问卷取消发布后学生提交的问卷答案将会被清空, +
    + 是否确定取消发布该问卷? +

    +
    + <%= link_to "确 定",republish_poll_poll_path(poll.id), :class => "upload_btn", :onclick => "clickCanel();" %> + + 取  消 + +
    +
    +
    + +
    + +
    + + + diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb index fa378fc7b..043e6898b 100644 --- a/app/views/poll/index.html.erb +++ b/app/views/poll/index.html.erb @@ -1,4 +1,31 @@ <%= stylesheet_link_tag 'polls', :media => 'all' %> +

    所有问卷 diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css index 58ae913b0..4141164c4 100644 --- a/public/stylesheets/polls.css +++ b/public/stylesheets/polls.css @@ -27,7 +27,7 @@ a.newbtn{ float:right; display:block; width:80px; height:30px; background:#64bdd a:hover.newbtn{ background:#55a1b9; text-decoration:none;} .polls_list ul{ padding-left:10px; border-bottom:1px dashed #c9c9c9; height:32px; padding-top:8px;} a.polls_title{ font-weight:bold; color:#3e6d8e;max-width: 350px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} -.polls_title{ font-weight:bold; color:#3e6d8e;} +.polls_title{ font-weight:bold; color:#3e6d8e;max-width: 350px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} a.pollsbtn{ display:block; width:66px; height:22px; text-align:center; border:1px solid #64bdd9; color:#64bdd9;} a:hover.pollsbtn{ background:#64bdd9; color:#fff; text-decoration:none;} .polls_date{ color:#666666;} From f3062da237ba7a010bc708a1a119a3ab4149b93c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 21 Jan 2015 09:18:29 +0800 Subject: [PATCH 126/169] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A9=BA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=97=B6=EF=BC=8C=E8=AF=BE=E7=A8=8B=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E5=8A=A0=E8=BD=BD(=E5=B1=85=E7=84=B6?= =?UTF-8?q?=E6=98=AF=E6=AD=BB=E5=BE=AA=E7=8E=AF=E3=80=82=E3=80=82=E3=80=82?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/welcome/course.html.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index 927734b24..d427a9aea 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -122,6 +122,7 @@ else course_term = "春季学期" end%> + <%break if Time.new.strftime("%Y").to_i - year_now >= 2%> <% all_new_hot_course += find_all_new_hot_course(course_count-all_new_hot_course.count, @school_id, year_now, course_term)%> <% end%> <%= render :partial => 'course_list', :locals => {:course_list => all_new_hot_course} %> @@ -152,6 +153,7 @@ else course_term = "春季学期" end%> + <%break if Time.new.strftime("%Y").to_i - year_now >= 2%> <% all_new_hot_course += find_all_new_hot_course(9-(all_new_hot_course.count + cur_school_course.count), @school_id, year_now, course_term)%> <% end%> <%= render :partial => 'course_list', :locals => {:course_list => all_new_hot_course} %> From 402dfc788fbd5840a34984eb7f942f013de2d08d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 21 Jan 2015 09:55:40 +0800 Subject: [PATCH 127/169] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E9=97=AE=E5=8D=B7=E6=97=B6=E9=97=AE=E5=8D=B7=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 2 +- app/views/poll/_show_head.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 6890b8dd7..2fc586711 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -40,7 +40,7 @@ class PollController < ApplicationController def new if @course option = { - :polls_name => l(:label_poll_new), + :polls_name => "", :polls_type => @course.class.to_s, :polls_group_id => @course.id, :polls_status => 1, diff --git a/app/views/poll/_show_head.html.erb b/app/views/poll/_show_head.html.erb index ce74dc10a..7ab16b24d 100644 --- a/app/views/poll/_show_head.html.erb +++ b/app/views/poll/_show_head.html.erb @@ -1,7 +1,7 @@

    - <%= poll.polls_name%> + <%= poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name%>

    <%= @poll.polls_description%> From 3bdaeb20c217bac98a682aa3b88ecb1dbd7536c3 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 21 Jan 2015 11:14:01 +0800 Subject: [PATCH 128/169] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9=E9=97=AE?= =?UTF-8?q?=E5=8D=B7=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=202=E3=80=81=E9=97=AE=E5=8D=B7=E5=88=97=E8=A1=A8=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=8F=91=E5=B8=83=E9=97=AE=E5=8D=B7=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=203=E3=80=81=E5=A2=9E=E5=8A=A0js=E8=BF=94=E5=9B=9E=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=204=E3=80=81=E5=8E=BB=E6=8E=89=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E7=9A=84js=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 8 +++- app/views/poll/_poll.html.erb | 64 +++++++++++++++++-------- app/views/poll/_poll_form.html.erb | 2 +- app/views/poll/_poll_republish.html.erb | 12 ----- app/views/poll/_poll_submit.html.erb | 16 +------ app/views/poll/index.html.erb | 24 ++++++++++ app/views/poll/publish_poll.js.erb | 2 + app/views/poll/republish_poll.js.erb | 3 +- public/stylesheets/polls.css | 15 +++++- 9 files changed, 94 insertions(+), 52 deletions(-) create mode 100644 app/views/poll/publish_poll.js.erb diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 2fc586711..42ab98e10 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -187,7 +187,13 @@ class PollController < ApplicationController @poll.polls_status = 2 @poll.published_at = Time.now if @poll.save - redirect_to poll_index_url(:polls_type => "Course", :polls_group_id => @course.id) + if params[:is_remote] + redirect_to poll_index_url(:polls_type => "Course", :polls_group_id => @course.id) + else + respond_to do |format| + format.js + end + end end end diff --git a/app/views/poll/_poll.html.erb b/app/views/poll/_poll.html.erb index dea4e175b..cc7e88547 100644 --- a/app/views/poll/_poll.html.erb +++ b/app/views/poll/_poll.html.erb @@ -1,23 +1,44 @@ +<% has_commit = has_commit_poll?(poll.id ,User.current)%>

  • <% if @is_teacher %> - <% if has_commit_poll?(poll.id ,User.current) %> - <%= poll.polls_name %> + <% if has_commit %> + + <%= poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name%> + <% else %> - <%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %> + <%= link_to (poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name), poll_path(poll.id), :class => "polls_title polls_title_w fl" %> <% end %> <% else %> - <% if has_commit_poll?(poll.id ,User.current) && poll.polls_status == 2 %> + <% if has_commit && poll.polls_status == 2 %> - <%= poll.polls_name %> + <%= poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name %> - <% elsif (!has_commit_poll?(poll.id ,User.current)) && poll.polls_status == 2 %> - <%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %> + <% elsif !has_commit && poll.polls_status == 2 %> + <%= link_to (poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name), poll_path(poll.id), :class => "polls_title polls_title_w fl" %> <% end %> <% end %>
  • +<% if !@is_teacher && has_commit && poll.polls_status == 2%> +
  • 已答
  • +<% end %> + +<%if @is_teacher%> + <% if poll.polls_status == 1 %> +
  • 统计结果
  • + <% elsif poll.polls_status == 2%> +
  • + <%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%> +
  • + <% end%> +<% end%> +
  • - <%if @is_teacher && poll.polls_status == 2%> - <%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%> + <%if @is_teacher %> + <% if poll.polls_status == 1 %> + 发布问卷 + <% elsif poll.polls_status == 2%> + 取消发布 + <% end%> <% end%>
  • @@ -28,18 +49,21 @@ <% end%>
  • - <% if @is_teacher && poll.polls_status == 1%> - - <%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml20"%> + <% if @is_teacher%> + <% if poll.polls_status == 1 %> + <%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml20"%> + <% elsif poll.polls_status == 2%> +
  • 编辑
  • + <% end%> <% end%>

  • -
  • - <% if @is_teacher && poll.polls_status == 2%> - - 取消发布 - - <% end %> -
  • -
  • + + + + + + + +
  • <%= format_time poll.created_at%>
  • \ No newline at end of file diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb index bbf71e0ce..6ce4137a3 100644 --- a/app/views/poll/_poll_form.html.erb +++ b/app/views/poll/_poll_form.html.erb @@ -57,7 +57,7 @@ function poll_submit() { - $('#ajax-modal').html('<%= escape_javascript(render :partial => 'poll_submit', locals: { poll: @poll}) %>'); + $('#ajax-modal').html('<%= escape_javascript(render :partial => 'poll_submit', locals: { :poll => @poll},:is_remote => false) %>'); showModal('ajax-modal', '310px'); $('#ajax-modal').css('height','110px'); $('#ajax-modal').siblings().remove(); diff --git a/app/views/poll/_poll_republish.html.erb b/app/views/poll/_poll_republish.html.erb index 3688ba883..3f93b6b3d 100644 --- a/app/views/poll/_poll_republish.html.erb +++ b/app/views/poll/_poll_republish.html.erb @@ -2,18 +2,6 @@ diff --git a/app/views/poll/_poll_submit.html.erb b/app/views/poll/_poll_submit.html.erb index cdc41dd9d..af3ca2d42 100644 --- a/app/views/poll/_poll_submit.html.erb +++ b/app/views/poll/_poll_submit.html.erb @@ -2,18 +2,6 @@ @@ -27,16 +15,14 @@ 是否确定发布该问卷?

    - <%= link_to "确 定",publish_poll_poll_path(poll.id), :class => "upload_btn", :onclick => "clickCanel();" %> + <%= link_to "确 定",publish_poll_poll_path(poll.id,:is_remote => is_remote), :class => "upload_btn", :onclick => "clickCanel();" %> 取  消
    -
    - diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb index 043e6898b..de30b5deb 100644 --- a/app/views/poll/index.html.erb +++ b/app/views/poll/index.html.erb @@ -25,6 +25,30 @@ } function clickCanel(){hideModal("#popbox02");} + + function poll_submit(poll_id) + { + $('#ajax-modal').html("
    " + + "
    " + + "
    " + + "

    问卷发布后将不能对问卷进行修改,
    是否确定发布该问卷?

    " + + "
    " + + "确  定" + + "取  消" + + "
    " + + "
    " + + "
    " + + "
    " + + "
    "); + showModal('ajax-modal', '310px'); + $('#ajax-modal').css('height','110px'); + $('#ajax-modal').siblings().remove(); + $('#ajax-modal').before("" + + ""); + $('#ajax-modal').parent().removeClass("alert_praise"); + $('#ajax-modal').parent().css("top","").css("left",""); + $('#ajax-modal').parent().addClass("popbox_polls"); + }
    diff --git a/app/views/poll/publish_poll.js.erb b/app/views/poll/publish_poll.js.erb new file mode 100644 index 000000000..ad052f8f2 --- /dev/null +++ b/app/views/poll/publish_poll.js.erb @@ -0,0 +1,2 @@ +$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>"); +alert("发布成功"); \ No newline at end of file diff --git a/app/views/poll/republish_poll.js.erb b/app/views/poll/republish_poll.js.erb index a7399af5b..a2d8e28fa 100644 --- a/app/views/poll/republish_poll.js.erb +++ b/app/views/poll/republish_poll.js.erb @@ -1 +1,2 @@ -$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>"); \ No newline at end of file +$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>"); +alert("取消成功"); \ No newline at end of file diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css index 4141164c4..e46aa5124 100644 --- a/public/stylesheets/polls.css +++ b/public/stylesheets/polls.css @@ -26,8 +26,8 @@ div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margi a.newbtn{ float:right; display:block; width:80px; height:30px; background:#64bdd9; color:#fff; font-size:14px; margin:10px; text-align:center;} a:hover.newbtn{ background:#55a1b9; text-decoration:none;} .polls_list ul{ padding-left:10px; border-bottom:1px dashed #c9c9c9; height:32px; padding-top:8px;} -a.polls_title{ font-weight:bold; color:#3e6d8e;max-width: 350px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} -.polls_title{ font-weight:bold; color:#3e6d8e;max-width: 350px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a.polls_title{ font-weight:bold; color:#3e6d8e;max-width: 300px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +.polls_title{ font-weight:bold; color:#3e6d8e;max-width: 300px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} a.pollsbtn{ display:block; width:66px; height:22px; text-align:center; border:1px solid #64bdd9; color:#64bdd9;} a:hover.pollsbtn{ background:#64bdd9; color:#fff; text-decoration:none;} .polls_date{ color:#666666;} @@ -134,3 +134,14 @@ a:hover.upload_btn_grey{background:#8a8a8a;} .upload_con a:hover{ text-decoration:none;} .polls_btn_box{ width:145px; margin:0 auto; padding-left:10px;} .polls_btn_box02{ width:80px; margin:0 auto; padding-left:10px;} + +/***新增20150120***/ +.pollsbtn_tip{ width:30px; height:17px; display:block;background:url(images/icons.png) 0 -417px no-repeat;padding-left:7px; color:#fff;} +a.btn_de{ border:1px solid #ff5d31; color:#ff5d31; } +a:hover.btn_de{ background:#ff5d31;} +a.btn_pu{ border:1px solid #3cb761; color:#3cb761; } +a:hover.btn_pu{ background:#3cb761;} +.pollsbtn_grey{ border:1px solid #b1b1b1; color:#b1b1b1; padding:0px 9px; } +.polls_title_w { width:330px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;} +.polls_de_grey{ color:#b1b1b1;} +.ml5{ margin-left:5px;} From 95dcdd71251982a69348d19f79b4c2ec1d3da8d1 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 21 Jan 2015 11:18:47 +0800 Subject: [PATCH 129/169] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E9=97=AE=E5=8D=B7=E7=BC=96=E8=BE=91=E7=95=8C=E9=9D=A2=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_poll_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb index 6ce4137a3..b3fae8b4a 100644 --- a/app/views/poll/_poll_form.html.erb +++ b/app/views/poll/_poll_form.html.erb @@ -57,7 +57,7 @@ function poll_submit() { - $('#ajax-modal').html('<%= escape_javascript(render :partial => 'poll_submit', locals: { :poll => @poll},:is_remote => false) %>'); + $('#ajax-modal').html('<%= escape_javascript(render :partial => 'poll_submit', locals: { :poll => @poll,:is_remote => false}) %>'); showModal('ajax-modal', '310px'); $('#ajax-modal').css('height','110px'); $('#ajax-modal').siblings().remove(); From 6ccb154cc3f6e98e219645474e76370fa6c0e105 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Wed, 21 Jan 2015 11:33:29 +0800 Subject: [PATCH 130/169] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=95=99=E8=A8=80?= =?UTF-8?q?=EF=BC=8C=E5=8F=91=E9=82=AE=E4=BB=B6=E7=BB=99=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E6=89=80=E6=9C=89=E4=BA=BA=20Signed-off-by:=20alan=20<54753343?= =?UTF-8?q?4@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .rspec | 2 + app/helpers/courses_helper.rb | 4 ++ app/models/journals_for_message_observer.rb | 2 + app/models/mailer.rb | 8 ++-- config/application.rb | 10 +++++ .../20150121030451_add_initial_products.rb | 11 ++++++ db/schema.rb | 2 +- spec/spec_helper.rb | 38 +++++++++++++++++++ 8 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 .rspec create mode 100644 db/migrate/20150121030451_add_initial_products.rb create mode 100644 spec/spec_helper.rb diff --git a/.rspec b/.rspec new file mode 100644 index 000000000..8c18f1abd --- /dev/null +++ b/.rspec @@ -0,0 +1,2 @@ +--format documentation +--color diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 411de1dcf..95b049dc2 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -111,6 +111,10 @@ module CoursesHelper #garble count # end + #获取课程所有成员 + def course_member course + course.members + end # 学生人数计算 # add by nwb def studentCount course diff --git a/app/models/journals_for_message_observer.rb b/app/models/journals_for_message_observer.rb index 093002a2c..0e5f29d03 100644 --- a/app/models/journals_for_message_observer.rb +++ b/app/models/journals_for_message_observer.rb @@ -1,7 +1,9 @@ # Added by young class JournalsForMessageObserver < ActiveRecord::Observer def after_create(journals_for_message) + thread1 = Thread.start do Mailer.journals_for_message_add(User.current, journals_for_message).deliver + end end end diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 72e60a0bf..a2e742ee3 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -62,13 +62,13 @@ class Mailer < ActionMailer::Base course = journals_for_message.jour @author = journals_for_message.user #课程的教师 - @teachers = searchTeacherAndAssistant journals_for_message.jour + @members = course_member journals_for_message.jour #收件人邮箱 @recipients ||= [] - @teachers.each do |teacher| - if teacher.user.notify_about? journals_for_message + @members.each do |teacher| + @recipients << teacher.user.mail - end + end mail :to => @recipients, diff --git a/config/application.rb b/config/application.rb index 716e3875d..2f1534d00 100644 --- a/config/application.rb +++ b/config/application.rb @@ -21,6 +21,16 @@ module RedmineApp config.verifier_email = "lizanle521@126.com" end + config.generators do |g| + g.test_framework :rspec, + fixtures: true, + view_specs: false, + helper_specs: false, + routing_specs: false, + controller_specs: true, + request_specs: false + g.fixture_replacement :factory_girl, dir: "spec/factories" + end # Custom directories with classes and modules you want to be autoloadable. config.autoload_paths += %W(#{config.root}/lib) diff --git a/db/migrate/20150121030451_add_initial_products.rb b/db/migrate/20150121030451_add_initial_products.rb new file mode 100644 index 000000000..cb6006068 --- /dev/null +++ b/db/migrate/20150121030451_add_initial_products.rb @@ -0,0 +1,11 @@ +class AddInitialProducts < ActiveRecord::Migration + def up + Forum.create(:name =>"new forum", :description => "", :topic_count => "0", + :memo_count => "0", :last_memo_id =>"0", :creator_id =>"2", + :sticky =>"0", :locked =>"0") + end + + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 2120080a0..7d10abc35 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 => 20150114022710) do +ActiveRecord::Schema.define(:version => 20150121030451) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 000000000..d2cbea7d9 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,38 @@ +# This file is copied to spec/ when you run 'rails generate rspec:install' +ENV["RAILS_ENV"] ||= 'test' +require File.expand_path("../../config/environment", __FILE__) +require 'rspec/rails' +require 'rspec/autorun' + +# Requires supporting ruby files with custom matchers and macros, etc, +# in spec/support/ and its subdirectories. +Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } + +RSpec.configure do |config| + # ## Mock Framework + # + # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: + # + # config.mock_with :mocha + # config.mock_with :flexmock + # config.mock_with :rr + + # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures + config.fixture_path = "#{::Rails.root}/spec/fixtures" + + # If you're not using ActiveRecord, or you'd prefer not to run each of your + # examples within a transaction, remove the following line or assign false + # instead of true. + config.use_transactional_fixtures = true + + # If true, the base class of anonymous controllers will be inferred + # automatically. This will be the default behavior in future versions of + # rspec-rails. + config.infer_base_class_for_anonymous_controllers = false + + # Run specs in random order to surface order dependencies. If you find an + # order dependency and want to debug it, you can fix the order by providing + # the seed, which is printed after each run. + # --seed 1234 + config.order = "random" +end From 2f8a183168b265bf9814a41cbc10577eba641bdb Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 21 Jan 2015 11:34:53 +0800 Subject: [PATCH 131/169] =?UTF-8?q?1=E3=80=81=E6=9B=BF=E6=8D=A2=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E5=9B=BE=E7=89=87=202=E3=80=81=E5=B7=B2=E7=AD=94?= =?UTF-8?q?=E9=97=AE=E5=8D=B7=E5=90=8E=E9=97=AE=E5=8D=B7=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=B7=B2=E7=AD=94=E6=A0=87=E5=BF=97=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/images/icons.png | Bin 2382 -> 2479 bytes public/stylesheets/polls.css | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/images/icons.png b/public/stylesheets/images/icons.png index 2d2b33fe1a24f741e781b935549f8172180870ad..e0ba4f4e6525285ce88227c93c3fa01348628857 100644 GIT binary patch literal 2479 zcmZ`*2~d;Q7XGskG^`2|g|H}#f}mJHksU=uF@YCamKXwxP}$NTvI`_Yw3J;)Y>-VM zQI;rM2*fBstJFwTtg;6Eu~dWr22t4pzI5Kqo6dXf%y;KIbLM{Mo_p_^Gbh&k!oq`gwU>Df>-w>_=WuqEAlrkDr}HS3oZ^_zxmlVz8eT?q)6i2qS2?1+ere;2 zGk2~XbKkNB&On;)ZPN7m*{K-mew{6rfsU`G^L;aYLpF)6lgAm4lIGBvE{hfMADjnm z63fMA)K#&pYt6mct0>H9IE)(rR3Au2Xw(5ddoeBjvq9YWPQHpqORr{dA6-D zdb@7^3*Y99`dzaR6Xp;75_gU4E=&b>4Y6nsXv3ir|Cn_2{;fI@S;b-5d2KzZ{o^Ly zX!P!(1e=%iymI=PDh-iKE`Y50JAgw!&AcjT&2u)hRtqS6-{FDc;jQ8}L(nWWhf>w| zTVmz8Fs@1e|6k!ho?d^G+>8fFal_LVcn;$Vd-YL?N79bMhk06%kyYaq*A5>j7eIy@ zP!em@5wk5tCZ*aH;e0!s+i;_n8$|mbAZew*k|vhArrL8K<2gDBA|JOekK=;__<;aK z^sm+Jkq3B(V@PeOlaHQ<`q~8DwfD3k>K5dd#vF7Tj@#jxkTrl3~DF_L`P(ALp}ay!f#23Z#7iOQIaF=Rvw* z#PI2E6*=lGaC-w`VTa5L3=yI*V|HN8z)C;}{aOX$wO)rsDA^-A-2v48po|3^F|TL> zFiZCWr)9U{3Jfm|@kpLK1=fX^`rZ3|Vq1hk3z(s&^nLqUU7W=mGsDN;*?;^9$gjc& zU0@PYVUY!^@ZBcT#ck8bZ9$^-1OCVLdH0{BZ6>S|rAwUyE5E0Vf|L0@FiCxx!&V!C zeg}WiLbfdFJsu9Y7|-WX_F>2e!gXpFuT7_D5$ezR#OXxf@X1-+80|>`b%t#NENOwu0gnTy4KS zy2jpS`^s_&%tt3b*0~-Hu1TZ_X97E2m|XlUqlt1GMihGboVxr$xRVkNj^~qe!%2wbon%JAnHP!R;JbwCpkHp#^2(<8bLqFF#AC=M z_qHE1on=a(zHm)g1Upz^ORf)R7@rYC^I~SM0v9$eX|FMdY{@0x1P>OJZ9^pQmHB~m z>WUWIMTHQ-bQfC4vNhd(^nC7=L-zP9QV%FqPdJ*7npIt9D1USRp-7_o6k*vfK6}?} z;-m$Cky%H}qfhZkJD4uu1K}X$_Q^?XIk5I2zr`M>Q0Im-rskfdUz`g*U4v6F%_SQ^*L%pTM%NT6VXWFz1sekaHYVqTwcJch>9ZsoExZ3s z-$HAIHokHgjN(2moX(Eoj&v!yA)a{fog~=U|55PiY-qAG)Il7vKtRA;21&fdBPr23 zDYv9^dMw1zwfG6Il#(glCZ~0mn?V}Fgy5qU9>DFL!p@c@=B7-4vy{sosK0z{S;Bk} zzq^so8zY6}2aeAoGBy%&@fs%^c~wq>341-;ryl3wHAZzM5P?>pozW?BBU@Yu58>~8 zM#Qv*yw(wW70o-)Ba>_MjJpPs;mj sYp6*W92!kPdDk%9tSIS!e1!qVBLZ96PYv^mVGB5R1nY6@P-xb_0kz3y2mk;8 literal 2382 zcmZ`*3pA8l8{VHWqG)o7C9r0BG?5d|Mar z6ae8y08IM>V3h@cTu7Q<(*XcPdvOl-CnAStbN!wudMdrPV|YE4Jn|@OBmujK`<;Mu zxJ@@p<%H{>OElK>Pq;RsM@f0&zU5RV*2|HrZ7AL#3effFNye*YNm~Wfym_72@`neJHLtBX5s`ccOby$7Sx^S+`hO#yY z1E_T?$Ke3Dz)bSkUt| z+;RNG=zjN(rV`4K6(K$_%op0Su`}#_% z^>m}{bXGNlbZ9@talLX+i$4uE4_-C#vHg`}g6GarG@XRWX#qxW+i0iy;_bo;WF_(c zcJN2wHxoKHz#W5lFA5lCCXMQP^4iel{D z3y&vuvAm_x>2+3+%-;V4ct(~yp|IzUd9G*H1?EXyu^JTmN1pM4>R$jfja%IjWx)z) z<{scTGDq#-nL0kQY%)EioPtaBiJ+DDX#Cu#!2CG0vuIz@3Cr-kMZGRXCk)DV7Ev<9 z*jf!KOeSL5vwhTH;kM9N|{tf*r7I#GwD_?$piKMt;10G&6dH+Cx))^JvAe5(Db2}Ku z(2hnD^U%J}U$aou+Aq#9MCUh|fB|#qxvbTcu=zmbdH+hGoQ#S{o^a*h)3CtCZ_3dO zB~Qu4gBATpwH@Z|5w@vTPywuK+HNxquNjDSTw2vtIMJ0AU9k((FD=FUBL6IAGrL_` z#r2SquKIAIX`j0ZqxVrnX}Z;PVJ7Ab`)hp1Cs#VZxJ5bMuL7lvY%c2ko<22~-&2RU@Y;D@d};d7RFZl?i0GIvPl~5c-7lH(3jW^REI8RtSQaruG|0z- z=`Cj;J>#hC{ zLX|UTScy*X8e#nOV89kZLL}`(zoZ!Z-31>V>x3H`h>RtzMFZJBvu?2XpJHr@uwsU~ zsk7cG`6)t=Gi+uZgBCAwuhK*=Gb9(YlkyK^Hsj#J)^mN%usK~E2h09$s4hkJlAN8i zzj=p7OmoSg3A(NnNJBOJwK2*1&{B4iXY2G>yFP?cmoiG#`9b7{!N{kx1|n?Eh@wwh zD^FIi1d^3i|ESX$hAw-CZS8El?pJlXsS!6GuK zKz=4A#>9Y|+U`*j9_9+OK*$-q)MafR-+0u#;{I0Nepn^8!MGIu9wyE{Y|a4nt(DXo zyy3di@@}$tWTC1LAzJ|&fpQ4=!`09-J%$@B_bF;rinu*s-mKZDW#h7I&CM%%yg;N5 zj)6OEB(yO;q-?&hHv<-$S=9o5Xl(0qsq75~U5|~mx(JGhEo?{|pz@Cnt*DW&5m#tO zkk`i7^O$!iRlw)zk$|@MrN@U)DL8UYkG!vsBmZV@5f=spi_6e0nrfY!5UN(xsGFd+ z$zUQ-f$E{?o;?vhN$9A?9blN9%zDJjmW347VWKHi)Ue3NMQ#XWnD`-6v5{7cld0_IKIfVMo`C33gQL6?e5 zorWXGn%4j7*#?%-0_vW=lOngA$S`}A?aK(VA45zyCC1B^BhD}# zTZoD%AuK;uBG2*F*HraA&8r&^8Y{4lUy_<@a*WvNFV4k_ zW5pEZ@f|36l*MU7y)$p7E>bicgTvQ8h~muGr^RWA6fhn=d}7J zHL_m#9sZn*`lj~i9XDAo`0H5h_+CQ!(mDk6uNQX3y-ao&{DlC{(Z%7}KL5DC0Rml0 AWB>pF diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css index e46aa5124..06802285d 100644 --- a/public/stylesheets/polls.css +++ b/public/stylesheets/polls.css @@ -136,7 +136,7 @@ a:hover.upload_btn_grey{background:#8a8a8a;} .polls_btn_box02{ width:80px; margin:0 auto; padding-left:10px;} /***新增20150120***/ -.pollsbtn_tip{ width:30px; height:17px; display:block;background:url(images/icons.png) 0 -417px no-repeat;padding-left:7px; color:#fff;} +.pollsbtn_tip{ width:30px; height:17px; display:block;background:url(images/icons.png) 0 -372px no-repeat;padding-left:7px; color:#fff;} a.btn_de{ border:1px solid #ff5d31; color:#ff5d31; } a:hover.btn_de{ background:#ff5d31;} a.btn_pu{ border:1px solid #3cb761; color:#3cb761; } From a53831a6b5f35f107bd4087b020ef6a984bda3f9 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 21 Jan 2015 11:44:49 +0800 Subject: [PATCH 132/169] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BD=93=E9=97=AE?= =?UTF-8?q?=E5=8D=B7=E6=A0=87=E9=A2=98=E8=BF=87=E9=95=BF=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E6=9F=A5=E7=9C=8B=E9=97=AE=E5=8D=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E7=9C=81=E7=95=A5=E5=8F=B7=E8=BF=87=E6=97=A9=E5=87=BA?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_poll.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/poll/_poll.html.erb b/app/views/poll/_poll.html.erb index cc7e88547..3290ff2dc 100644 --- a/app/views/poll/_poll.html.erb +++ b/app/views/poll/_poll.html.erb @@ -10,11 +10,11 @@ <% end %> <% else %> <% if has_commit && poll.polls_status == 2 %> - + <%= poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name %> <% elsif !has_commit && poll.polls_status == 2 %> - <%= link_to (poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name), poll_path(poll.id), :class => "polls_title polls_title_w fl" %> + <%= link_to (poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name), poll_path(poll.id), :class => "polls_title polls_title_w fl", :style => "max-width: 550px;width: 550px;" %> <% end %> <% end %> From 77b8bf18c8f042c02f783e85c23246ef18c6929e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 21 Jan 2015 11:50:33 +0800 Subject: [PATCH 133/169] =?UTF-8?q?#1842=20=E4=BF=AE=E6=94=B9=E9=83=A8?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E9=9D=A2=E6=8F=8F=E8=BF=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_edit_MCQ.html.erb | 2 +- app/views/poll/_new_MCQ.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/poll/_edit_MCQ.html.erb b/app/views/poll/_edit_MCQ.html.erb index 613fed371..129f50e94 100644 --- a/app/views/poll/_edit_MCQ.html.erb +++ b/app/views/poll/_edit_MCQ.html.erb @@ -18,7 +18,7 @@
    - + />
    diff --git a/app/views/poll/_new_MCQ.html.erb b/app/views/poll/_new_MCQ.html.erb index de9dc9f08..027a1c1f6 100644 --- a/app/views/poll/_new_MCQ.html.erb +++ b/app/views/poll/_new_MCQ.html.erb @@ -3,7 +3,7 @@
    - +
    From f01d164295ea186cf827a4e551baed20b9b0ed61 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Wed, 21 Jan 2015 12:01:02 +0800 Subject: [PATCH 134/169] Signed-off-by: alan <547533434@qq.com> --- app/helpers/courses_helper.rb | 2 +- app/models/mailer.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 95b049dc2..22eb9bfae 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -112,7 +112,7 @@ module CoursesHelper # end #获取课程所有成员 - def course_member course + def course_all_member course course.members end # 学生人数计算 diff --git a/app/models/mailer.rb b/app/models/mailer.rb index a2e742ee3..2cd069175 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -62,7 +62,7 @@ class Mailer < ActionMailer::Base course = journals_for_message.jour @author = journals_for_message.user #课程的教师 - @members = course_member journals_for_message.jour + @members = course_all_member journals_for_message.jour #收件人邮箱 @recipients ||= [] @members.each do |teacher| From 520e9c73aa34be5f9983f9bf1820f35311c91102 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 21 Jan 2015 14:30:19 +0800 Subject: [PATCH 135/169] =?UTF-8?q?#1836=20=E6=9C=AA=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=88=96=E8=80=85=E6=B2=A1=E6=9C=89=E6=9D=83=E9=99=90=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E7=A7=81=E6=9C=89=E9=A1=B9=E7=9B=AE=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=88=B0403=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index d3df57982..24a3ff19f 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -558,6 +558,11 @@ class ProjectsController < ApplicationController # Show @project def show + if(@project && !@project.is_public && !User.current.member_of?(@project)) + render_403 + return + end + @project_type = params[:project_type] # try to redirect to the requested menu item From 7ee17b6d7ceb038ee5d24f8045868237daefc275 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 21 Jan 2015 15:43:15 +0800 Subject: [PATCH 136/169] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=97=AE=E5=8D=B7?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E5=B7=A6=E8=BE=B9=E8=BE=B9=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/polls.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css index 06802285d..e601d231d 100644 --- a/public/stylesheets/polls.css +++ b/public/stylesheets/polls.css @@ -19,7 +19,7 @@ div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margi .polls_btn span{ color:#15bed1; font-size:12px; font-weight:normal;} /*问卷列表*/ -.polls_content{ width:615px;} +.polls_content{ width:615px;padding-left: 6px;} .polls_head{ width:677px; height:48px; background:#eaeaea;} .polls_head h2{ float:left; font-size:14px; color:#585858; margin:11px 0 0 10px;} .polls_head span{ font-weight:normal; color:#15bccf;} From d68486669e5712e268769fde68fceac04392d985 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 21 Jan 2015 16:07:44 +0800 Subject: [PATCH 137/169] =?UTF-8?q?#1830=E8=AF=BE=E7=A8=8B--=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E5=AD=97=E4=BD=93=E5=8E=8B=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/member.html.erb | 2 +- public/stylesheets/course_group.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/courses/member.html.erb b/app/views/courses/member.html.erb index 2599760ad..803be3731 100644 --- a/app/views/courses/member.html.erb +++ b/app/views/courses/member.html.erb @@ -56,7 +56,7 @@ <%= stylesheet_link_tag 'course_group', :media => 'all' %> -
    +
    + + + diff --git a/app/views/projects/join_project.js.erb b/app/views/projects/join_project.js.erb new file mode 100644 index 000000000..f3bdfb50a --- /dev/null +++ b/app/views/projects/join_project.js.erb @@ -0,0 +1,9 @@ +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/join_project') %>'); +showModal('ajax-modal', '510px'); +$('#ajax-modal').css('height','260px'); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before("" + + ""); +$('#ajax-modal').parent().removeClass("alert_praise"); +$('#ajax-modal').parent().css("top","").css("left",""); +$('#ajax-modal').parent().addClass("alert_box"); diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 0dc62c6a3..3e341bd27 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -66,6 +66,9 @@ :course => 0, :project_type =>( @project_type||=0)}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %> +      + <%= link_to l(:label_join_project), join_project_projects_path ,:remote => true, :class => 'icon icon-add' %> +      <% end %>
    diff --git a/config/locales/zh.yml b/config/locales/zh.yml index bd6c6dc22..fbdee1d1f 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2282,4 +2282,5 @@ zh: label_answer: 答案: label_poll_answer_valid_result: 以上为有效问答题答案! label_answer_total: 总计: + label_join_project: 加入项目 diff --git a/config/routes.rb b/config/routes.rb index 524373378..65498e4ec 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -377,6 +377,10 @@ RedmineApp::Application.routes.draw do match 'copy', :via => [:get, :post] end + collection do + match 'join_project', :via => [:get, :post] + end + #by young match '/member', :to => 'projects#member', :as => 'member', :via => :get match '/file', :to => 'projects#file', :as => 'file', :via => :get From 8f1249390a46a1804fc8bd659cdbc451f070a741 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Thu, 22 Jan 2015 17:31:34 +0800 Subject: [PATCH 144/169] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E5=8F=91?= =?UTF-8?q?=E9=80=81=E5=A4=9A=E5=B0=81=E7=9B=B8=E5=90=8C=E9=82=AE=E4=BB=B6?= =?UTF-8?q?=E3=80=8B=20Signed-off-by:=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/mailer.rb | 11 ++++++++--- app/models/project.rb | 2 +- app/views/mailer/issue_edit.html.erb | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 02684a187..23ac36054 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -147,8 +147,10 @@ class Mailer < ActionMailer::Base @project_url = url_for(:controller => 'projects', :action => 'show', :id => issue.project_id, :token => @token.value) @user_url = url_for(my_account_url(user,:token => @token.value)) - - cc = issue.watcher_recipients - issue.recipients + cc = nil + if recipients == issue.recipients[0] + cc = issue.watcher_recipients - issue.recipients + end subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] (#{issue.status.name}) #{issue.subject}" mail(:to => recipients, :cc => cc, @@ -197,8 +199,11 @@ class Mailer < ActionMailer::Base # Watchers in cc + cc = nil + if recipients == journal.recipients[0] + cc = journal.watcher_recipients - journal.recipients + end - cc = journal.watcher_recipients - journal.recipients s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] " s << "(#{issue.status.name}) " if journal.new_value_for('status_id') s << issue.subject diff --git a/app/models/project.rb b/app/models/project.rb index 01e6cd91c..14763347f 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -600,7 +600,7 @@ class Project < ActiveRecord::Base # Returns the users that should be notified on project events def notified_users # TODO: User part should be extracted to User#notify_about? - members.select {|m| m.principal.present? && (m.mail_notification? || m.principal.mail_notification == 'all' || m.principal.mail_notification == 'only_my_events' ||m.principal.mail_notification == 'selected')}.collect {|m| m.principal} + members.select {|m| m.principal.present? && (m.mail_notification? || m.principal.mail_notification == 'all')}.collect {|m| m.principal} end # Returns an array of all custom fields enabled for project issues diff --git a/app/views/mailer/issue_edit.html.erb b/app/views/mailer/issue_edit.html.erb index 6fcb0ddb5..af167cff5 100644 --- a/app/views/mailer/issue_edit.html.erb +++ b/app/views/mailer/issue_edit.html.erb @@ -12,7 +12,7 @@ <%= l(:field_content)%>:<%= @journal.notes %>
    -
    + <%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %>
    <%= link_to( l(:mail_issue_footer), @user_url) %>
    From 84bfd30fc510ec57dd044ef2bad5664ba1142261 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 22 Jan 2015 17:46:12 +0800 Subject: [PATCH 145/169] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=8F=8D=E9=A6=88=E5=BC=B9=E6=A1=86=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_feedback.html.erb | 289 ++++++++++++---------- config/locales/zh.yml | 3 +- public/images/blue_line.png | Bin 0 -> 2819 bytes public/images/sidebar_bg.png | Bin 0 -> 9419 bytes 4 files changed, 164 insertions(+), 128 deletions(-) create mode 100644 public/images/blue_line.png create mode 100644 public/images/sidebar_bg.png diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb index 52006e94d..ae85d9479 100644 --- a/app/views/layouts/_base_feedback.html.erb +++ b/app/views/layouts/_base_feedback.html.erb @@ -1,49 +1,122 @@ - - - - -意见反馈浮窗 + - + + + + +意见反馈 + + + - - -
    -
    - - <% get_memo %> - <%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %> -
    -

    - <%= f.text_area :subject, :class => "opnionText",:placeholder => "有什么想说的,尽管来咆哮吧~~"%> -

    -

    - <%= f.hidden_field :content, :required => true ,:value=>'该贴来自用户反馈!'%> -

    - <%#= f.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %> - 提  交 - <% end %> -
    - - - -
    + + +
    +
    +
    + +
    +
    + <% get_memo %> + <%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %> + <%= f.text_area :subject, :class => "opnionText",:placeholder => "有什么想说的,尽管来咆哮吧~~"%> + <%= f.hidden_field :content, :required => true ,:value=>'该贴来自用户反馈!'%> + <%#= f.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %> + 提  交 + <% end %> +
    + +
    +
    +
    +
    +
    提交
    - -
    -
    技术支持:
    -

    <%= l(:label_course_adcolick) %>黄井泉
    - <%= l(:label_course_adcolick) %>白羽

    -
    - -
    + + - - - + \ No newline at end of file diff --git a/config/locales/zh.yml b/config/locales/zh.yml index bd6c6dc22..fad70aabd 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2282,4 +2282,5 @@ zh: label_answer: 答案: label_poll_answer_valid_result: 以上为有效问答题答案! label_answer_total: 总计: - + label_technical_support: 技术支持: + label_feedback: 意见反馈 diff --git a/public/images/blue_line.png b/public/images/blue_line.png new file mode 100644 index 0000000000000000000000000000000000000000..4ae87f34320f80b3839409e80f275f205369f5e8 GIT binary patch literal 2819 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 V1*1Is;UEA2002ovPDHLkV1lWASCaq$ literal 0 HcmV?d00001 diff --git a/public/images/sidebar_bg.png b/public/images/sidebar_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..e41ea789d541cffeab9bdeed534fd1ffb17830da GIT binary patch literal 9419 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 Date: Thu, 22 Jan 2015 20:41:42 +0800 Subject: [PATCH 146/169] =?UTF-8?q?=E5=A4=9A=E7=A7=8D=E9=82=AE=E7=AE=B1?= =?UTF-8?q?=E9=82=AE=E4=BB=B6=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4=EF=BC=8C?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E5=86=85=E5=AE=B9=E6=A0=B7=E5=BC=8F=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/mailer.html.erb | 28 +++++++++------- app/views/mailer/_issue.html.erb | 48 ++++++++++++++++------------ app/views/mailer/_issue.text.erb | 4 +++ app/views/mailer/issue_add.html.erb | 4 +-- app/views/mailer/issue_edit.html.erb | 14 ++------ app/views/mailer/issue_edit.text.erb | 8 ----- 6 files changed, 54 insertions(+), 52 deletions(-) diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb index a05eacbd1..abb896b61 100644 --- a/app/views/layouts/mailer.html.erb +++ b/app/views/layouts/mailer.html.erb @@ -10,37 +10,43 @@ body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; back div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span,ol{ margin:0; padding:0;} div,img,tr,td,table{ border:0;} table,tr,td{border:0;cellspacing:0; cellpadding:0;} +.mail{ width:600px; margin:20px; height:auto; color:#4b4b4b; font-size:14px; } ol,ul,li{ list-style-type:none} .cl{ clear:both; overflow:hidden; margin-top: 30px;} -a{ text-decoration:none; } -a:hover{ text-decoration:underline; } .mail_box,ul,li{ list-style-type:none} -.mail{ width:600px; margin:20px; height:auto; color:#4b4b4b; font-size:14px; } .mail a{color:#1b55a7; font-weight: bold; } .mail_content{ margin-top:30px;} .c_blue{ color:#1b55a7;} .mail_box{ border:1px solid #c8c8c8; width:570px; height: auto; padding:15px; margin-top:10px; margin-bottom:10px;} .mail_box_p{ float:left; display: block; width:527px;} -a.mail_reply{ display:block; float:right; width:80px; text-align:center; height:30px; background:#15bccf; color:#fff; font-weight:normal; font-size:14px;} -a:hover.mail_reply{ background:#06a9bc; text-decoration:none;} .mail_fujian{ float:left; width:527px; display: block; } .mail_fujian a{ font-weight:normal; font-size:12px;} .mail_foot a{ font-size:12px; font-weight:normal;} +a{ text-decoration:none; } +a:hover{ text-decoration:underline; } +a.mail_reply{ display:block; float:right; width:80px; text-align:center; height:30px; background:#15bccf; color:#fff; font-weight:normal; font-size:14px;} +a:hover.mail_reply{ background:#06a9bc; text-decoration:none;} + + + + + - -
    -
    -
    + + +
    +
    +

    <%= l(:mail_issue_greetings)%>

    <%= yield %>
    - <%= Redmine::WikiFormatting.to_html(Setting.text_formatting, Setting.emails_footer).html_safe %> + <%= Redmine::WikiFormatting.to_html(Setting.text_formatting, Setting.emails_footer).html_safe %>
    -
    +
    diff --git a/app/views/mailer/_issue.html.erb b/app/views/mailer/_issue.html.erb index c97c82426..d11248aff 100644 --- a/app/views/mailer/_issue.html.erb +++ b/app/views/mailer/_issue.html.erb @@ -1,32 +1,40 @@

    - - <%= link_to(h("#{@issue.author}(#{@issue.author.show_name})"), @issue_author_url) %> + + <%= link_to(h("#{@issue.author}(#{@issue.author.show_name})"), @issue_author_url , :style=>'color:#1b55a7; font-weight:bold;') %> <%= l(:mail_issue_title_userin)%> - <%= link_to(h("#{@issue.project.name}"),@project_url) %><%= l(:mail_issue_title_active)%>

    -
    -
      -
    • <%= l(:mail_issue_subject)%><%= link_to(issue.subject, issue_url) %>
    • -
    • <%= l(:mail_issue_sent_from)%><%= issue.project.name %><%= l(:mail_issue_from_project)%>
    • -
    • <%= l(:mail_issue_content)%> - <%= issue.description %> + <%= link_to(h("#{@issue.project.name}"), @project_url, :style=>'color:#1b55a7; font-weight:bold;') %><%= l(:mail_issue_title_active)%>

      +
      +
        +
      • <%= l(:mail_issue_subject)%><%= link_to(issue.subject, issue_url, :style=>'color:#1b55a7; font-weight:bold;') %>
      • +
      • <%= l(:mail_issue_sent_from)%><%= issue.project.name %><%= l(:mail_issue_from_project)%>
      • +
      • <%= l(:mail_issue_content)%> + + <% if @journal.nil? %> + <%= issue.description %> + <% else %> + <%= @journal.notes %> + <% end%> +
      • -
      • +
      • - <% unless @issue.attachments.nil? %> - <%= l(:mail_issue_attachments)%> - + <% unless @issue.attachments.nil? %> + <%= l(:mail_issue_attachments)%> + <% @issue.attachments.each do |attach| %> -

        <%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %>

        - <% end %>
        - <% end %> +

        <%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false, :style=>'color:#1b55a7; font-weight:bold;')%>

        + <% end %>
        + <% end %> -
      • +
      -
      - -
      +
      + +
      ����[left or right] -// minStatue --> ��С״̬��ֻ��show_btn -// skin --> Ƥ������ -// durationTime --> ���ʱ�� -//���� : +// ???? : float --> ????[left or right] +// minStatue --> ??С???????show_btn +// skin --> ??????? +// durationTime --> ?????? +//???? : $("#scrollsidebar2").fix({ - float : 'right', //default.left or right - minStatue : true, //default.false or true - skin : 'green', //default.gray or yellow ��blue ��green ��orange ��white + float : 'right', //default.left or right + minStatue : true, //default.false or true + skin : 'green', //default.gray or yellow ??blue ??green ??orange ??white durationTime : 1000 // }); // @@ -66,53 +66,53 @@ a:hover.opnionButton{ text-decoration:underline;} float : 'left', minStatue : false, skin : 'blue', - durationTime : 1000 + durationTime : 1000 } - var options = $.extend(defaults, options); + var options = $.extend(defaults, options); - this.each(function(){ - //��ȡ���� + this.each(function(){ + //??????? var thisBox = $(this), closeBtn = thisBox.find('.close_btn' ), show_btn = thisBox.find('.show_btn' ), sideContent = thisBox.find('.side_content'), sideList = thisBox.find('.side_list') - ; - var defaultTop = thisBox.offset().top; //�����Ĭ��top - - thisBox.css(options.float, 0); + ; + var defaultTop = thisBox.offset().top; //????????top + + thisBox.css(options.float, 0); if(options.minStatue){ $(".show_btn").css("float", options.float); sideContent.css('width', 0); show_btn.css('width', 25); - + } - //Ƥ������ + //??????? if(options.skin) thisBox.addClass('side_'+options.skin); - - - //����scroll�¼� + + + //????scroll??? $(window).bind("scroll",function(){ var offsetTop = defaultTop + $(window).scrollTop() + "px"; thisBox.animate({ top: offsetTop }, { - duration: options.durationTime, - queue: false //�˶����������붯������ + duration: options.durationTime, + queue: false //??????????????????? }); - }); - //close�¼� + }); + //close??? closeBtn.bind("click",function(){ sideContent.animate({width: '0px'},"fast"); show_btn.stop(true, true).delay(300).animate({ width: '25px'},"fast"); }); - //show�¼� + //show??? show_btn.click(function() { $(this).animate({width: '0px'},"fast"); sideContent.stop(true, true).delay(200).animate({ width: '154px'},"fast"); }); - + }); //end this.each }; @@ -132,36 +132,34 @@ function f_submit() } - + 意见反馈 - - - + - +
      -
      -
      +
      +
      <% get_memo %> <%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %> - <%= f.text_area :subject, :class => "opnionText",:placeholder => "有什么想说的,尽管来咆哮吧~~"%> + <%= f.text_area :subject, :class => "opnionText",:placeholder => "有什么想说的,尽管来咆哮吧~~"%> <%= f.hidden_field :content, :required => true ,:value=>'该贴来自用户反馈!'%> <%#= f.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %> - 提  交 - <% end %> -
      + 提  交 + <% end %> +
      @@ -169,9 +167,9 @@ function f_submit()
      提交
      - - + \ No newline at end of file diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb index b3fae8b4a..df4859613 100644 --- a/app/views/poll/_poll_form.html.erb +++ b/app/views/poll/_poll_form.html.erb @@ -59,7 +59,7 @@ { $('#ajax-modal').html('<%= escape_javascript(render :partial => 'poll_submit', locals: { :poll => @poll,:is_remote => false}) %>'); showModal('ajax-modal', '310px'); - $('#ajax-modal').css('height','110px'); + $('#ajax-modal').css('height','115px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before("" + ""); diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css index e601d231d..863ee5864 100644 --- a/public/stylesheets/polls.css +++ b/public/stylesheets/polls.css @@ -14,9 +14,9 @@ div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margi #polls .fr{ float:right;} /*问卷按钮*/ -.polls_btn{ height:33px;border-top:1px solid #15bed1; border-bottom:1px solid #15bed1;border-right:1px solid #cee6e6; width:225px; padding:7px 0 0 15px; } -.polls_btn a{font-size:14px; color:#444444;font-weight:bold;} -.polls_btn span{ color:#15bed1; font-size:12px; font-weight:normal;} +/*.polls_btn{ height:33px;border-top:1px solid #15bed1; border-bottom:1px solid #15bed1;border-right:1px solid #cee6e6; width:225px; padding:7px 0 0 15px; }*/ +/*.polls_btn a{font-size:14px; color:#444444;font-weight:bold;}*/ +/*.polls_btn span{ color:#15bed1; font-size:12px; font-weight:normal;}*/ /*问卷列表*/ .polls_content{ width:615px;padding-left: 6px;} From 81f5a5e624b547eb301382ae2204e98a8fdb256f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 23 Jan 2015 09:28:01 +0800 Subject: [PATCH 149/169] =?UTF-8?q?#1854=E5=AD=A6=E7=94=9F=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E6=9F=A5=E7=9C=8B=E5=B7=B2=E6=8F=90=E4=BA=A4=E8=BF=87?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E5=8D=B7=E6=97=B6=EF=BC=8C=E5=A4=9A=E8=A1=8C?= =?UTF-8?q?=E4=B8=BB=E8=A7=82=E9=A2=98=E4=B8=AD=E6=98=BE=E7=A4=BA=E6=9C=89?= =?UTF-8?q?html=E5=85=83=E7=B4=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_show_mulit_result.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/poll/_show_mulit_result.html.erb b/app/views/poll/_show_mulit_result.html.erb index e54cca505..786ed9460 100644 --- a/app/views/poll/_show_mulit_result.html.erb +++ b/app/views/poll/_show_mulit_result.html.erb @@ -13,7 +13,7 @@

      - <%= get_anwser_vote_text poll_question.id,User.current.id%> + <%= get_anwser_vote_text(poll_question.id,User.current.id).html_safe%>

      From 249b08392d548cf97c999b7f4615173a2319a17c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 23 Jan 2015 09:31:30 +0800 Subject: [PATCH 150/169] =?UTF-8?q?#1856=20=E4=BF=AE=E6=94=B9=E9=97=AE?= =?UTF-8?q?=E5=8D=B7=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=EF=BC=8C=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E9=97=AE=E5=8D=B7=E3=80=81=E5=8F=96=E6=B6=88=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E5=90=8E=E5=BC=B9=E5=87=BA=E7=95=8C=E9=9D=A2=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/index.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb index de30b5deb..a8aca1308 100644 --- a/app/views/poll/index.html.erb +++ b/app/views/poll/index.html.erb @@ -15,7 +15,7 @@ "
      " + "
    "); showModal('ajax-modal', '310px'); - $('#ajax-modal').css('height','110px'); + $('#ajax-modal').css('height','115px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before("" + ""); @@ -41,7 +41,7 @@ "
    " + "
    "); showModal('ajax-modal', '310px'); - $('#ajax-modal').css('height','110px'); + $('#ajax-modal').css('height','115px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before("" + ""); From f74f2e3be77198c2ae6f8fc09219390db3dce8c6 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 23 Jan 2015 09:34:15 +0800 Subject: [PATCH 151/169] =?UTF-8?q?exec=E6=8C=89=E9=92=AE=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/nyan.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/stylesheets/nyan.css b/public/stylesheets/nyan.css index c532e7112..ac7142c71 100644 --- a/public/stylesheets/nyan.css +++ b/public/stylesheets/nyan.css @@ -1433,8 +1433,8 @@ ul.contest-notification-list li span{ } .xls { - background: url('../images/icon_excel.gif') no-repeat scroll 1px 50% transparent; - padding: 2px 0px 3px 16px; + /*background: url('../images/icon_excel.gif') no-repeat scroll 1px 50% transparent;*/ + /*padding: 2px 0px 3px 16px;*/ font-family:微软雅黑 !important; font-size: 12px !important; color: #136b3b !important; From ae31d0b8610177c32bcce657742f5f1a064ea88b Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 23 Jan 2015 09:42:08 +0800 Subject: [PATCH 152/169] =?UTF-8?q?#1851=E8=AF=BE=E7=A8=8B=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E5=A2=9E=E5=8A=A0=E7=8A=B6=E6=80=81=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/_bid_homework_show.html.erb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index 49325c0d4..1009f405f 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -56,12 +56,21 @@ <%= link_to(bid.name, course_for_bid_path(bid), :class => 'bid_path') %> - + <% if User.current.logged? && is_cur_course_student(@course) %> <% cur_user_homework = cur_user_homework_for_bid(bid) %> - 匿评中.. + <% if bid.open_anonymous_evaluation == 1 %> + <% case bid.comment_status %> + <% when 0 %> + 未开启匿评 + <% when 1 %> +   匿评中..   + <% when 2 %> +   匿评结束   + <% end %> + <% end%> <% if cur_user_homework && cur_user_homework.empty? %> From c6deffe245aceaf9ef69b932e384756bba578f18 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 23 Jan 2015 09:47:13 +0800 Subject: [PATCH 153/169] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_feedback.html.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb index ae85d9479..748029ee2 100644 --- a/app/views/layouts/_base_feedback.html.erb +++ b/app/views/layouts/_base_feedback.html.erb @@ -24,7 +24,7 @@ html{ overflow-x:hidden;} .msgserver { margin:10px 0 4px 4px;} .msgserver a { background:url(/images/sidebar_bg.png) no-repeat -119px -115px; padding-left:22px;} .opnionText{ width:120px; height:180px; border-color:#cecece; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; color:#999; padding:3px;} -a.opnionButton{ display:block; color:#fd6e2a; font-weight: bold; margin:-25px auto 0; text-align:center;} +a.opnionButton{ display:block; font-weight: bold; margin:-25px auto 0; text-align:center;} a:hover.opnionButton{ text-decoration:underline;} @@ -154,13 +154,13 @@ function f_submit() <%= f.text_area :subject, :class => "opnionText",:placeholder => "有什么想说的,尽管来咆哮吧~~"%> <%= f.hidden_field :content, :required => true ,:value=>'该贴来自用户反馈!'%> <%#= f.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %> - 提  交 + 提  交 <% end %>
    From 3911450787ea8d6115f75d1dc277a0d835a9c855 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 23 Jan 2015 09:51:36 +0800 Subject: [PATCH 154/169] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E8=B0=83=E6=9F=A5?= =?UTF-8?q?=E7=AE=80=E7=AD=94=E9=A2=98=E8=BE=93=E5=85=A5=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E8=BF=87=E5=A4=9A=E6=98=BE=E7=A4=BA=E8=B6=85=E8=BE=B9=E6=A1=86?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/schema.rb | 12 ++++++++++++ public/stylesheets/polls.css | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/db/schema.rb b/db/schema.rb index 7d10abc35..d0d755bd3 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -23,6 +23,18 @@ ActiveRecord::Schema.define(:version => 20150121030451) do add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type" add_index "activities", ["user_id"], :name => "index_activities_on_user_id" + create_table "api_keys", :force => true do |t| + t.string "access_token" + t.datetime "expires_at" + t.integer "user_id" + t.boolean "active", :default => true + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" + add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" + create_table "applied_projects", :force => true do |t| t.integer "project_id", :null => false t.integer "user_id", :null => false diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css index e601d231d..3870db84c 100644 --- a/public/stylesheets/polls.css +++ b/public/stylesheets/polls.css @@ -53,7 +53,7 @@ ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;} .ur_inputs label{ padding-left:10px;word-break: break-all; word-wrap: break-word;} .ur_inputs input{ margin-right:5px;} .ur_text{ height:30px;} -.ur_textbox{ border:1px solid #dcdcdc !important; color:#676765;} +.ur_textbox{ border:1px solid #dcdcdc !important; color:#676765; word-break:break-all; word-wrap:break-word;} .ur_buttons{ width:250px; margin:20px auto 10px;} a.ur_button{ display:block; width:106px; height:37px; background:#15bccf; color:#fff; font-size:16px; text-align:center; padding-top:3px; float:left; margin-right:15px;} a:hover.ur_button{ background:#0fa9bb; text-decoration:none;} From 24a8f4fe7d7c5c0b9e4798a5baf255bbbc217e12 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Fri, 23 Jan 2015 10:03:00 +0800 Subject: [PATCH 155/169] Signed-off-by: alan <547533434@qq.com> --- app/controllers/courses_controller.rb | 1 + app/models/course_group.rb | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index edd3f1b9d..dcd09959d 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -273,6 +273,7 @@ class CoursesController < ApplicationController if valid_attr.eql?('name') faker.name = valid_value + # faker.course_id = @course.id faker.valid? req[:valid] = faker.errors[:name].blank? req[:message] = faker.errors[:name] diff --git a/app/models/course_group.rb b/app/models/course_group.rb index 144c43c6e..c1236da93 100644 --- a/app/models/course_group.rb +++ b/app/models/course_group.rb @@ -12,11 +12,20 @@ class CourseGroup < ActiveRecord::Base before_destroy :set_member_nil attr_accessible :name - validates :name, :presence => true, :length => {:maximum => 20}, - :uniqueness => {case_sensitive: false} + validates :name, :presence => true, :length => {:maximum => 20} + validate_on_create :unique_name_and_course + + + def set_member_nil if self.members && self.members.count > 0 self.members.update_all("course_group_id = 0") end end + private + def unique_name_and_course + if CourseGroup.find(:conditions => ["name=? and course_id=?", name, course_id]).first + errors.add_to_base("该班名已被使用!") + end + end end From bb64dc945247ff29b03e1a117cc8d7a5b386f4e2 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 23 Jan 2015 10:19:23 +0800 Subject: [PATCH 156/169] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=97=AE=E5=8D=B7?= =?UTF-8?q?=E8=B0=83=E6=9F=A5=E6=8C=89=E9=92=AE=E7=9A=84=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_courses.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 466e711c2..06626c155 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -305,7 +305,7 @@ .polls_btn a{font-size:14px; color:#444444;font-weight:bold;} .polls_btn span{ color:#15bed1; font-size:12px; font-weight:normal;} .polls_btn a{ float:left;} - .polls_n{float: left;background: #ff5d31;color: #fff;width: 12px;padding-left: 2px;height: 7px;padding-bottom: 5px;padding-top: 3px;margin-top: -4px;margin-left: 3px; } + .polls_n{float: left;background: #ff5d31;color: #fff;width: 32px;padding-left: 2px;height: 7px;padding-bottom: 5px;padding-top: 3px;margin-top: -4px;margin-left: 3px; } .polls_n p{ margin-top:-4px;} .cl{ clear:both; overflow:hidden; } @@ -313,7 +313,7 @@ <%= link_to l(:label_poll), poll_index_path(:polls_type => "Course", :polls_group_id => @course.id)%>
    -

    N

    +

    NEW

    From fdba8ca9868d25674bcd109d4b66b0784ba05539 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Fri, 23 Jan 2015 11:46:55 +0800 Subject: [PATCH 157/169] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E9=82=AE?= =?UTF-8?q?=E7=AE=B1=E5=9C=B0=E5=9D=80=E7=9C=9F=E5=AE=9E=E6=80=A7=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E3=80=8B=E3=80=8A=E8=AF=BE=E7=A8=8B=E5=88=86=E7=8F=AD?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E9=87=8D=E5=90=8D=E5=87=BA=E9=94=99=E3=80=8B?= =?UTF-8?q?=E3=80=8A=E7=95=99=E8=A8=80=E6=A8=A1=E5=9D=97=E5=8F=91=E9=80=81?= =?UTF-8?q?=E9=82=AE=E4=BB=B6=E6=A8=A1=E6=9D=BF=E5=8A=9F=E8=83=BD=E3=80=8B?= =?UTF-8?q?=20Signed-off-by:=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- Gemfile | 2 +- app/controllers/courses_controller.rb | 2 +- app/models/course_group.rb | 6 +-- app/models/user.rb | 2 +- app/views/courses/member.html.erb | 3 +- app/views/mailer/_issue.html.erb | 2 +- app/views/mailer/_issue.text.erb | 2 +- .../mailer/journals_for_message_add.html.erb | 4 +- app/views/mailer/message_posted.html.erb | 47 +++++++++++++++---- config/configuration.yml | 8 ++-- config/locales/zh.yml | 3 +- 12 files changed, 58 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index 0cd336786..944ad4ef2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /.bundle *.swp /config/database.yml +/config/configuration.yml /files/* /log/* /tmp/* @@ -14,5 +15,4 @@ /db/schema.rb /Gemfile.lock /lib/plugins/acts_as_versioned/test/debug.log -/config/configuration.yml .rbenv-gemsets diff --git a/Gemfile b/Gemfile index 5045cb822..dc834e68d 100644 --- a/Gemfile +++ b/Gemfile @@ -18,7 +18,7 @@ gem "builder", "3.0.0" gem 'acts-as-taggable-on', '2.4.1' gem 'spreadsheet' gem 'ruby-ole' -gem 'email_verifier' +#gem 'email_verifier' group :development do gem 'better_errors', path: 'lib/better_errors' diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index dcd09959d..b5e0362b3 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -273,7 +273,7 @@ class CoursesController < ApplicationController if valid_attr.eql?('name') faker.name = valid_value - # faker.course_id = @course.id + faker.course_id = params[:course_id] faker.valid? req[:valid] = faker.errors[:name].blank? req[:message] = faker.errors[:name] diff --git a/app/models/course_group.rb b/app/models/course_group.rb index c1236da93..c7fc81df4 100644 --- a/app/models/course_group.rb +++ b/app/models/course_group.rb @@ -13,7 +13,7 @@ class CourseGroup < ActiveRecord::Base attr_accessible :name validates :name, :presence => true, :length => {:maximum => 20} - validate_on_create :unique_name_and_course + validate :unique_name_and_course @@ -24,8 +24,8 @@ class CourseGroup < ActiveRecord::Base end private def unique_name_and_course - if CourseGroup.find(:conditions => ["name=? and course_id=?", name, course_id]).first - errors.add_to_base("该班名已被使用!") + if CourseGroup.where("name=? and course_id=?", name, course_id).first + errors.add(:name, :groupname_repeat) end end end diff --git a/app/models/user.rb b/app/models/user.rb index bef65fe54..06f59c764 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -188,7 +188,7 @@ class User < Principal validates_confirmation_of :password, :allow_nil => true validates_inclusion_of :mail_notification, :in => MAIL_NOTIFICATION_OPTIONS.collect(&:first), :allow_blank => true validate :validate_password_length - validates_email_realness_of :mail + #validates_email_realness_of :mail before_create :set_mail_notification before_save :update_hashed_password before_destroy :remove_references_before_destroy diff --git a/app/views/courses/member.html.erb b/app/views/courses/member.html.erb index 803be3731..e2c1fb418 100644 --- a/app/views/courses/member.html.erb +++ b/app/views/courses/member.html.erb @@ -6,7 +6,8 @@ $.get( '<%=valid_ajax_course_path%>', { valid: "name", - value: document.getElementById('group_name').value }, + value: document.getElementById('group_name').value, + course_id: <%= @course.id %> }, function (data) { if (!data.valid) { alert(data.message); diff --git a/app/views/mailer/_issue.html.erb b/app/views/mailer/_issue.html.erb index cd5fbc091..0ec585868 100644 --- a/app/views/mailer/_issue.html.erb +++ b/app/views/mailer/_issue.html.erb @@ -1,7 +1,7 @@

    - <%= link_to(h("#{@issue.author}(#{@issue.author.show_name})"), @issue_author_url , :style=>'color:#1b55a7; font-weight:bold;') %> + <%= link_to(h("#{@author.login}(#{@author.show_name})"), @issue_author_url , :style=>'color:#1b55a7; font-weight:bold;') %> <%= l(:mail_issue_title_userin)%> <%= link_to(h("#{@issue.project.name}"), @project_url, :style=>'color:#1b55a7; font-weight:bold;') %><%= l(:mail_issue_title_active)%>

    diff --git a/app/views/mailer/_issue.text.erb b/app/views/mailer/_issue.text.erb index 8848e494a..e0579824f 100644 --- a/app/views/mailer/_issue.text.erb +++ b/app/views/mailer/_issue.text.erb @@ -1,5 +1,5 @@ - <%= link_to(h("#{@issue.author}(#{@issue.author.show_name})"), @issue_author_url) %> + <%= link_to(h("#{@author.login}(#{@author.show_name})"), @issue_author_url) %> <%= l(:mail_issue_title_userin)%> <%= link_to(h("#{@issue.project.name}"),@project_url) %><%= l(:mail_issue_title_active)%> <%= l(:mail_issue_subject)%><%= link_to(issue.subject, issue_url) %> diff --git a/app/views/mailer/journals_for_message_add.html.erb b/app/views/mailer/journals_for_message_add.html.erb index 1aa8e45f8..f39b49026 100644 --- a/app/views/mailer/journals_for_message_add.html.erb +++ b/app/views/mailer/journals_for_message_add.html.erb @@ -1,5 +1,5 @@ 尊敬的用户,<%= @user %>给你留言了:
    <%= @message %>
    -

    点击链接查看最新回复<%= link_to(@url, @url) %>

    -         

    <%= link_to(l(:lable_not_receive_mail),"http://" + Setting.host_name + "/my/account")%>

    +

    点击链接查看最新回复<%= link_to(@url, @url) %> +         <%= link_to(l(:lable_not_receive_mail),"http://" + Setting.host_name + "/my/account")%>

    diff --git a/app/views/mailer/message_posted.html.erb b/app/views/mailer/message_posted.html.erb index 4bb487405..e031c2e98 100644 --- a/app/views/mailer/message_posted.html.erb +++ b/app/views/mailer/message_posted.html.erb @@ -1,10 +1,41 @@ -

    - <% if @message.project %> - <%=h @message.board.project.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url) %> + + + + + +

    + + <%= h @message.author %>(<%= @message.author.show_name %>) + <%= l(:mail_issue_title_userin)%> + + <% if @message.project %> + <%=h @message.board.project.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url,:style=>'color:#1b55a7; font-weight:bold;') %> <% elsif @message.course %> - <%=h @message.board.course.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url) %> - <% end %> -

    -<%=h @message.author %> + <%=h @message.board.course.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url,:style=>'color:#1b55a7; font-weight:bold;') %> + <% end %> + <%= l(:mail_issue_title_active)%>

    +
    +
      +
    • <%= l(:mail_issue_subject)%> <%= link_to(h(@message.subject), @message_url, :style=>'color:#1b55a7; font-weight:bold;') %>
    • +
    • <%= l(:mail_issue_sent_from)%> + <% if @message.project %> + <%=h @message.board.project.name %> - <%=h @message.board.name %> + <% elsif @message.course %> + <%=h @message.board.course.name %> - <%=h @message.board.name %> + <% end %> +
    • +
    • <%= l(:mail_issue_content)%> + + <%= @message.content %> + +
    • + +
    +
    + +
    +
    + -<%= textilizable(@message, :content, :only_path => false) %> diff --git a/config/configuration.yml b/config/configuration.yml index 9a9373e45..f17881485 100644 --- a/config/configuration.yml +++ b/config/configuration.yml @@ -87,12 +87,12 @@ default: - address: smtp.163.com + address: smtp.126.com port: 25 - domain: smtp.163.com + domain: smtp.126.com authentication: :plain - user_name: mcb592@163.com - password: 'mcb1989822' + user_name: "alanlong9278@126.com" + password: 'alanlong8788786' # Absolute path to the directory where attachments are stored. # The default is the 'files' directory in your Redmine instance. diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 77a5b4a1b..0f7d67cb8 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -152,7 +152,7 @@ zh: not_same_project: "不属于同一个项目" circular_dependency: "此关联将导致循环依赖" cant_link_an_issue_with_a_descendant: "问题不能关联到它的子任务" - + groupname_repeat: "该班名已存在" actionview_instancetag_blank_option: 请选择 @@ -598,6 +598,7 @@ zh: label_document_added: 文档已添加 label_forum_message_added: 发帖成功 label_forum_add: 贴吧创建成功 + label_message_reply: 回帖人 label_document_public_info: (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该文档。) label_role: 角色 label_role_plural: 角色 From b20204fedd1846b1609b185fb96e1f3dd85abbb0 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Fri, 23 Jan 2015 13:42:25 +0800 Subject: [PATCH 158/169] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E9=82=AE?= =?UTF-8?q?=E4=BB=B6=E9=87=8D=E5=8F=91=E4=B8=80=E6=A0=B7=E5=BC=95=E5=8F=91?= =?UTF-8?q?=E7=9A=84bug=E3=80=8B=20Signed-off-by:=20alan=20<547533434@qq.c?= =?UTF-8?q?om>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/issue_observer.rb | 3 ++- app/models/journal_observer.rb | 3 ++- app/models/mailer.rb | 16 +++++----------- app/views/mailer/message_posted.html.erb | 4 ---- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/app/models/issue_observer.rb b/app/models/issue_observer.rb index 50cbf2a42..e404a4a1c 100644 --- a/app/models/issue_observer.rb +++ b/app/models/issue_observer.rb @@ -19,7 +19,8 @@ class IssueObserver < ActiveRecord::Observer def after_create(issue) Thread.start do - recipients = issue.recipients + # 将跟踪者与本项目的其他成员都设为收件方,并去重,不在进行抄送, + recipients = issue.recipients - issue.watcher_recipients + issue.watcher_recipients recipients.each do |rec| Mailer.issue_add(issue,rec).deliver if Setting.notified_events.include?('issue_added') end diff --git a/app/models/journal_observer.rb b/app/models/journal_observer.rb index 10d3f7b4b..b58464a9b 100644 --- a/app/models/journal_observer.rb +++ b/app/models/journal_observer.rb @@ -24,7 +24,8 @@ class JournalObserver < ActiveRecord::Observer (Setting.notified_events.include?('issue_priority_updated') && journal.new_value_for('priority_id').present?) ) Thread.start do - recipients = journal.recipients + # 将跟踪者与本项目的其他成员都设为收件方,并去重,不在进行抄送, + recipients = journal.recipients - journal.watcher_recipients + journal.watcher_recipients recipients.each do |rec| Mailer.issue_edit(journal,rec).deliver diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 23ac36054..1760d9004 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -147,13 +147,11 @@ class Mailer < ActionMailer::Base @project_url = url_for(:controller => 'projects', :action => 'show', :id => issue.project_id, :token => @token.value) @user_url = url_for(my_account_url(user,:token => @token.value)) - cc = nil - if recipients == issue.recipients[0] - cc = issue.watcher_recipients - issue.recipients - end + + subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] (#{issue.status.name}) #{issue.subject}" mail(:to => recipients, - :cc => cc, + :subject => subject) end # issue.attachments.each do |attach| @@ -198,11 +196,7 @@ class Mailer < ActionMailer::Base - # Watchers in cc - cc = nil - if recipients == journal.recipients[0] - cc = journal.watcher_recipients - journal.recipients - end + s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] " s << "(#{issue.status.name}) " if journal.new_value_for('status_id') @@ -211,7 +205,7 @@ class Mailer < ActionMailer::Base @journal = journal # @issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue, :anchor => "change-#{journal.id}") mail(:to => recipients, - :cc => cc, + :subject => s) end diff --git a/app/views/mailer/message_posted.html.erb b/app/views/mailer/message_posted.html.erb index e031c2e98..1fe28e04f 100644 --- a/app/views/mailer/message_posted.html.erb +++ b/app/views/mailer/message_posted.html.erb @@ -1,8 +1,4 @@ - - - -

    <%= h @message.author %>(<%= @message.author.show_name %>) From 15a8bddfe6e70ea5e3eba2bbd763b222cf0d97e9 Mon Sep 17 00:00:00 2001 From: whimlex Date: Fri, 23 Jan 2015 14:02:00 +0800 Subject: [PATCH 159/169] =?UTF-8?q?=E7=BC=BA=E5=A4=B1=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/en.yml | 79 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 72 insertions(+), 7 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index a7d98a21c..755157245 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -345,7 +345,7 @@ en: field_identity_url: OpenID URL field_content: Content field_group_by: Group results by - field_sharing: Sharing + field_sharing: Sharinglable_hot_course field_parent_issue: Parent task field_member_of_group: "Assignee's group" field_assigned_to_role: "Assignee's role" @@ -536,6 +536,70 @@ en: project_module_boards: Forums project_module_calendar: Calendar project_module_gantt: Gantt + + #edit by meng + lable_hot_course: Hot projects + lable_hot_projects: Active courses + lable_user_active: User movements + lable_bar_active: Bar posts + label_project_score: Score + label_course_join_student: Join a course + label_join_project: Join a project + label_contest_modify_settings: Configuration + bale_news_notice: Add a notification + label_field_correct: correct input + label_work_description_lengthlimit: less than 500 characters + label_create_new_projects: Create a project + label_work_scores_people: The total number of users given scores + label_project_new_description: A project can be used to do anything that requires distributed collaboration + label_project_grade: Score + label_user_for_project_grade: Score + label_relation_files: Select an existing resource + + label_my_brief_introduction: How are feeling today? Leave your footprints ~ + label_submit: Submit + + label_tags_course_name: Course Title + label_new_course_password: Password + label_new_course_description: Description + field_open_student: Student list is public ? + label_course_board: Forum + label_course_open_student_info: (Tick as "open list of students," if not open, the external person couldn't see the list of students) + label_teacher_list: Teacher list + label_student_list: Student list + label_export_excel: Export list + + label_course_organizers: Institute + label_poll: Questionnaire + + field_open_anonymous_evaluation: Use anonymous mutual-evaluation + field_evaluation_num: Number of anonymous works sent to each student + + label_edit_homework: Update homework + label_homework_list: Work list + + label_teacher_score: Teacher's score + label_time: Commit time + label_student_score: Student's score + label_without_score: No evaluated + label_homework_description: Description + label_responses: Messages + + lable_has_commit_homework: You have submitted your work + + + label_user_create_project_homework: created the task + label_commit_limit: Expired but can submit your work + + label_current_group: Current group + + project_module_dts: DTS Test tool + label_module_share: DTS Test tool + field_dts_test: DTS Test tool + + label_technical_support: Support : + label_feedback: Feedback + #end label_user: User label_user_plural: Users @@ -618,7 +682,7 @@ en: label_home: Home label_my_page: My page label_my_account: My account - label_my_message: My messages + label_my_message: Msgs label_my_projects: My projects label_my_page_block: My page block label_administration: Administration @@ -1249,6 +1313,7 @@ en: #fq button_leave_meassge: Submit + button_clear_meassge: Reset label_leave_message_to: leave %{name} a message label_leave_message: Message content label_message: message board @@ -1350,9 +1415,9 @@ en: label_leave_others_message: leave message to him/her label_leave_a_message: Leave him/her a message: label_leave_your_message: Leave a message to you - label_new_activities: ' has new activity in' # modified by bai - label_new_activity: ' has new activity in' - label_i_new_activity: ' have new activity in' + label_new_activities: ' has a new activity in' # modified by bai + label_new_activity: ' has a new activity in' + label_i_new_activity: ' have a new activity in' label_create_project: had participated in label_praise: praise label_cancel_praise: cancel praise @@ -1631,7 +1696,7 @@ en: label_bids_form_contest_new_description: Enterprise or college can release a contest here. label_contest_name: Input the name of the contest label_contest_description: Content:description your contest - label_main_teacher: Main teacher + label_main_teacher: Lecturer label_main_term: Term label_teacher_work_unit: Position label_course_overview: Status @@ -1698,7 +1763,7 @@ en: label_reply_empty: Reply Cann't Empty. label_setup_time: Start date label_endup_time: Over date - label_class_period: Class hour + label_class_period: Lessons label_class_hour: period label_activity_time: publish date From 6645648027be82145ed7a0db50cdd1121f6e0d93 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 23 Jan 2015 14:10:38 +0800 Subject: [PATCH 160/169] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E7=9C=8B=E5=88=B0=E9=97=AE=E5=8D=B7=E7=BB=93=E6=9E=9C=E8=80=81?= =?UTF-8?q?=E5=B8=88=E5=8F=AF=E9=85=8D=E7=BD=AE=E5=A2=9E=E5=8A=A0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 1 + db/migrate/20150123020615_add_show_result.rb | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 db/migrate/20150123020615_add_show_result.rb diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 4abddaa5e..0ee17222e 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -47,6 +47,7 @@ class PollController < ApplicationController :user_id => User.current.id, :published_at => Time.now, :closed_at => Time.now, + :show_result => 1, :polls_description => "" } @poll = Poll.create option diff --git a/db/migrate/20150123020615_add_show_result.rb b/db/migrate/20150123020615_add_show_result.rb new file mode 100644 index 000000000..0407abceb --- /dev/null +++ b/db/migrate/20150123020615_add_show_result.rb @@ -0,0 +1,9 @@ +class AddShowResult < ActiveRecord::Migration + def up + add_column :polls, :show_result, :integer, default: 1 + end + + def down + remove_column :polls, :show_result + end +end From 2be757a3d581b548b6c51eb0cd1c644531688a25 Mon Sep 17 00:00:00 2001 From: whimlex Date: Fri, 23 Jan 2015 14:19:43 +0800 Subject: [PATCH 161/169] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=BC=BA=E5=A4=B1?= =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 755157245..036410a25 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -562,7 +562,7 @@ en: label_tags_course_name: Course Title label_new_course_password: Password label_new_course_description: Description - field_open_student: Student list is public ? + field_open_student: Student list is public? label_course_board: Forum label_course_open_student_info: (Tick as "open list of students," if not open, the external person couldn't see the list of students) label_teacher_list: Teacher list From dbdae2ac7e5d3c4eb654bf684a94a68a5722af82 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 23 Jan 2015 14:25:29 +0800 Subject: [PATCH 162/169] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=9C=A8=E5=8F=91=E5=B8=83=E9=97=AE=E5=8D=B7?= =?UTF-8?q?=E5=92=8C=E7=82=B9=E5=87=BB=E9=97=AE=E5=8D=B7=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E5=A2=9E=E5=8A=A0=E9=97=AE=E5=8D=B7=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E4=B8=8D=E8=83=BD=E4=B8=BA=E7=A9=BA=E7=9A=84=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 4 ++-- app/views/poll/_edit_head.html.erb | 2 +- app/views/poll/_poll_form.html.erb | 29 ++++++++++++++++++++--------- app/views/poll/_show_head.html.erb | 2 +- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 0ee17222e..8926c0be6 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -70,8 +70,8 @@ class PollController < ApplicationController end def update - @poll.polls_name = params[:polls_name].empty? ? l(:label_poll_title) : params[:polls_name] - @poll.polls_description = params[:polls_description].empty? ? l(:label_poll_description) : params[:polls_description] + @poll.polls_name = params[:polls_name] + @poll.polls_description = params[:polls_description] if @poll.save respond_to do |format| format.js diff --git a/app/views/poll/_edit_head.html.erb b/app/views/poll/_edit_head.html.erb index 802832601..ed90a5ef8 100644 --- a/app/views/poll/_edit_head.html.erb +++ b/app/views/poll/_edit_head.html.erb @@ -7,7 +7,7 @@

    diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb index df4859613..1d0dee837 100644 --- a/app/views/poll/_poll_form.html.erb +++ b/app/views/poll/_poll_form.html.erb @@ -25,6 +25,10 @@ } //问卷头 function pollsCancel(){$("#polls_head_edit").hide();$("#polls_head_show").show();} + function pollsSubmit(doc){ + var title = $.trim($("#polls_title").val()); + if(title.length == 0){alert("问卷标题不能为空");}else{doc.parent().parent().parent().submit();} + } function pollsEdit(){$("#polls_head_edit").show();$("#polls_head_show").hide();} // function pollQuestionCancel(question_id){ @@ -57,15 +61,22 @@ function poll_submit() { - $('#ajax-modal').html('<%= escape_javascript(render :partial => 'poll_submit', locals: { :poll => @poll,:is_remote => false}) %>'); - showModal('ajax-modal', '310px'); - $('#ajax-modal').css('height','115px'); - $('#ajax-modal').siblings().remove(); - $('#ajax-modal').before("" + - ""); - $('#ajax-modal').parent().removeClass("alert_praise"); - $('#ajax-modal').parent().css("top","").css("left",""); - $('#ajax-modal').parent().addClass("popbox_polls"); + var title = $.trim($("#polls_name_h").html()); + if(title.length == 0) + { + alert("问卷标题不能为空"); + } + else{ + $('#ajax-modal').html('<%= escape_javascript(render :partial => 'poll_submit', locals: { :poll => @poll,:is_remote => false}) %>'); + showModal('ajax-modal', '310px'); + $('#ajax-modal').css('height','115px'); + $('#ajax-modal').siblings().remove(); + $('#ajax-modal').before("" + + ""); + $('#ajax-modal').parent().removeClass("alert_praise"); + $('#ajax-modal').parent().css("top","").css("left",""); + $('#ajax-modal').parent().addClass("popbox_polls"); + } } diff --git a/app/views/poll/_show_head.html.erb b/app/views/poll/_show_head.html.erb index 7ab16b24d..ce74dc10a 100644 --- a/app/views/poll/_show_head.html.erb +++ b/app/views/poll/_show_head.html.erb @@ -1,7 +1,7 @@

    - <%= poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name%> + <%= poll.polls_name%>

    <%= @poll.polls_description%> From 900cff8f8e51c9b585e7afc5327b198526dd185f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 23 Jan 2015 14:43:40 +0800 Subject: [PATCH 163/169] =?UTF-8?q?1=E3=80=81=E9=97=AE=E5=8D=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E7=95=8C=E9=9D=A2=E5=8F=91=E5=B8=83=E9=97=AE=E5=8D=B7?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=A2=9E=E5=8A=A0=E9=97=AE=E5=8D=B7=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E4=B8=8D=E8=83=BD=E4=B8=BA=E7=A9=BA=E7=9A=84=E5=88=A4?= =?UTF-8?q?=E6=96=AD=202=E3=80=81=E5=8E=BB=E6=8E=89=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E6=8F=92=E4=BB=B6=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_poll.html.erb | 2 +- app/views/poll/index.html.erb | 41 ++++++++++++++++++++--------------- config/application.rb | 6 ++--- db/schema.rb | 19 ++++------------ 4 files changed, 32 insertions(+), 36 deletions(-) diff --git a/app/views/poll/_poll.html.erb b/app/views/poll/_poll.html.erb index c53f09361..1bf6b3716 100644 --- a/app/views/poll/_poll.html.erb +++ b/app/views/poll/_poll.html.erb @@ -34,7 +34,7 @@

  • <%if @is_teacher %> <% if poll.polls_status == 1 %> - 发布问卷 + 发布问卷 <% elsif poll.polls_status == 2%> 取消发布 <% end%> diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb index a8aca1308..3962768da 100644 --- a/app/views/poll/index.html.erb +++ b/app/views/poll/index.html.erb @@ -26,28 +26,35 @@ function clickCanel(){hideModal("#popbox02");} - function poll_submit(poll_id) + function poll_submit(poll_id,poll_name) { - $('#ajax-modal').html("
    " + - "
    " + - "
    " + + if(poll_name == 0) + { + alert("问卷标题不能为空"); + } + else + { + $('#ajax-modal').html("
    " + + "
    " + + "
    " + "

    问卷发布后将不能对问卷进行修改,
    是否确定发布该问卷?

    " + "
    " + - "确  定" + - "取  消" + + "确  定" + + "取  消" + "
    " + "
    " + - "
    " + - "
    " + - "
    "); - showModal('ajax-modal', '310px'); - $('#ajax-modal').css('height','115px'); - $('#ajax-modal').siblings().remove(); - $('#ajax-modal').before("" + - ""); - $('#ajax-modal').parent().removeClass("alert_praise"); - $('#ajax-modal').parent().css("top","").css("left",""); - $('#ajax-modal').parent().addClass("popbox_polls"); + "
    " + + "
    " + + "
    "); + showModal('ajax-modal', '310px'); + $('#ajax-modal').css('height','115px'); + $('#ajax-modal').siblings().remove(); + $('#ajax-modal').before("" + + ""); + $('#ajax-modal').parent().removeClass("alert_praise"); + $('#ajax-modal').parent().css("top","").css("left",""); + $('#ajax-modal').parent().addClass("popbox_polls"); + } }
    diff --git a/config/application.rb b/config/application.rb index 2f1534d00..7e47cc64e 100644 --- a/config/application.rb +++ b/config/application.rb @@ -17,9 +17,9 @@ module RedmineApp # -- all .rb files in that directory are automatically loaded. # verifier if email is real - EmailVerifier.config do |config| - config.verifier_email = "lizanle521@126.com" - end + #EmailVerifier.config do |config| + # config.verifier_email = "lizanle521@126.com" + #end config.generators do |g| g.test_framework :rspec, diff --git a/db/schema.rb b/db/schema.rb index d0d755bd3..20c74ba1e 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 => 20150121030451) do +ActiveRecord::Schema.define(:version => 20150123020615) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -23,18 +23,6 @@ ActiveRecord::Schema.define(:version => 20150121030451) do add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type" add_index "activities", ["user_id"], :name => "index_activities_on_user_id" - create_table "api_keys", :force => true do |t| - t.string "access_token" - t.datetime "expires_at" - t.integer "user_id" - t.boolean "active", :default => true - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" - add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" - create_table "applied_projects", :force => true do |t| t.integer "project_id", :null => false t.integer "user_id", :null => false @@ -844,9 +832,10 @@ ActiveRecord::Schema.define(:version => 20150121030451) do t.integer "user_id" t.datetime "published_at" t.datetime "closed_at" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.text "polls_description" + t.integer "show_result", :default => 1 end create_table "praise_tread_caches", :force => true do |t| From 61634585f5c59f37510a75688c8c81d9b7aca495 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Fri, 23 Jan 2015 14:51:11 +0800 Subject: [PATCH 164/169] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8Anews?= =?UTF-8?q?=EF=BC=8Cforum=E6=A8=A1=E5=9D=97=E5=8F=91=E9=80=81=E9=82=AE?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E6=A8=A1=E6=9D=BF=E3=80=8B=20Signed-off-by:?= =?UTF-8?q?=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/mailer.rb | 14 +++++- app/views/mailer/forum_add.html.erb | 31 +++++++++++-- app/views/mailer/forum_message_added.html.erb | 34 +++++++++++++-- .../mailer/journals_for_message_add.html.erb | 28 ++++++++++-- app/views/mailer/message_posted.html.erb | 5 ++- app/views/mailer/news_added.html.erb | 43 +++++++++++++++++-- app/views/mailer/news_comment_added.html.erb | 41 ++++++++++++++++-- config/application.rb | 6 +-- 8 files changed, 179 insertions(+), 23 deletions(-) diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 1760d9004..f42c20acc 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -36,7 +36,7 @@ class Mailer < ActionMailer::Base @author = forum.creator recipients = forum.creator.mail # cc = wiki_content.page.wiki.watcher_recipients - recipients - + @issue_author_url = url_for(user_activities_url(@author)) @forum_url = url_for(:controller => 'forums', :action => 'show', :id => forum.id) mail :to => recipients,:subject => "[ #{l(:label_forum)} : #{forum.name} #{l(:notice_successful_create)}]" @@ -47,6 +47,8 @@ class Mailer < ActionMailer::Base redmine_headers 'Memo' => memo.id @forum = memo.forum @author = memo.author + @forum_url = url_for(:controller => 'forums', :action => 'show', :id => @forum.id) + @issue_author_url = url_for(user_activities_url(@author)) recipients ||= [] mems = memo.self_and_siblings mems.each do |mem| @@ -69,7 +71,7 @@ class Mailer < ActionMailer::Base @mail = journals_for_message.at_user if journals_for_message.at_user @message = journals_for_message.notes @title = "#@user #{t(:label_leave_your_message, :locale => 'zh')}" - + @issue_author_url = url_for(user_activities_url(@user)) @url = case journals_for_message.jour.class.to_s.to_sym # 判断留言的对象所属类型 when :Bid course_for_bid_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}") @@ -289,6 +291,7 @@ class Mailer < ActionMailer::Base redmine_headers 'Project' => document.project.identifier @author = User.current @document = document + @issue_author_url = url_for(user_activities_url(@author)) @document_url = url_for(:controller => 'documents', :action => 'show', :id => document) mail :to => document.recipients, :subject => "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}" @@ -304,6 +307,7 @@ class Mailer < ActionMailer::Base added_to = '' added_to_url = '' @author = attachments.first.author + @issue_author_url = url_for(user_activities_url(@author)) case container.class.name when 'Project' added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container) @@ -356,6 +360,7 @@ class Mailer < ActionMailer::Base if news.project redmine_headers 'Project' => news.project.identifier @author = news.author + @issue_author_url = url_for(user_activities_url(@author)) message_id news @news = news @news_url = url_for(:controller => 'news', :action => 'show', :id => news) @@ -364,6 +369,7 @@ class Mailer < ActionMailer::Base elsif news.course redmine_headers 'Course' => news.course.id @author = news.author + @issue_author_url = url_for(user_activities_url(@author)) message_id news @news = news recipients = news.course.notified_users.select { |user| user.allowed_to?(:view_files, news.course) }.collect { |u| u.mail } @@ -383,6 +389,7 @@ class Mailer < ActionMailer::Base if news.project redmine_headers 'Project' => news.project.identifier @author = comment.author + @issue_author_url = url_for(user_activities_url(@author)) message_id comment @news = news @comment = comment @@ -393,6 +400,7 @@ class Mailer < ActionMailer::Base elsif news.course redmine_headers 'Course' => news.course.id @author = comment.author + @issue_author_url = url_for(user_activities_url(@author)) message_id comment @news = news @comment = comment @@ -414,6 +422,7 @@ class Mailer < ActionMailer::Base redmine_headers 'Project' => message.project.identifier, 'Topic-Id' => (message.parent_id || message.id) @author = message.author + @issue_author_url = url_for(user_activities_url(@author)) message_id message references message.parent unless message.parent.nil? recipients = message.recipients @@ -427,6 +436,7 @@ class Mailer < ActionMailer::Base redmine_headers 'Course' => message.course.id, 'Topic-Id' => (message.parent_id || message.id) @author = message.author + @issue_author_url = url_for(user_activities_url(@author)) message_id message references message.parent unless message.parent.nil? recipients = message.course.notified_users.select { |user| user.allowed_to?(:view_files, message.course) }.collect { |u| u.mail } diff --git a/app/views/mailer/forum_add.html.erb b/app/views/mailer/forum_add.html.erb index 8da8b7891..7e26fd0df 100644 --- a/app/views/mailer/forum_add.html.erb +++ b/app/views/mailer/forum_add.html.erb @@ -1,4 +1,29 @@ -

    <%= link_to(h(@forum.name), @forum_url) %>

    -<%=h @forum.creator.name %> -<%= @forum.description.html_safe %> \ No newline at end of file +

    + + <%= link_to(h("#{@forum.creator.login}(#{@forum.creator.show_name})"), @issue_author_url , :style=>'color:#1b55a7; font-weight:bold;') %> + + <%= l(:label_forum_new)%> + <%= link_to(h(@forum.name), @forum_url,:style=>'color:#1b55a7; font-weight:bold;') %> +

    +
    +
      +
    • <%= l(:mail_issue_subject)%> + <%= link_to(h(@forum.name), @forum_url,:style=>'color:#1b55a7; font-weight:bold;') %>
    • + +
    • <%= l(:mail_issue_content)%> + + <%= @forum.description.html_safe %> + +
    • + +
    +
    + +
    +
    + + + diff --git a/app/views/mailer/forum_message_added.html.erb b/app/views/mailer/forum_message_added.html.erb index 743c06ae7..58657d46b 100644 --- a/app/views/mailer/forum_message_added.html.erb +++ b/app/views/mailer/forum_message_added.html.erb @@ -1,4 +1,32 @@ -

    <%= link_to(h(@memo.subject), @memo_url) %>

    -<%=h @memo.author.name %> -<%= @memo.content.html_safe %> \ No newline at end of file +

    + + <%= link_to(h("#{@author.login}(#{@author.show_name})"), @issue_author_url , :style=>'color:#1b55a7; font-weight:bold;') %> + <%= l(:mail_issue_title_userin)%> + + <%= link_to(h(@forum.name), @forum_url,:style=>'color:#1b55a7; font-weight:bold;') %> + + <%= l(:mail_issue_title_active)%>

    +
    +
      +
    • <%= l(:mail_issue_subject)%> + <%= link_to(h(@memo.subject), @memo_url,:style=>'color:#1b55a7; font-weight:bold;') %>
    • +
    • <%= l(:mail_issue_sent_from)%> + <%= link_to(h(@forum.name), @forum_url,:style=>'color:#1b55a7; font-weight:bold;') %> +
    • +
    • <%= l(:mail_issue_content)%> + + <%= @memo.content.html_safe %> + +
    • + +
    +
    + +
    +
    + + + diff --git a/app/views/mailer/journals_for_message_add.html.erb b/app/views/mailer/journals_for_message_add.html.erb index f39b49026..cfb288d9d 100644 --- a/app/views/mailer/journals_for_message_add.html.erb +++ b/app/views/mailer/journals_for_message_add.html.erb @@ -1,5 +1,25 @@ -尊敬的用户,<%= @user %>给你留言了: -
    <%= @message %>
    -

    点击链接查看最新回复<%= link_to(@url, @url) %> -         <%= link_to(l(:lable_not_receive_mail),"http://" + Setting.host_name + "/my/account")%>

    + +

    + + + <%= link_to(h("#{@user.login}(#{@user.show_name})"), @issue_author_url , :style=>'color:#1b55a7; font-weight:bold;') %> + 给你留言了 +

    +
    +
      + +
    • <%= l(:mail_issue_content)%> + + <%= @message %> + +
    • + +
    +
    + +
    +
    + diff --git a/app/views/mailer/message_posted.html.erb b/app/views/mailer/message_posted.html.erb index 1fe28e04f..dbe41976a 100644 --- a/app/views/mailer/message_posted.html.erb +++ b/app/views/mailer/message_posted.html.erb @@ -1,7 +1,8 @@

    - <%= h @message.author %>(<%= @message.author.show_name %>) + <%= link_to(h("#{@message.author.login}(#{@message.author.show_name})"), @issue_author_url , :style=>'color:#1b55a7; font-weight:bold;') %> + <%= l(:mail_issue_title_userin)%> <% if @message.project %> @@ -29,7 +30,7 @@

    diff --git a/app/views/mailer/news_added.html.erb b/app/views/mailer/news_added.html.erb index 758ebccb8..ca8f3c1b0 100644 --- a/app/views/mailer/news_added.html.erb +++ b/app/views/mailer/news_added.html.erb @@ -1,4 +1,41 @@ -

    <%= link_to(h(@news.title), @news_url) %>

    -<%=h @news.author.name %> -<%= textilizable(@news, :description, :only_path => false) %> +

    + + + <%= link_to(h("#{@news.author.login}(#{@news.author.show_name})"), @issue_author_url , :style=>'color:#1b55a7; font-weight:bold;') %> + + <%= l(:mail_issue_title_userin)%> + + <% if @news.project %> + <%=h @news.project.name %> : <%= link_to(h(@news.title), @news_url,:style=>'color:#1b55a7; font-weight:bold;') %> + <% elsif @news.course %> + <%=h @news.course.name %> : <%= link_to(h(@news.title), @news_url,:style=>'color:#1b55a7; font-weight:bold;') %> + <% end %> + <%= l(:mail_issue_title_active)%>

    +
    +
      +
    • <%= l(:mail_issue_subject)%> + <%= link_to(h(@news.title), @news_url,:style=>'color:#1b55a7; font-weight:bold;') %>
    • +
    • <%= l(:mail_issue_sent_from)%> + <% if @news.project %> + <%=h @news.project.name %> + <% elsif @news.course %> + <%=h @news.course.name %> + <% end %> +
    • +
    • <%= l(:mail_issue_content)%> + + <%= @news.description %> + +
    • + +
    +
    + +
    +
    + + + diff --git a/app/views/mailer/news_comment_added.html.erb b/app/views/mailer/news_comment_added.html.erb index ef2be0f65..5ac95a571 100644 --- a/app/views/mailer/news_comment_added.html.erb +++ b/app/views/mailer/news_comment_added.html.erb @@ -1,5 +1,40 @@ -

    <%= link_to(h(@news.title), @news_url) %>

    -

    <%= l(:text_user_wrote, :value => h(@comment.author)) %>

    +

    + + <%= link_to(h("#{@comment.author.login}(#{@comment.author.show_name})"), @issue_author_url , :style=>'color:#1b55a7; font-weight:bold;') %> + + <%= l(:mail_issue_title_userin)%> + + <% if @news.project %> + <%=h @news.project.name %> : <%= link_to(h(@news.title), @news_url,:style=>'color:#1b55a7; font-weight:bold;') %> + <% elsif @news.course %> + <%=h @news.course.name %> : <%= link_to(h(@news.title), @news_url,:style=>'color:#1b55a7; font-weight:bold;') %> + <% end %> + <%= l(:mail_issue_title_active)%>

    +
    +
      +
    • <%= l(:mail_issue_subject)%> + <%= link_to(h(@news.title), @news_url,:style=>'color:#1b55a7; font-weight:bold;') %>
    • +
    • <%= l(:mail_issue_sent_from)%> + <% if @news.project %> + <%=h @news.project.name %> + <% elsif @news.course %> + <%=h @news.course.name %> + <% end %> +
    • +
    • <%= l(:mail_issue_content)%> + + <%= @news.description %> + +
    • + +
    +
    + +
    +
    + + -<%= textilizable @comment, :comments, :only_path => false %> diff --git a/config/application.rb b/config/application.rb index 2f1534d00..311bf457b 100644 --- a/config/application.rb +++ b/config/application.rb @@ -17,9 +17,9 @@ module RedmineApp # -- all .rb files in that directory are automatically loaded. # verifier if email is real - EmailVerifier.config do |config| - config.verifier_email = "lizanle521@126.com" - end + # EmailVerifier.config do |config| + # config.verifier_email = "lizanle521@126.com" + # end config.generators do |g| g.test_framework :rspec, From 38157e560eb1524f584e4f3b01199a7883b19551 Mon Sep 17 00:00:00 2001 From: whimlex Date: Fri, 23 Jan 2015 15:08:34 +0800 Subject: [PATCH 165/169] =?UTF-8?q?=E8=AF=BE=E7=A8=8B--=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=BA=93--=E4=B8=8A=E4=BC=A0=E8=B5=84=E6=BA=90=EF=BC=9A?= =?UTF-8?q?=E5=BD=93=E5=8F=98=E5=8C=96=E5=B1=8F=E5=B9=95=E5=88=86=E8=BE=A8?= =?UTF-8?q?=E7=8E=87=E6=97=B6=EF=BC=8C=E2=80=9C=E4=B8=8A=E4=BC=A0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E2=80=9D=E5=AD=97=E6=A0=B7=E6=98=BE=E7=A4=BA=E5=BC=82?= =?UTF-8?q?=E5=B8=B8;=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7=E6=88=96?= =?UTF-8?q?=E7=BB=84=E6=B2=A1=E6=9C=89=E9=93=BE=E6=8E=A5;=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E8=AF=BE=E7=A8=8B=E4=B8=AD=EF=BC=8C=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4=E6=88=90?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E9=A3=8E=E6=A0=BC;=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E4=B8=BB=E9=A1=B5=EF=BC=8C=E7=AB=9E=E8=B5=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 2 +- app/views/courses/_course_form.html.erb | 6 +++--- app/views/courses/new.html.erb | 2 +- app/views/files/_attachement_list.html.erb | 2 +- app/views/files/_upload_show.html.erb | 10 +++++----- app/views/welcome/_search_course.html.erb | 2 +- app/views/welcome/_search_project.html.erb | 2 +- config/locales/en.yml | 6 +++++- config/locales/zh.yml | 6 +++++- 9 files changed, 23 insertions(+), 15 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7efa02503..caf29ba90 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -494,7 +494,7 @@ module ApplicationHelper def principals_check_box_tags_ex(name, principals) s = '' principals.each do |principal| - s << "\n" + s << "\n" end s.html_safe end diff --git a/app/views/courses/_course_form.html.erb b/app/views/courses/_course_form.html.erb index d293f9ed1..d54741295 100644 --- a/app/views/courses/_course_form.html.erb +++ b/app/views/courses/_course_form.html.erb @@ -29,7 +29,7 @@ <%= l(:label_tags_course_name) %> *   - +

    <%= f.fields_for @course do |m| %> @@ -38,7 +38,7 @@
    - + <%= l(:label_class_period) %> *   @@ -118,7 +118,7 @@

    - + <%= l(:text_command) %> <% end %> diff --git a/app/views/courses/new.html.erb b/app/views/courses/new.html.erb index 77f041322..b9422ba64 100644 --- a/app/views/courses/new.html.erb +++ b/app/views/courses/new.html.erb @@ -6,7 +6,7 @@ <%= labelled_form_for @course do |f| %>
    <%= render :partial => 'course_form', :locals => { :f => f } %> - + <%= submit_tag l(:button_create), :class => "enterprise"%> diff --git a/app/views/files/_attachement_list.html.erb b/app/views/files/_attachement_list.html.erb index f65ba8d41..85739f7c3 100644 --- a/app/views/files/_attachement_list.html.erb +++ b/app/views/files/_attachement_list.html.erb @@ -22,7 +22,7 @@
    - + <%= file_field_tag 'attachments[dummy][file]', :id => '_file', :class => 'file_selector', diff --git a/app/views/files/_upload_show.html.erb b/app/views/files/_upload_show.html.erb index 13bcd043e..65a662f10 100644 --- a/app/views/files/_upload_show.html.erb +++ b/app/views/files/_upload_show.html.erb @@ -1,15 +1,15 @@
    -

    上传资源

    +

    <%= l(:label_upload_files)%>

    <%= error_messages_for 'attachment' %> - + <%= form_tag(course_files_path(course), :multipart => true,:remote => true,:method => :post,:name=>"upload_form") do %> - + <%= render :partial => 'attachement_list',:locals => {:course => course} %>
    - 确  认 - 取  消 + <%= l(:button_confirm)%> + <%= l(:button_cancel)%> <% end %>
    diff --git a/app/views/welcome/_search_course.html.erb b/app/views/welcome/_search_course.html.erb index c3bbd46d8..895f696fb 100644 --- a/app/views/welcome/_search_course.html.erb +++ b/app/views/welcome/_search_course.html.erb @@ -47,7 +47,7 @@ form #search_type{ <%#完了把上面东西放到 .css 里%> <%= form_tag({controller: :welcome, action: :search }, method: :get) do %> -