From 80e3e44f1364e09b3212cb02f633c4f33440ecb4 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 17 Nov 2014 15:01:48 +0800 Subject: [PATCH 01/33] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E9=80=80=E5=87=BA=E7=A7=81=E6=9C=89=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/watchers_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index 298331c69..6d916f43e 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -97,7 +97,7 @@ module WatchersHelper return '' unless user && user.logged? # modify by nwb # 主讲教师不允许退出课程 - return '' if user.id == course.tea_id || course.is_public == 0 + return '' if user.id == course.tea_id joined = user.member_of_course?(course) text = joined ? l(:label_exit_course) : l(:label_new_join) url_t = join_path(:object_id => course.id) From 3aaf2247dc32aedbd14bb90e8f7cce7a4fa6d64c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 18 Nov 2014 10:29:00 +0800 Subject: [PATCH 02/33] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7=E6=82=AC=E6=B5=AE=E6=A1=86css=E3=80=81js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_course_ad.html.erb | 96 +++++---------------------- public/stylesheets/application.css | 3 +- 2 files changed, 20 insertions(+), 79 deletions(-) diff --git a/app/views/courses/_course_ad.html.erb b/app/views/courses/_course_ad.html.erb index 10a6d7eaf..8318bb5d1 100644 --- a/app/views/courses/_course_ad.html.erb +++ b/app/views/courses/_course_ad.html.erb @@ -1,6 +1,6 @@
- +
From 6bfbf5bd2bee976219c57d9eb1f369ad2baeaa40 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 18 Nov 2014 16:13:11 +0800 Subject: [PATCH 07/33] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E5=8C=BF=E8=AF=84?= =?UTF-8?q?=E9=98=B6=E6=AE=B5=E8=AF=BE=E7=A8=8B=E4=BD=9C=E4=B8=9A=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E7=95=8C=E9=9D=A2=E4=B8=8D=E5=8F=AF=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=202.=E5=A2=9E=E5=8A=A0=E5=8C=BF=E8=AF=84?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E9=98=B6=E6=AE=B5=E5=8F=AF=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/_bid_homework_show.html.erb | 8 +++++++- app/views/homework_attach/_homeworks_list.html.erb | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index 166a4b224..cd9b7b037 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -45,7 +45,13 @@ <% if User.current.logged? && is_cur_course_student(@course) %> <% cur_user_homework = cur_user_homework_for_bid(bid) %> <% if cur_user_homework!= nil && cur_user_homework.empty? %> - <%= link_to l(:label_commit_homework),new_exercise_book_path(bid) %> + <% if bid.comment_status == 0 || bid.comment_status == 2%> + <%= link_to l(:label_commit_homework),new_exercise_book_path(bid) %> + <% else %> + + <%= l(:label_commit_homework)%> + + <% end %> <% else %> <%= l(:lable_has_commit_homework)%> diff --git a/app/views/homework_attach/_homeworks_list.html.erb b/app/views/homework_attach/_homeworks_list.html.erb index c778588f7..c40004d02 100644 --- a/app/views/homework_attach/_homeworks_list.html.erb +++ b/app/views/homework_attach/_homeworks_list.html.erb @@ -35,13 +35,13 @@
  • 您还没交作业,请创建作业!
  • - <% if @bid.comment_status == 0 %> + <% if @bid.comment_status == 0 || @bid.comment_status == 1%>
  • <%= link_to "提交作业", new_exercise_book_path(@bid), :style => "width:80px; margin:20px 0 0 350px;" %>
  • <% else %> -
  • +
  • 提交作业
  • <% end %> From 6245b6ba33a2651b9ec5e5bc745eef38afa8ea38 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 18 Nov 2014 16:47:04 +0800 Subject: [PATCH 08/33] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E3=80=81=E5=90=AF=E5=8A=A8=E5=8C=BF=E8=AF=84=E3=80=81=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E5=8C=BF=E8=AF=84=E3=80=81=E6=8F=90=E4=BA=A4=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/_bid_homework_show.html.erb | 32 +++++++++++++++++----- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index cd9b7b037..cc8159821 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -17,6 +17,21 @@ +second+" "); } + <% if bids.blank? %> <%#= l(:label_uncommit_homework) %> @@ -46,10 +61,12 @@ <% cur_user_homework = cur_user_homework_for_bid(bid) %> <% if cur_user_homework!= nil && cur_user_homework.empty? %> <% if bid.comment_status == 0 || bid.comment_status == 2%> - <%= link_to l(:label_commit_homework),new_exercise_book_path(bid) %> + + <%= link_to l(:label_commit_homework),new_exercise_book_path(bid) %> + <% else %> - - <%= l(:label_commit_homework)%> + + 提交作业 <% end %> <% else %> @@ -59,7 +76,7 @@ <% end %> <% end %> <% if (User.current.admin?||User.current.id==bid.author_id) %> - + <% case bid.comment_status %> <% when 0 %> <%= link_to '启动匿评', alert_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, disable_with: '加载中...' %> @@ -69,11 +86,12 @@ 匿评结束 <% end %> - <%= link_to( + + <%= link_to( l(:button_edit), - {:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id}, - :class => 'icon icon-edit' + {:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id} ) %> + <%#= link_to( l(:button_delete), {:action => 'homework_destroy', :controller=>'bids', :course_id => bid.id}, From 861dbc854e08f7d1b090b5c05349edbf918065ac Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 18 Nov 2014 16:51:19 +0800 Subject: [PATCH 09/33] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E4=B8=BB=E9=A1=B5=E8=AF=BE=E7=A8=8B=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/show.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 7d13e404e..28994fe29 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -107,7 +107,7 @@ <%= l(:label_i_new_activity) %> - <%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %> + <%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), course_for_bid_path(e.act_id) %> <% else %> <% end %> <% else %> From 126c7f558d9717647ed6bffe7b3bad4a07aed089 Mon Sep 17 00:00:00 2001 From: zhuhao Date: Tue, 18 Nov 2014 17:03:40 +0800 Subject: [PATCH 10/33] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=A4=84=E6=8E=A7=E4=BB=B6=E5=AF=B9=E9=BD=90?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=BB=BA=E8=AF=BE=E7=A8=8B=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=8F=96=E6=B6=88=E6=8C=89=E9=92=AE=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/news/_course_news.html.erb | 4 ++-- public/stylesheets/application.css | 2 +- public/stylesheets/nyan.css | 24 ++++++++++++++++++++---- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/app/views/news/_course_news.html.erb b/app/views/news/_course_news.html.erb index f66def486..346fff8b4 100644 --- a/app/views/news/_course_news.html.erb +++ b/app/views/news/_course_news.html.erb @@ -74,10 +74,10 @@ <%= labelled_form_for @news, :url => course_news_index_path(@course), :html => {:id => 'news-form', :multipart => true} do |f| %> <%= render :partial => 'news/course_form', :locals => {:f => f, :is_new => true} %> - <%= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'whiteButton m3p10' %> + <%= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'ButtonColor m3p10' %> <%#= preview_link preview_news_path, 'news-form', target='preview', {:class => 'whiteButton m3p10'} %> - <%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()', :class => 'whiteButton m3p10' %> + <%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()', :class => 'ButtonColor m3p10' %> <% end if @course %>
    diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index d0d71c50d..710a404dc 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -1898,7 +1898,7 @@ input#time_entry_comments { width: 90%;} fieldset.settings label { display: block; } fieldset#notified_events .parent { padding-left: 20px; } -span.required {color: #bb0000;} +span.required {color: #bb0000;margin-right: 4px;} .summary {font-style: italic;} #attachments_fields input.description {margin-left:4px; width:100px; } diff --git a/public/stylesheets/nyan.css b/public/stylesheets/nyan.css index def79d53b..27e8a367e 100644 --- a/public/stylesheets/nyan.css +++ b/public/stylesheets/nyan.css @@ -15,7 +15,7 @@ span[id^=valid_user] { } .red { - color: red; + color: red;margin-left: 10px;margin-right: 10px;text-align: right; } .green { @@ -474,6 +474,19 @@ body { position: relative; top: 1px; } +input[class~='ButtonClolr'],.ButtonColor{ + color: #fffbff !important; + padding-bottom: 5px; + width: 40px; + height: 20px; + font-family: '微软雅黑',Arial,Helvetica,sans-serif; + font-size: 15px; + + padding: 0px; + background: #15bccf; + border: 1px solid #15bccf; + +} input[class~='whiteButton'], .whiteButton { -moz-box-shadow: inset 0px 1px 0px 0px #ffffff; @@ -493,9 +506,9 @@ input[class~='whiteButton'], .whiteButton { border: 1px solid #dcdcdc; display: inline-block; color: #666666; - color: #116699; + color: #fffbff; font-family: arial; - font-size: 15px; + font-size: 20px; font-weight: bold; padding: 6px 24px; /*padding:3px 10px;*/ @@ -513,13 +526,14 @@ input[class~='whiteButton']:hover, .whiteButton:hover { background: linear-gradient(to bottom, #f6f6f6 5%, #ffffff 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#f6f6f6', endColorstr = '#ffffff', GradientType = 0); text-decoration: none; - background-color: #f6f6f6; + background-color: #09bbff; } input[class~='whiteButton']:active, .whiteButton:active { position: relative; top: 1px; text-decoration: none; + color: #ffffff; } input[class~='m3p10'], .m3p10 { @@ -527,6 +541,8 @@ input[class~='m3p10'], .m3p10 { padding: 3px 10px; height: 20px; display: inline-block; + text-align: center; + color: #ffffff; } input[class~='h30'], .h30 { From 91cb6e29d5336587ffaa92cce315df23ab35bc9b Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 19 Nov 2014 10:34:36 +0800 Subject: [PATCH 11/33] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=98=AF=E5=90=A6=E5=BC=80=E5=90=AF=E5=8C=BF=E8=AF=84?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=20=E6=96=B0=E5=BB=BA=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=98=AF=E5=A2=9E=E5=8A=A0=E6=98=AF=E5=90=A6=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E5=8C=BF=E8=AF=84=E5=8A=9F=E8=83=BD=E4=BB=A5=E5=8F=8A=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E9=A1=B5=E9=9D=A2=E6=95=88=E6=9E=9C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E7=9B=B8=E5=85=B3js=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/bids_controller.rb | 2 + app/controllers/courses_controller.rb | 1 + app/views/bids/_homework_form.html.erb | 4 ++ app/views/bids/edit.html.erb | 61 ++++++++++++++----- app/views/courses/_homework_form.html.erb | 4 ++ app/views/courses/new_homework.html.erb | 50 ++++++++++----- config/locales/zh.yml | 1 + ...119011439_add_open_anonymous_evaluation.rb | 9 +++ db/schema.rb | 15 ++--- 9 files changed, 110 insertions(+), 37 deletions(-) create mode 100644 db/migrate/20141119011439_add_open_anonymous_evaluation.rb diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index 145a73178..c8ce6ec31 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -807,6 +807,7 @@ class BidsController < ApplicationController @bid.is_evaluation = params[:bid][:is_evaluation] @bid.proportion = params[:bid][:proportion] @bid.evaluation_num = params[:bid][:evaluation_num] + @bid.open_anonymous_evaluation = params[:bid][:open_anonymous_evaluation] @bid.reward_type = 3 # @bid.budget = params[:bid][:budget] @bid.deadline = params[:bid][:deadline] @@ -863,6 +864,7 @@ class BidsController < ApplicationController @bid.is_evaluation = params[:bid][:is_evaluation] @bid.proportion = params[:bid][:proportion] @bid.evaluation_num = params[:bid][:evaluation_num] + @bid.open_anonymous_evaluation = params[:bid][:open_anonymous_evaluation] @bid.reward_type = 3 @bid.deadline = params[:bid][:deadline] @bid.budget = 0 diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 5381e8757..edfc893d8 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -511,6 +511,7 @@ class CoursesController < ApplicationController def new_homework @homework = Bid.new @homework.safe_attributes = params[:bid] + @homework.open_anonymous_evaluation = 1 if (User.current.logged? && User.current.member_of_course?(Course.find params[:id] )) render :layout => 'base_courses' else diff --git a/app/views/bids/_homework_form.html.erb b/app/views/bids/_homework_form.html.erb index 448e4144a..cd682deb0 100644 --- a/app/views/bids/_homework_form.html.erb +++ b/app/views/bids/_homework_form.html.erb @@ -44,6 +44,10 @@ <%= f.select :proportion, proportion_option %>

    + <%= f.check_box :open_anonymous_evaluation, :style => "margin-left:10px;" %> + 未开启匿评作业将直接进入众评点赞阶段 +

    +

    <%= f.text_field :evaluation_num, :required => true, :size => 60, :style => "width:150px;", :onblur => "regexEvaluationNum();" , :maxlength => 4%> 匿评分配数量不宜太大,否则会影响开启匿评速度

    diff --git a/app/views/bids/edit.html.erb b/app/views/bids/edit.html.erb index 322b8cdc3..0a2d17e7d 100644 --- a/app/views/bids/edit.html.erb +++ b/app/views/bids/edit.html.erb @@ -43,35 +43,66 @@ { var evaluation_num = $.trim($("#bid_evaluation_num").val()); var regex = /^\d+$/; - if(evaluation_num=="") + if($("#bid_open_anonymous_evaluation").attr("checked") == "checked") { - $("#bid_evaluation_num_span").text("匿评分配数量不能为空"); - $("#bid_evaluation_num_span").css('color','#ff0000'); - return false; - } - else if(regex.test(evaluation_num)) - { - if(evaluation_num > 0) + if(evaluation_num=="") { - $("#bid_evaluation_num_span").text("填写正确"); - $("#bid_evaluation_num_span").css('color','#008000'); - return true; + $("#bid_evaluation_num_span").text("匿评分配数量不能为空"); + $("#bid_evaluation_num_span").css('color','#ff0000'); + return false; + } + else if(regex.test(evaluation_num)) + { + if(evaluation_num > 0) + { + $("#bid_evaluation_num_span").text("填写正确"); + $("#bid_evaluation_num_span").css('color','#008000'); + return true; + } + else + { + $("#bid_evaluation_num_span").text("匿评分配数量必须为大于0"); + $("#bid_evaluation_num_span").css('color','#ff0000'); + return false; + } } else { - $("#bid_evaluation_num_span").text("匿评分配数量必须为大于0"); + $("#bid_evaluation_num_span").text("匿评分配数量只能为数字"); $("#bid_evaluation_num_span").css('color','#ff0000'); return false; } } else { - $("#bid_evaluation_num_span").text("匿评分配数量只能为数字"); - $("#bid_evaluation_num_span").css('color','#ff0000'); - return false; + return true; } } + $(function(){ + $("#bid_open_anonymous_evaluation").click(function(){ + if($("#bid_open_anonymous_evaluation").attr("checked") == "checked") + { + $("#evaluation_num_p").slideDown(); + } + else + { + $("#evaluation_num_p").slideUp(); + } + }); + }); + + $(function(){ + if($("#bid_open_anonymous_evaluation").attr("checked") == "checked") + { + $("#evaluation_num_p").show(); + } + else + { + $("#evaluation_num_p").hide(); + } + }); + function submitHomework(id) { if(regexDeadLine()&®exName()&®exEvaluationNum()) diff --git a/app/views/courses/_homework_form.html.erb b/app/views/courses/_homework_form.html.erb index 9d5ad1155..8ce6be3fe 100644 --- a/app/views/courses/_homework_form.html.erb +++ b/app/views/courses/_homework_form.html.erb @@ -49,6 +49,10 @@ <%= f.select :proportion, proportion_option %>

    + <%= f.check_box :open_anonymous_evaluation, :style => "margin-left:10px;" %> + 未开启匿评作业将直接进入众评点赞阶段 +

    +

    <%= f.text_field :evaluation_num, :required => true, :size => 60, :style => "width:150px;", :onblur => "regexEvaluationNum();" , :maxlength => 4%> 匿评分配数量不宜太大,否则会影响开启匿评速度

    diff --git a/app/views/courses/new_homework.html.erb b/app/views/courses/new_homework.html.erb index 753aa20c8..7b6784243 100644 --- a/app/views/courses/new_homework.html.erb +++ b/app/views/courses/new_homework.html.erb @@ -43,35 +43,55 @@ { var evaluation_num = $.trim($("#bid_evaluation_num").val()); var regex = /^\d+$/; - if(evaluation_num=="") + if($("#bid_open_anonymous_evaluation").attr("checked") == "checked") { - $("#bid_evaluation_num_span").text("匿评分配数量不能为空"); - $("#bid_evaluation_num_span").css('color','#ff0000'); - return false; - } - else if(regex.test(evaluation_num)) - { - if(evaluation_num > 0) + if(evaluation_num=="") { - $("#bid_evaluation_num_span").text("填写正确"); - $("#bid_evaluation_num_span").css('color','#008000'); - return true; + $("#bid_evaluation_num_span").text("匿评分配数量不能为空"); + $("#bid_evaluation_num_span").css('color','#ff0000'); + return false; + } + else if(regex.test(evaluation_num)) + { + if(evaluation_num > 0) + { + $("#bid_evaluation_num_span").text("填写正确"); + $("#bid_evaluation_num_span").css('color','#008000'); + return true; + } + else + { + $("#bid_evaluation_num_span").text("匿评分配数量必须为大于0"); + $("#bid_evaluation_num_span").css('color','#ff0000'); + return false; + } } else { - $("#bid_evaluation_num_span").text("匿评分配数量必须为大于0"); + $("#bid_evaluation_num_span").text("匿评分配数量只能为数字"); $("#bid_evaluation_num_span").css('color','#ff0000'); return false; } } else { - $("#bid_evaluation_num_span").text("匿评分配数量只能为数字"); - $("#bid_evaluation_num_span").css('color','#ff0000'); - return false; + return true; } } + $(function(){ + $("#bid_open_anonymous_evaluation").click(function(){ + if($("#bid_open_anonymous_evaluation").attr("checked") == "checked") + { + $("#evaluation_num_p").slideDown(); + } + else + { + $("#evaluation_num_p").slideUp(); + } + }); + }); + function submitHomework() { if(regexDeadLine()&®exName()&®exEvaluationNum()) diff --git a/config/locales/zh.yml b/config/locales/zh.yml index a3807dca3..591c1144b 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2198,3 +2198,4 @@ zh: label_submit_comments: 提交评论 field_evaluation_num: 匿评分配数量 label_my_score: 我的评分 + field_open_anonymous_evaluation: 是否开启匿评 diff --git a/db/migrate/20141119011439_add_open_anonymous_evaluation.rb b/db/migrate/20141119011439_add_open_anonymous_evaluation.rb new file mode 100644 index 000000000..cea7143c4 --- /dev/null +++ b/db/migrate/20141119011439_add_open_anonymous_evaluation.rb @@ -0,0 +1,9 @@ +class AddOpenAnonymousEvaluation < ActiveRecord::Migration + def up + add_column :bids, :open_anonymous_evaluation, :integer, default: 1 + end + + def down + remove_column :bids, :open_anonymous_evaluation + end +end diff --git a/db/schema.rb b/db/schema.rb index f6fc138af..2e664eaa7 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 => 20141105012624) do +ActiveRecord::Schema.define(:version => 20141119011439) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -95,21 +95,22 @@ ActiveRecord::Schema.define(:version => 20141105012624) do create_table "bids", :force => true do |t| t.string "name" - t.string "budget", :null => false + t.string "budget", :null => false t.integer "author_id" t.date "deadline" t.text "description" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false t.integer "commit" t.integer "reward_type" t.integer "homework_type" t.integer "parent_id" t.string "password" t.integer "is_evaluation" - t.integer "proportion", :default => 60 - t.integer "comment_status", :default => 0 - t.integer "evaluation_num", :default => 3 + t.integer "proportion", :default => 60 + t.integer "comment_status", :default => 0 + t.integer "evaluation_num", :default => 3 + t.integer "open_anonymous_evaluation", :default => 1 end create_table "boards", :force => true do |t| From ff185852ebb1ebb800e4abca789a991fabf83606 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 19 Nov 2014 10:53:22 +0800 Subject: [PATCH 12/33] =?UTF-8?q?=E6=9C=AA=E5=BC=80=E5=90=AF=E5=8C=BF?= =?UTF-8?q?=E8=AF=84=E6=97=B6=E8=80=81=E5=B8=88=E7=95=8C=E9=9D=A2=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E5=BC=80=E5=90=AF/=E5=85=B3=E9=97=AD=E5=8C=BF?= =?UTF-8?q?=E8=AF=84=E6=8C=89=E9=92=AE=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 | 4 +++- app/views/layouts/base_homework.html.erb | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index cc8159821..971b2e3eb 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -76,7 +76,8 @@ <% end %> <% end %> <% if (User.current.admin?||User.current.id==bid.author_id) %> - + <% if bid.open_anonymous_evaluation == 1%> + <% case bid.comment_status %> <% when 0 %> <%= link_to '启动匿评', alert_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, disable_with: '加载中...' %> @@ -86,6 +87,7 @@ 匿评结束 <% end %> + <%end%> <%= link_to( l(:button_edit), diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb index 6a1db48d5..bea708537 100644 --- a/app/views/layouts/base_homework.html.erb +++ b/app/views/layouts/base_homework.html.erb @@ -106,6 +106,7 @@ <% if (User.current.admin?||User.current.id==@bid.author_id) %>
    <% end %> From f560e9f494c2c0b733d4cfddfdda74b77bb6458b Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 19 Nov 2014 11:11:28 +0800 Subject: [PATCH 13/33] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E6=9C=AA=E5=BC=80?= =?UTF-8?q?=E5=90=AF=E5=8C=BF=E8=AF=84=E5=AD=A6=E7=94=9F=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=8C=BF=E8=AF=84=E5=88=97=E8=A1=A8=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=98=BE=E7=A4=BA=202.=E4=BF=AE=E6=94=B9=E6=9C=AA?= =?UTF-8?q?=E5=BC=80=E5=90=AF=E5=8C=BF=E8=AF=84=E5=AD=A6=E7=94=9F=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E8=BF=9B=E5=85=A5=E4=BC=97=E8=AF=84=E7=82=B9=E8=B5=9E?= =?UTF-8?q?=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/_homework.html.erb | 4 ++-- app/views/bids/_homework_list.html.erb | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/views/bids/_homework.html.erb b/app/views/bids/_homework.html.erb index 078ca8000..7cde4f31d 100644 --- a/app/views/bids/_homework.html.erb +++ b/app/views/bids/_homework.html.erb @@ -43,9 +43,9 @@ <% end %> <% unless @is_teacher%> - <% if @bid.comment_status == 0%> + <% if @bid.comment_status == 0 && @bid.open_anonymous_evaluation == 1%> $("#my_homework").click(); - <% elsif @bid.comment_status == 2%> + <% elsif @bid.comment_status == 2 || @bid.open_anonymous_evaluation == 0%> $("#all_homeworks").click(); <% end %> <% end %> diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index acbcbc2fa..036289b0a 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -28,14 +28,17 @@ <% else %> <% end %> diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css index e54cd3af5..2eb401dfd 100644 --- a/public/stylesheets/css.css +++ b/public/stylesheets/css.css @@ -69,7 +69,7 @@ a.wzan_visited{background:url(images/pic_zan.png) 0 0 no-repeat;} /****评分弹框****/ -.alert_box {width:488px;height:550px;position:absolute;z-index:1002;left:50%;top:40%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; padding:5px; overflow:auto; } +.alert_box {width:488px;height:550px;position:fixed;z-index:1002;left:50%;top:40%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; padding:5px; overflow:auto; } .alert .close{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-502px;background:url(images/close.png) no-repeat;cursor:pointer;} .alert .C{width:476px;height:296px;position:absolute;left:5px;top:5px; } @@ -143,7 +143,7 @@ a:hover.tijiao{ background:#0f99a9 !important;} .N_search{ height:20px !important; border:1px solid #999 !important;} /* 匿名评分弹框 */ -.alert_praise{width:480px;height:200px;position:absolute;z-index:100;left:50%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;} +.alert_praise{width:480px;height:200px;position:fixed;z-index:100;left:50%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;} .alert .close02{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-490px;background:url(images/close.png) no-repeat;cursor:pointer;} .ni_con { width:425px; margin:25px 30px;} .ni_con h2{ display:block; height:40px; width:188px; margin:0 auto;} From 4917c6329874d740be0471a5fd742da6c6a7ec17 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 19 Nov 2014 14:35:58 +0800 Subject: [PATCH 15/33] =?UTF-8?q?=E5=8F=96=E6=B6=88=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=88=AA=E8=87=B3=E6=97=B6=E9=97=B4=E7=9A=84=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 | 29 +++++++++------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index 971b2e3eb..aadc93fa4 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -139,19 +139,6 @@ ) - - <% if betweentime(bid.deadline) < 0 %> - - <%= l(:label_commit_limit)%> - - <% else %> - - - - <% end %> - @@ -191,10 +178,18 @@ <%=format_time bid.created_on %> - <%= l(:field_deadline) %> - :  - <%=bid.deadline %> - + <% if betweentime(bid.deadline) < 0 %> + + <%= l(:label_commit_limit)%> + + <% else %> + + + + <% end %> + From b2ce8c78bded95c1fde65034fc6bff9eaf58dba3 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Wed, 19 Nov 2014 17:25:10 +0800 Subject: [PATCH 16/33] =?UTF-8?q?<=E4=BF=AE=E6=94=B9=E8=B5=84=E6=96=99>?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2<=E8=AF=BE=E7=A8=8B=E6=88=90=E5=91=98>=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=8C=E6=B3=A8=E5=86=8C=E5=90=8E=E9=A1=B5=E9=9D=A2=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E8=B7=AF=E7=94=B1=E4=BF=AE=E6=94=B9=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/controllers/account_controller.rb | 2 +- app/views/account/register.html.erb | 9 +- app/views/courses/settings/_members.html.erb | 4 +- app/views/my/account.html.erb | 113 ++++++++++++++----- app/views/settings/_general.html.erb | 28 ++--- app/views/settings/_notifications.html.erb | 2 +- app/views/stores/search.html.erb | 2 +- app/views/versions/_form.html.erb | 4 +- config/locales/zh.yml | 14 ++- public/stylesheets/application.css | 9 +- 10 files changed, 128 insertions(+), 59 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 4b5a8c064..2c4929019 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -136,7 +136,7 @@ class AccountController < ApplicationController session[:auth_source_registration] = nil self.logged_user = @user flash[:notice] = l(:notice_account_activated) - render :action => 'email_valid' + redirect_to my_account_path end else @user.login = params[:user][:login] diff --git a/app/views/account/register.html.erb b/app/views/account/register.html.erb index a18c15068..32940d111 100644 --- a/app/views/account/register.html.erb +++ b/app/views/account/register.html.erb @@ -17,10 +17,10 @@ <% if @user.auth_source_id.nil? %>

    <%= f.text_field :login, :size => 25, :required => true %> - <%= l(:label_max_number) %> + <%= l(:label_max_number) %>

    <%= f.password_field :password, :size => 25, :required => true %> - <%= l(:text_caracters_minimum, :count => Setting.password_min_length) %> + <%= l(:text_caracters_minimum, :count => Setting.password_min_length) %>

    <%= f.password_field :password_confirmation, :size => 25, :required => true %>

    <% end %> @@ -30,7 +30,10 @@

    - <%= "#{l(:label_mail_attention)} " %> + +

    <%= "#{l(:label_mail_attention)} " %>

    +

    <%= "#{l(:label_mail_attention1)} " %>

    +

    diff --git a/app/views/courses/settings/_members.html.erb b/app/views/courses/settings/_members.html.erb index ab0f20257..e73e9cf7b 100644 --- a/app/views/courses/settings/_members.html.erb +++ b/app/views/courses/settings/_members.html.erb @@ -20,8 +20,8 @@ <% members.each do |member| %> <% next if member.new_record? %>
    - - +
    <%= l(:label_contact_us) %> @@ -30,85 +30,25 @@ \ No newline at end of file diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index d0d71c50d..b0d427018 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -12,7 +12,8 @@ h4 {border-bottom: 1px dotted #bbb;} .course_ad{ position:absolute; visibility:visible; - background:#ffffff + background:#ffffff; + width:14%; } .ad_title{ From 90f5cd2e609c23443573d7e2e77f6623a3d07101 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 18 Nov 2014 10:39:50 +0800 Subject: [PATCH 03/33] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=A9=E6=94=BEhtml?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=97=B6=E6=82=AC=E6=B5=AE=E6=A1=86=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84?= =?UTF-8?q?BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_course_ad.html.erb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/courses/_course_ad.html.erb b/app/views/courses/_course_ad.html.erb index 8318bb5d1..f8b4781f8 100644 --- a/app/views/courses/_course_ad.html.erb +++ b/app/views/courses/_course_ad.html.erb @@ -49,6 +49,7 @@ } $("#floatpoint").css("top",YY); } - //$("#floatpoint").css("left",screen_width/2+body_width/2+5); - $(document).ready(function(){var body_width = $("#top-menu").width(); $("#floatpoint").css("left",screen_width/2+body_width/2+10);}); + function change_size(){var body_width = $("#top-menu").width(); $("#floatpoint").css("left",screen_width/2+body_width/2+10);} + $(document).ready(function(){change_size();}); + $(window).resize(function(){screen_width = $(window).width();change_size();}); \ No newline at end of file From e359b987e5f98561fa92eaf559f5d8d56c6f8860 Mon Sep 17 00:00:00 2001 From: moon Date: Tue, 18 Nov 2014 10:56:56 +0800 Subject: [PATCH 04/33] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E2=80=9C=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E4=BD=9C=E4=B8=9A=E2=80=9D=E6=9D=83=E9=99=90=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/views/courses/homework.html.erb | 9 +++++---- config/locales/zh.yml | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/views/courses/homework.html.erb b/app/views/courses/homework.html.erb index 95e26abd0..68ec0dc2e 100644 --- a/app/views/courses/homework.html.erb +++ b/app/views/courses/homework.html.erb @@ -5,11 +5,12 @@ <%= javascript_include_tag 'attachments' %> -
    - <% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and course_id = ?', User.current.id, @course.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, @course.id).first.roles&Role.where(id: [3, 4, 7, 9] )).size >0))%> - <%= link_to(l(:label_course_homework_new), {:controller => 'courses', :action => 'new_homework'}, :class => 'icon icon-add') %> - <% end %> + <% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and course_id = ?', User.current.id, @course.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, @course.id).first.roles&Role.where(id: [3, 4, 7, 9] )).size >0))%> + <%= link_to(l(:label_course_homework_new), {:controller => 'courses', :action => 'new_homework'}, :class => 'icon icon-add') %> + <% else %> + <%= l(:label_coursejoin_tip) %> + <% end %>
    <%= render :partial => 'bids/bid_homework_show', :locals => {:bids => @bids, :bid_pages => @bid_pages} %> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 0220a10e5..a3807dca3 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2134,6 +2134,7 @@ zh: label_notification: 通知公告 label_course_ad_description: 课程模块正在优化中,使用过程中如有问题请您与我们联系,感谢大家的支持! label_course_adcolick: 请点击: + label_coursejoin_tip: 提示:加入课程才有权限查看或提交作业,“加入”按钮见课程图标右侧! #end #end From 3ac023e7a59dba1e91738297f3e1d4b181f06bd8 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 18 Nov 2014 11:18:00 +0800 Subject: [PATCH 05/33] =?UTF-8?q?=E6=82=AC=E6=B5=AE=E6=A1=86=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=B1=8F=E5=B9=95=E7=BB=9D=E5=AF=B9=E5=AE=9A=E4=BD=8D?= =?UTF-8?q?=20=E9=97=AE=E9=A2=98=EF=BC=9A=E8=B2=8C=E4=BC=BCIE6=E4=B8=8D?= =?UTF-8?q?=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_course_ad.html.erb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/views/courses/_course_ad.html.erb b/app/views/courses/_course_ad.html.erb index f8b4781f8..efac79afc 100644 --- a/app/views/courses/_course_ad.html.erb +++ b/app/views/courses/_course_ad.html.erb @@ -33,12 +33,11 @@ var xstep=1; // 移动步长,此参数越小,移动越平滑,最小值为1 var delay_time=60; // 每步的时间间隔,此参数越小,移动速度越快 var YY=0; - var screen_height = $(window).height(); //浏览器当前窗口文档的高度 - var screen_width = $(window).width(); //浏览器当前窗口文档的宽度 window.setInterval(function(){move();},delay_time); function move() { + var screen_height = $(window).height(); //浏览器当前窗口文档的高度 var floatpoint_height = $("#floatpoint").height(); YY += xstep; if(YY <= 0){xstep = 1; YY = 0;} //如果浮动层超出了上界,则设定移动方向为向下;并设定层的位置为正好在上界处 @@ -47,9 +46,9 @@ xstep = -1; YY=(screen_height-floatpoint_height); } - $("#floatpoint").css("top",YY); + $("#floatpoint").css("margin-top",YY); } - function change_size(){var body_width = $("#top-menu").width(); $("#floatpoint").css("left",screen_width/2+body_width/2+10);} + function change_size(){var screen_width = $(window).width();var body_width = $("#top-menu").width(); $("#floatpoint").css("left",screen_width/2+body_width/2+10).css("position", "fixed");} $(document).ready(function(){change_size();}); - $(window).resize(function(){screen_width = $(window).width();change_size();}); + $(window).resize(function(){change_size();}); \ No newline at end of file From d0e549fc851484433c4e67da1d687fb58bd5ad33 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 18 Nov 2014 16:00:04 +0800 Subject: [PATCH 06/33] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=80=92=E8=AE=A1=E6=97=B6=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 | 29 ++++++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index 73a9bc6bd..166a4b224 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -1,4 +1,23 @@ + + <% if bids.blank? %> <%#= l(:label_uncommit_homework) %> 暂无作业! @@ -100,11 +119,11 @@ <%= l(:label_commit_limit)%> <% else %> - <% if betweentime(bid.deadline) < 3 %> - - <%= l(:label_commit_ar) %> - - <% end %> + + + <% end %>
    @@ -117,7 +117,7 @@ <%= l(:label_new_activity) %>   - <%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %> + <%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), course_for_bid_path(e.act_id) %>
    + <% if bid.open_anonymous_evaluation == 1%> <% case @bid.comment_status %> <% when 0 %> @@ -116,6 +117,7 @@ 匿评结束 <% end %> + <%end%>
    - <% if bid.open_anonymous_evaluation == 1%> + <% if @bid.open_anonymous_evaluation == 1%> <% case @bid.comment_status %> <% when 0 %> @@ -117,7 +117,7 @@ 匿评结束 <% end %> - <%end%> + <%end%>
    <%= link_to_user member.principal %> + <%= link_to_user member.principal %> <%= h member.roles.sort.collect(&:to_s).join(', ') %> diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 4ffcc63fc..04793a02e 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -9,6 +9,47 @@ function () { $("#province").attr("href", "#WOpenWindow") $("#province").leanModal({top: 100, closeButton: ".modal_close"}); + var $lastname = $('#user_lastname') + var $firstname = $('#user_firstname') + var $enterprise = $('#enterprise_name') + $lastname.blur(function () { + var pas1 = document.getElementById("user_lastname").value; + + if (pas1 == "") { + $('#valid_lastname').html('' + "<%= l(:lastname_empty) %>"+ ""); + $('#lastname_limit').hide(); + } + else { + $('#valid_lastname').html('' + ""); + $('#lastname_limit').show(); + } + + }); + $firstname.blur(function () { + var pas1 = document.getElementById("user_firstname").value; + + if (pas1 == "") { + $('#valid_firstname').html('' + "<%= l(:firstname_empty) %>"+ ""); + $('#firstname_limit').hide(); + } + else { + $('#valid_firstname').html('' + ""); + $('#firstname_limit').show(); + } + }); + $enterprise.blur(function () { + var pas1 = document.getElementById("enterprise_name").value; + + if (pas1 == "") { + $('#valid_companyname').html('' + "<%= l(:enterprise_empty) %>"+ ""); + + } + else { + $('#valid_lastname').html('' + ""); + + } + + }); } ); @@ -61,16 +102,19 @@ <%= l(:label_information_plural) %> + +

    - <%= f.text_field :login, :required => true, :size => 25, :name => "login"%> + <%= f.text_field :login, :required => true, :size => 25, :name => "login", :readonly => true %> <%= l(:label_max_number) %>

    -

    - <%= l(:label_identity) %> * - @@ -93,34 +137,38 @@ <% end %> +

    -
    @@ -152,11 +200,16 @@ -
    @@ -213,7 +266,7 @@ -

    +

    <%= f.text_field :mail, :required => true %>

    @@ -222,14 +275,22 @@

    - - <% province = User.current.user_extensions.location %> - <% city = User.current.user_extensions.location_city %> - <% identity = User.current.user_extensions.identity %> - <% occupation1 = User.current.user_extensions.occupation %> - <% occupation = User.current.user_extensions.occupation %> - <% title = User.current.user_extensions.technical_title %> - <% language = User.current.language %> + <% if !User.current.user_extensions.nil? %> + <% province = User.current.user_extensions.location %> + <% city = User.current.user_extensions.location_city %> + <% identity = User.current.user_extensions.identity %> + <% occupation1 = User.current.user_extensions.occupation %> + <% occupation = User.current.user_extensions.occupation %> + <% title = User.current.user_extensions.technical_title %> + <% language = User.current.language %> + <% else %> + <% province = "湖南省" %> + <% city = "长沙"%> + <% identity = ""%> + <% occupation1 = ""%> + <% title = "" %> + <% language = ""%> + <% end %> -

    <%= l(:label_location) %> +

    - + - - + +
    公共贴吧 <%= l(:label_user_location) %> : + + <%= l(:label_user_location) %> : + + - <% if User.current.logged? %> - <%= link_to( l(:label_forum_new), new_forum_path, :class => 'icon icon-add') %> - <% end %> - + <% if User.current.logged? %> + <%= link_to( l(:label_forum_new), new_forum_path, :class => 'icon icon-add') %> + <% end %>
    <%= link_to request.host()+"/forums", forums_path %> <%= link_to l(:field_homepage), home_path %> > <%= link_to "公共贴吧", forums_path %> + + <%= link_to request.host()+"/forums", forums_path %> + + + <%= link_to l(:field_homepage), home_path %> > + <%= link_to "公共贴吧", forums_path %> +

    diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 642cf5b15..85fa8093a 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -1,16 +1,25 @@
    -

    <%=l(:label_memo_new)%>

    +

    + <%=l(:label_memo_new)%> +

    <% if User.current.logged? %> <%= labelled_form_for(@memo, :url => create_memo_forum_path(@forum), :html => {:multipart => true} ) do |f| %>
    -

    <%= f.text_field :subject, :required => true%>

    -

    <%= f.text_area :content, :required => true, :id => 'editor02' %>

    - -

    (<%= l(:label_memos_max_length) %>)

    - <%= l(:label_attachment_plural) %>
    - <%= render :partial => 'attachments/form', :locals => {:container => @memo} %> + <%= f.text_field :subject, :required => true, :maxlength => 50%> +

    +

    + <%= f.text_area :content, :required => true, :id => 'editor02' %> +

    + +

    + (<%= l(:label_memos_max_length) %>) +

    +

    + <%= l(:label_attachment_plural) %> +
    + <%= render :partial => 'attachments/form', :locals => {:container => @memo} %>

    <%= f.submit :value => l(:label_memo_create) %> <%= link_to l(:button_cancel), "#", :onclick => '$("#add-memo").hide(); return false;' %> diff --git a/app/views/memos/edit.html.erb b/app/views/memos/edit.html.erb index ded3a1b12..09e4262fe 100644 --- a/app/views/memos/edit.html.erb +++ b/app/views/memos/edit.html.erb @@ -4,30 +4,43 @@ <%= labelled_form_for(@memo, :url => forum_memo_path(@memo.forum_id, @memo)) do |f| %> <% if @memo.errors.any? %>
    -

    <%= pluralize(@memo.errors.count, "error") %> prohibited this memo from being saved:

    +

    + <%= pluralize(@memo.errors.count, "error") %> + prohibited this memo from being saved: +

      <% @memo.errors.full_messages.each do |msg| %> -
    • <%= msg %>
    • +
    • + <%= msg %> +
    • <% end %>
    <% end %>
    -

    <%= f.text_field :subject, :required => true, :size => 96 ,:readonly => @replying%>

    - <% unless @replying %> - <% if @memo.safe_attribute? 'sticky' %> - <%= f.check_box :sticky %> <%= label_tag 'memo_sticky', l(:label_board_sticky) %> - <% end %> - <% if @memo.safe_attribute? 'lock' %> - <%= f.check_box :lock %> <%= label_tag 'memo_locked', l(:label_board_locked) %> - <% end %> - <% end %> + <%= f.text_field :subject, :required => true, :size => 96 ,:readonly => @replying, :maxlength => 50%> +

    + <% if User.current.admin?%> +

    + <% unless @replying %> + <% if @memo.safe_attribute? 'sticky' %> + <%= f.check_box :sticky %> + <%= label_tag 'memo_sticky', l(:label_board_sticky) %> + <% end %> + <% if @memo.safe_attribute? 'lock' %> + <%= f.check_box :lock %> <%= label_tag 'memo_locked', l(:label_board_locked) %> + <% end %> + <% end %> +

    + <% end %> +

    + <%= f.text_area :content, :required => true, :size => 80, id: 'editor01' %>

    -

    <%= f.text_area :content, :required => true, :size => 80, id: 'editor01' %>

    - <%= l(:label_attachment_plural) %>
    + <%= l(:label_attachment_plural) %> +
    <%= render :partial => 'attachments/form', :locals => {:container => @memo} %>


    From 4ae74b560823b797360d8148da4abb05fe8bece7 Mon Sep 17 00:00:00 2001 From: zhuhao Date: Thu, 20 Nov 2014 16:19:39 +0800 Subject: [PATCH 26/33] =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/application.css | 2 +- public/stylesheets/nyan.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index cccc042ce..be26a7fed 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -1598,7 +1598,7 @@ input[type="submit"].bid_btn { input[type="submit"].ButtonAddTags { color: #fffbff ; - padding-bottom: 5px; + padding-bottom:5px ; width:auto ; height: 25px ; font-family: '微软雅黑',Arial,Helvetica,sans-serif ; diff --git a/public/stylesheets/nyan.css b/public/stylesheets/nyan.css index 00b322c2d..cc5898e0d 100644 --- a/public/stylesheets/nyan.css +++ b/public/stylesheets/nyan.css @@ -477,7 +477,7 @@ body { input[class~='ButtonClolr'],.ButtonColor{ color: #fffbff !important; - padding-bottom: 5px; + padding: 5px; width: auto; height: 24px ; font-family: '微软雅黑',Arial,Helvetica,sans-serif; From 1eb90042591b1822974872c42489780632f084b5 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 20 Nov 2014 16:49:47 +0800 Subject: [PATCH 27/33] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/_forum_list.html.erb | 51 +++++++++++++++++++++------ 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/app/views/forums/_forum_list.html.erb b/app/views/forums/_forum_list.html.erb index 874dc355f..6a85be4eb 100644 --- a/app/views/forums/_forum_list.html.erb +++ b/app/views/forums/_forum_list.html.erb @@ -4,23 +4,54 @@ <% forums.each do |forum| %>
    - <%= forum.creator.nil? ? (link_to image_tag(url_to_avatar(forum.creator), :class => "avatar")) : (link_to image_tag(url_to_avatar(forum.creator), :class => "avatar"), user_path(forum.creator)) %> -
    + <%= forum.creator.nil? ? (link_to image_tag(url_to_avatar(forum.creator), :class => "avatar")) : (link_to image_tag(url_to_avatar(forum.creator), :class => "avatar"), user_path(forum.creator)) %> +
    - - - + + + + + + + + +
    -

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

    <%= textAreailizable forum.description%>

    <%= authoring forum.created_at, forum.creator %>

    +

    + <%= link_to h(forum.name), forum_path(forum) %> +

    +
    +

    + <%= textAreailizable forum.description%> +

    +
    +

    + <%= authoring forum.created_at, forum.creator %> +

    +
    - -
    <%= link_to (forum.memo_count), forum_path(forum) %><%= link_to (forum.topic_count), forum_path(forum) %>
    回答帖子
    + + + + + + + + + +
    + <%= link_to (forum.memo_count), forum_path(forum) %> + + <%= link_to (forum.topic_count), forum_path(forum) %> +
    回答帖子
    +
    <% end %> - + <% else %> <% end %>
    \ No newline at end of file From bc0f3840aad06ef1e692ae8832ab86896cc5ac6b Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 20 Nov 2014 17:02:39 +0800 Subject: [PATCH 28/33] =?UTF-8?q?=E8=B4=B4=E5=90=A7=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=8A=A8=E6=8D=A2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/_forum_list.html.erb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/forums/_forum_list.html.erb b/app/views/forums/_forum_list.html.erb index 6a85be4eb..fe2f757c3 100644 --- a/app/views/forums/_forum_list.html.erb +++ b/app/views/forums/_forum_list.html.erb @@ -7,23 +7,23 @@ <%= forum.creator.nil? ? (link_to image_tag(url_to_avatar(forum.creator), :class => "avatar")) : (link_to image_tag(url_to_avatar(forum.creator), :class => "avatar"), user_path(forum.creator)) %>
    - +
    - - - + <%= delete_link user_path(user, :back_url => admin_search_path(params)) unless User.current == user %> <% end -%> diff --git a/public/stylesheets/nyan.css b/public/stylesheets/nyan.css index 27e8a367e..10dbededb 100644 --- a/public/stylesheets/nyan.css +++ b/public/stylesheets/nyan.css @@ -15,7 +15,7 @@ span[id^=valid_user] { } .red { - color: red;margin-left: 10px;margin-right: 10px;text-align: right; + color: red;margin-right: 10px;text-align: right; } .green { From 9277b3007ac1b77f1d9cfcc66a6c3f0d289bef6d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 20 Nov 2014 17:10:05 +0800 Subject: [PATCH 30/33] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E8=B4=B4=E5=90=A7=E6=8F=8F=E8=BF=B0=E6=97=B6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=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/controllers/memos_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index 9257888dd..aaa99e417 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -19,7 +19,7 @@ class MemosController < ApplicationController @content = "#{ll(Setting.default_language, :text_user_wrote, @memo.author)}
      " @content << @memo.content.to_s.strip.gsub(%r{
    ((.|\s)*?)
    }m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n") + "\n\n
    " - @content = "
    " << @content + @content = "
    " << @content #@content = "> #{ll(Setting.default_language, :text_user_wrote, @memo.author)}\n> " #@content << @memo.content.to_s.strip.gsub(%r{
    ((.|\s)*?)
    }m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" #@content_html = textilizable(@content) From dc480ecd443b79ab3fa36a8c8a56c5a526f91483 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 20 Nov 2014 17:24:45 +0800 Subject: [PATCH 31/33] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=85=AC=E5=85=B1?= =?UTF-8?q?=E8=B4=B4=E5=90=A7=E5=BC=95=E7=94=A8=E6=98=BE=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/memo.rb | 2 +- app/views/memos/_reply_box.html.erb | 11 ++++++----- app/views/memos/show.html.erb | 20 +++++++++++++------- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/app/models/memo.rb b/app/models/memo.rb index 847795b4f..cfc509923 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -88,7 +88,7 @@ class Memo < ActiveRecord::Base def editable_by? user # user && user.logged? || (self.author == usr && usr.allowed_to?(:edit_own_messages, project)) - (user && self.author == user) || user.admin? + user.admin? || self.author == user end def destroyable_by? user diff --git a/app/views/memos/_reply_box.html.erb b/app/views/memos/_reply_box.html.erb index e3346ee32..938952c32 100644 --- a/app/views/memos/_reply_box.html.erb +++ b/app/views/memos/_reply_box.html.erb @@ -1,5 +1,5 @@ <%= form_for(@memo_new, url: forum_memos_path, :html => {:multipart => true}) do |f| %> - <%= f.hidden_field :subject, :required => true, value: "RE: "+@memo.subject %> + <%= f.hidden_field :subject, :required => true, value: @memo.subject %> <%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %> <%= f.hidden_field :parent_id, :required => true, value: @memo.id %>
    @@ -7,11 +7,12 @@ <%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %> <%= label_tag(l(:label_reply_plural)) %>: - <%= f.text_area :content, :cols => 80, :rows => 15, :class => 'wiki-edit', :id => 'editor01', :value => @content %>

    - + <%= f.text_area :content, :cols => 80, :rows => 15, :class => 'wiki-edit', :id => 'editor01', :value => @content %> -

    <%= l(:label_attachment_plural) %>
    - <%= render :partial => 'attachments/form' %> +

    + <%= l(:label_attachment_plural) %> +
    + <%= render :partial => 'attachments/form' %>

    <%= f.submit value: l(:label_reply_plural), class: "replies" %> <% end %> \ No newline at end of file diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index b7e5e2749..5222b466f 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -117,28 +117,34 @@
    -
    +

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

    -

    +

    +

    <%= textAreailizable forum.description%>

    +

    <%= authoring forum.created_at, forum.creator %>

    From cb7cd581f6a14c1101919dc66757cf4b9f034d6e Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Thu, 20 Nov 2014 17:08:10 +0800 Subject: [PATCH 29/33] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug=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/views/account/register.html.erb | 4 ++-- app/views/admin/search.html.erb | 2 +- public/stylesheets/nyan.css | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/account/register.html.erb b/app/views/account/register.html.erb index 32940d111..21bdd8fa7 100644 --- a/app/views/account/register.html.erb +++ b/app/views/account/register.html.erb @@ -22,12 +22,12 @@

    <%= f.password_field :password, :size => 25, :required => true %> <%= l(:text_caracters_minimum, :count => Setting.password_min_length) %>

    -

    <%= f.password_field :password_confirmation, :size => 25, :required => true %>

    +

    <%= f.password_field :password_confirmation, :size => 25, :required => true %>

    <% end %>

    <%= f.text_field :mail,:size => 25, :required => true %> - +

    diff --git a/app/views/admin/search.html.erb b/app/views/admin/search.html.erb index 758c7b32f..320fce125 100644 --- a/app/views/admin/search.html.erb +++ b/app/views/admin/search.html.erb @@ -54,7 +54,7 @@

    <%= format_time(user.created_on) %> <%= change_status_link(user) %> - <%= delete_link user_path(user, :back_url => admin_users_path(params)) unless User.current == user %>
    +
    - - +
    <%= link_to image_tag(url_to_avatar(reply.author), :class => "avatar"), user_path(reply.author) %> -
    <%=h sanitize(reply.content.html_safe) %>
    +
    +
    + <%=h sanitize(reply.content.html_safe) %> +

    <% if reply.attachments.any?%> - <% options = {:author => true, :deletable => reply.deleted_attach_able_by?(User.current) } %> - <%= render :partial => 'attachments/links', :locals => {:attachments => reply.attachments, :options => options} %> + <% options = {:author => true, :deletable => reply.deleted_attach_able_by?(User.current) } %> + <%= render :partial => 'attachments/links', :locals => {:attachments => reply.attachments, :options => options} %> <% end %>

    <%= authoring reply.created_at, reply.author %> + <%= authoring reply.created_at, reply.author %> +
    <% end %> - +
    <% if User.current.login? %> From 81420df6b93a32a0610fb1b72796995a13217a16 Mon Sep 17 00:00:00 2001 From: gonglexin <18008490802@163.com> Date: Thu, 20 Nov 2014 22:04:16 +0800 Subject: [PATCH 32/33] =?UTF-8?q?Fix=20#1523=20=E6=96=B0=E5=BB=BA=E7=BC=BA?= =?UTF-8?q?=E9=99=B7=E6=97=B6=E9=AB=98=E4=BA=AE=E6=98=BE=E7=A4=BA=20TAB=20?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 9e9a34d55..f3c2b199c 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -17,7 +17,6 @@ class IssuesController < ApplicationController layout 'base_projects'#Added by young - menu_item :new_issue, :only => [:new, :create] default_search_scope :issues before_filter :find_issue, :only => [:show, :edit, :update] From 32157865381f1cb219bda6490b8801eadbf41f65 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 21 Nov 2014 11:33:11 +0800 Subject: [PATCH 33/33] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=9D=9E=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E6=88=90=E5=91=98=E8=83=BD=E7=9C=8B=E5=88=B0=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E4=BD=9C=E4=B8=9A=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index ac22ed412..178782da3 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -328,7 +328,7 @@ module CoursesHelper #当前用户是不是指定课程的学生 def is_cur_course_student course #course.members.joins(:member_roles).where("member_roles.role_id IN (:role_id) and members.user_id = #{User.current.id}", {:role_id => StudentRoles}).count != 0 - !(User.current.allowed_to?(:as_teacher,course)) + User.current.logged? && User.current.member_of_course?(course) && !(User.current.allowed_to?(:as_teacher,course)) #修改:能新建占位且不能新建任务的角色判定为学生 #is_student = false #@membership = User.current.memberships.all(:conditions => Project.visible_condition(User.current))