From b971147aa8cd949b7dc6d76704035a39a204e2d6 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 3 Apr 2015 15:01:26 +0800 Subject: [PATCH 01/95] =?UTF-8?q?1=E3=80=81=E6=B7=BB=E5=8A=A0=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E4=BC=9Aalert=202=E3=80=81=E6=B7=BB=E5=8A=A0=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E6=8F=8F=E8=BF=B0=E6=A0=B7=E5=BC=8F=203=E3=80=81?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E6=B7=BB=E5=8A=A0=E8=AF=84=E8=AE=BA=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/news/_course_form.html.erb | 2 +- app/views/news/_course_show.html.erb | 3 +-- public/javascripts/course.js | 3 +-- public/stylesheets/courses.css | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/views/news/_course_form.html.erb b/app/views/news/_course_form.html.erb index 5c0fc8274..b8b3e36a4 100644 --- a/app/views/news/_course_form.html.erb +++ b/app/views/news/_course_form.html.erb @@ -4,7 +4,7 @@

-
  • +
  • <% if is_new %> <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> diff --git a/app/views/news/_course_show.html.erb b/app/views/news/_course_show.html.erb index 3334f7c6a..d44deb66e 100644 --- a/app/views/news/_course_show.html.erb +++ b/app/views/news/_course_show.html.erb @@ -101,10 +101,9 @@ <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> <%= kindeditor_tag :comment, '',:height=>'100',:editor_id =>'comment_editor', :placeholder=>"最多250个字"%> -

    +

    <%= l(:label_cancel_with_space) %> <%= l(:label_comment_with_space) %> -

    <% end %> diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 3536478a8..d6e8cf0ff 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -200,9 +200,8 @@ function regexDescription() } } -function submitNews(is_new) +function submitNews() { - alert(is_new) if(regexTitle() && regexDescription()) { news_description_editor.sync(); diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 6053940d6..c0458e503 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -175,7 +175,7 @@ a:hover.work_edit{color: #fff; background: #64bdd9;} .wzan a{ display: block;} a.wzan_img{background:url(images/pic_zan.png) 0 -59px no-repeat; display:block; height:31px; width:30px; color:#fff;} a.wzan_visited{background:url(images/pic_zan.png) 0 0 no-repeat;} -.msg_box{ width:670px; height:173px; border-bottom:1px dashed #CCC; padding-top:10px;} +.msg_box{ width:670px; height:200px; border-bottom:1px dashed #CCC; padding-top:10px;} .msg_box h4{ } .msg_box textarea{width:658px;height:90px;padding:5px;overflow:hidden;background-color: #ffffff; border:1px solid #CCC; margin:5px 0px; color:#666; font-size:12px; } /*.msg_box a{ float:right; display:block; width:50px; height:22px; background:#15bccf; padding-top:3px; color:#fff; margin-left:10px; text-align:center; margin-top:5px; }*/ From 500b54a46617a9078ee3d88f6b08a834a39fb3d8 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 3 Apr 2015 15:39:24 +0800 Subject: [PATCH 02/95] =?UTF-8?q?=E8=AE=A8=E8=AE=BA=E5=8C=BA=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D=E5=BC=95=E7=94=A8=E6=98=AFhtml=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/messages_controller.rb | 11 +---------- app/views/memos/quote.js.erb | 2 +- app/views/messages/quote.js.erb | 2 +- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 2ad388f41..4c44b6ddb 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -189,16 +189,7 @@ class MessagesController < ApplicationController @content = "> #{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> " @temp = Message.new - #@temp.content = "> #{ll(Setting.default_language, :text_user_wrote, @message.author)}> " - @content << @message.content.to_s.strip.gsub(%r{
    ((.|\s)*?)
    }m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" - @content_html = textilizable(@content) - @temp.content = @content_html - #@content = "#{ll(Setting.default_language, :text_user_wrote, @message.author)}
      " - #@content << @message.content.to_s.strip.gsub(%r{
    ((.|\s)*?)
    }m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n") + "\n\n
    " - #@content = "
    " << @content - #@temp = Message.new - #@temp.content = @content - + @temp.content = "
    #{@message.content.html_safe}
    ".html_safe end def preview diff --git a/app/views/memos/quote.js.erb b/app/views/memos/quote.js.erb index d2e8c1d17..b3d860916 100644 --- a/app/views/memos/quote.js.erb +++ b/app/views/memos/quote.js.erb @@ -1,4 +1,4 @@ //ckeditor.setData("<%= raw escape_javascript(@content) %>"); -$('#message_quote').html("<%= raw escape_javascript(@temp.content) %>"); +$('#message_quote').html("<%= raw escape_javascript(@temp.content.html_safe) %>"); $('#quote').val("<%= raw escape_javascript(@content) %>"); showAndScrollTo("new_memo", "cke_editor01"); \ No newline at end of file diff --git a/app/views/messages/quote.js.erb b/app/views/messages/quote.js.erb index f8ec37d75..3d8fe7237 100644 --- a/app/views/messages/quote.js.erb +++ b/app/views/messages/quote.js.erb @@ -1,5 +1,5 @@ $('#message_subject').val("<%= raw escape_javascript(@subject) %>"); -$('#message_quote').html("<%= raw escape_javascript(@temp.content) %>"); +$('#message_quote').html("<%= raw escape_javascript(@temp.content.html_safe) %>"); //$('#message_content').val("<#%= raw escape_javascript(@content) %>"); $('#quote_quote').html("<%= raw escape_javascript(@content) %>"); From 42124e8ec594100300f9975473563903de95096e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 3 Apr 2015 15:54:58 +0800 Subject: [PATCH 03/95] =?UTF-8?q?=E5=BC=80=E5=90=AF=E3=80=81=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E5=8C=BF=E8=AF=84=E6=98=AF=E6=9C=89=E6=97=B6=E5=80=99?= =?UTF-8?q?=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/bids_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index be97fdb6e..21b3cc531 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -1035,11 +1035,12 @@ class BidsController < ApplicationController def alert_anonymous_comment @bid = Bid.find params[:id] @course = @bid.courses.first + @cur_size = 0 + @totle_size = 0 if @bid.comment_status == 0 @totle_size = searchStudent(@course).size @cur_size = @bid.homeworks.size elsif @bid.comment_status == 1 - @totle_size = 0 @bid.homeworks.map { |homework| @totle_size += homework.homework_evaluations.count} @cur_size = 0 @bid.homeworks.map { |homework| @cur_size += homework.rates(:quality).where("seems_rateable_rates.is_teacher_score = 0").count} From 0bea5dbb4eac740fd23e6ef1618ea4f22666373b Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 7 Apr 2015 15:45:39 +0800 Subject: [PATCH 04/95] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=A0=87=E9=A2=98a=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E8=BF=87=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/courses.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index c0458e503..c60fca5cc 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -55,7 +55,7 @@ a:hover.problem_pic{border:1px solid #64bdd9;} .problem_txt{ width:610px; margin-left:10px; color:#777777;word-break: break-all;word-wrap: break-word;} a.problem_name{ color:#ff5722;} a:hover.problem_name{ color:#d33503;} -a.problem_tit{ color:#0781b4; width:430px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} +a.problem_tit{ color:#0781b4; max-width:430px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} a:hover.problem_tit{ color:#09658c; } .problem_main{ border-bottom:1px dashed #d4d4d4; padding-bottom:10px; margin-bottom:10px;} /****翻页***/ From cc6a9d12f1d6fb7f7db9c692f81bdc411789c1a8 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 8 Apr 2015 09:46:05 +0800 Subject: [PATCH 05/95] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E6=97=B6=E6=98=BE=E7=A4=BA=E6=98=8E=E7=A0=81=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/new.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/courses/new.html.erb b/app/views/courses/new.html.erb index 68a326fb2..73e86c5a0 100644 --- a/app/views/courses/new.html.erb +++ b/app/views/courses/new.html.erb @@ -38,7 +38,7 @@
  • - 显示明码 + 显示明码
    学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。
  • From ba4894239cc2120a1d8e81d2b68a62efa22418e8 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 8 Apr 2015 11:29:21 +0800 Subject: [PATCH 06/95] =?UTF-8?q?1=E3=80=81=E9=83=A8=E5=88=86=E6=B5=8F?= =?UTF-8?q?=E8=A7=88=E5=99=A8=E4=B8=8B=E6=96=B0=E5=BB=BA=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=AF=86=E7=A0=81=E9=BB=98=E8=AE=A4=E5=A1=AB?= =?UTF-8?q?=E5=86=99=EF=BC=8C=E8=AF=BE=E6=97=B6=E9=BB=98=E8=AE=A4=E5=A1=AB?= =?UTF-8?q?=E5=86=99=E4=B8=BA=E7=99=BB=E5=BD=95=E5=90=8D=202=E3=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B=E5=AF=86=E7=A0=81=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=8F=96=E6=B6=88=E6=98=8E=E7=A0=81=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/new.html.erb | 16 ++-------------- app/views/courses/settings.html.erb | 3 ++- public/javascripts/course.js | 6 ++++++ 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/app/views/courses/new.html.erb b/app/views/courses/new.html.erb index 73e86c5a0..0ea51d5f4 100644 --- a/app/views/courses/new.html.erb +++ b/app/views/courses/new.html.erb @@ -1,16 +1,3 @@ - - -

    <%= l(:permission_new_course)%>

    @@ -37,7 +24,8 @@
  • - + + 显示明码
    学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。 diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb index 569ae302b..acc6c12a5 100644 --- a/app/views/courses/settings.html.erb +++ b/app/views/courses/settings.html.erb @@ -39,7 +39,8 @@
  • - + + 显示明码
    学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。
  • diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 5248d31dd..286905017 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -410,3 +410,9 @@ function regexDeadLine() { ('#ui-datepicker-div').hide; } + +$(function(){ + $("#psw_btn").click(function() { + alert("密码: "+$("#course_course_password").val()); + }); +}); From 89af4b451bc4c8c767fa73f8f70b1cd179dbe1a8 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Wed, 8 Apr 2015 13:52:52 +0800 Subject: [PATCH 07/95] =?UTF-8?q?#2100=20IE8=E4=B8=AD=EF=BC=8C=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B--=E8=80=81=E5=B8=88=E5=8F=91=E5=B8=83=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A/=E5=AD=A6=E7=94=9F=E6=8F=90=E4=BA=A4=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=EF=BC=8C=E4=B8=8A=E4=BC=A0=E9=99=84=E4=BB=B6=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E4=B8=8D=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/_form.html.erb | 16 ---------------- app/views/attachments/_new_form.html.erb | 6 +++--- app/views/bids/edit.html.erb | 2 +- app/views/courses/new_homework.html.erb | 2 +- app/views/files/_attachement_list.html.erb | 4 ++-- app/views/homework_attach/new.html.erb | 1 + public/javascripts/attachments.js | 3 ++- 7 files changed, 10 insertions(+), 24 deletions(-) diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb index b026fead2..18586e809 100644 --- a/app/views/attachments/_form.html.erb +++ b/app/views/attachments/_form.html.erb @@ -17,23 +17,7 @@ <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> <% end %> - <% container.saved_attachments.each_with_index do |attachment, i| %> - - <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> - <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> - <%= l(:field_is_public)%>: - <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%> - <%= if attachment.id.nil? - #待补充代码 - else - link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') - end - %> - <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> - <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> - - <% end %> <% end %>
    - <%= textAreailizable bid, :description %> + <%= bid.description.html_safe %>
    - - - <%# other_formats_links do |f| %> - <%#= f.link_to 'Atom', :url => {:course_id => @course, :key => User.current.rss_key} %> - <%# end %> - - <% content_for :header_tags do %> - <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %> - <%= stylesheet_link_tag 'scm' %> - <% end %> - - <% html_title(l(:label_course_news)) -%> - - - + +<% content_for :header_tags do %> + <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %> + <%= stylesheet_link_tag 'scm' %> +<% end %> +<% html_title(l(:label_course_news)) -%> diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/kindeditor.js b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/kindeditor.js index d5dd1e443..e58e4b2be 100644 --- a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/kindeditor.js +++ b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/kindeditor.js @@ -4922,7 +4922,7 @@ KEditor.prototype = { editDiv = K('.edit', container), statusbar = self.statusbar = K('.statusbar', container); container.removeClass('container') - .addClass('ke-container ml56 ke-container-' + self.themeType).css('width', width); + .addClass('ke-container ke-container-' + self.themeType).css('width', width); if (fullscreenMode) { container.css({ position : 'absolute', diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index 9bdcff891..8ecbfef06 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -4917,7 +4917,7 @@ KEditor.prototype = { editDiv = K('.edit', container), statusbar = self.statusbar = K('.statusbar', container); container.removeClass('container') - .addClass('ke-container ml56 ke-container-' + self.themeType).css('width', width); + .addClass('ke-container ke-container-' + self.themeType).css('width', width); if (fullscreenMode) { container.css({ position : 'absolute', diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 286905017..64b8898f4 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -411,8 +411,20 @@ function regexDeadLine() ('#ui-datepicker-div').hide; } +//新建、修改课程明码显示 $(function(){ $("#psw_btn").click(function() { alert("密码: "+$("#course_course_password").val()); }); }); + +//课程通知更多按钮显示 +$(function(){ + $('.news_description').each(function () { + if($(this).height() >= 38) + { + $('#news_foot_'+$(this).attr('id').replace('news_description_','')).css("display","block"); + } + } + ) +}); From dae907d0b82e75c83f394cbc283418c023baa892 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 8 Apr 2015 15:49:53 +0800 Subject: [PATCH 12/95] =?UTF-8?q?1=E3=80=81=E8=AF=BE=E7=A8=8B=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E6=97=A0=E6=B3=95=E6=B7=BB=E5=8A=A0=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=202=E3=80=81=E8=AF=BE=E7=A8=8B=E9=80=9A=E7=9F=A5=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=98=BE=E7=A4=BA=203=E3=80=81=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E8=AF=84=E8=AE=BA=E5=8F=96=E6=B6=88=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/comments_controller.rb | 2 +- app/views/news/_course_show.html.erb | 93 +++++++------------------- public/javascripts/course.js | 10 ++- public/stylesheets/courses.css | 2 +- 4 files changed, 35 insertions(+), 72 deletions(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 57ad9d4ce..bb84b1fa4 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -27,7 +27,7 @@ class CommentsController < ApplicationController raise Unauthorized unless @news.commentable? @comment = Comment.new - @comment.safe_attributes = params[:comment] + @comment.comments = params[:comment] @comment.author = User.current if @news.comments << @comment if params[:asset_id] diff --git a/app/views/news/_course_show.html.erb b/app/views/news/_course_show.html.erb index d44deb66e..f7c5145f0 100644 --- a/app/views/news/_course_show.html.erb +++ b/app/views/news/_course_show.html.erb @@ -1,63 +1,7 @@ - <%= javascript_include_tag "/assets/kindeditor/kindeditor" %> @@ -77,8 +21,9 @@
    <%= link_to image_tag(url_to_avatar(@news.author),:width => 42,:height => 42), user_path(@news.author), :class => "problem_pic fl" %>
    -

    <%=h @news.title %>

    - <%#= watcher_link(@news, User.current) %> +

    + <%=h @news.title %> +

    <%= link_to(l(:button_edit), edit_news_path(@news), :class => 'talk_edit fr', @@ -86,7 +31,11 @@ :onclick => '$("#edit-news").show(); return false;') if User.current.allowed_to?(:manage_news, @course) %> <%= delete_link(news_path(@news),:class => 'talk_edit fr') if User.current.allowed_to?(:manage_news, @course) %>
    -
    <%= textAreailizable(@news, :description) %>
    <%= l(:label_create_time) %> : <%= format_time(@news.created_on) %>
    +
    + <%= @news.description.html_safe %> +
    + <%= l(:label_create_time) %> : <%= format_time(@news.created_on) %> +
    <%= link_to_attachments_course @news %>
    @@ -97,13 +46,17 @@

    <%= l(:label_comment_add) %>

    <%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form") do %> -
    +
    <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> <%= kindeditor_tag :comment, '',:height=>'100',:editor_id =>'comment_editor', :placeholder=>"最多250个字"%>

    - <%= l(:label_cancel_with_space) %> - <%= l(:label_comment_with_space) %> + + <%= l(:label_cancel_with_space) %> + + + <%= l(:label_comment_with_space) %> +

    <% end %>
    @@ -116,12 +69,16 @@
    <%= link_to image_tag(url_to_avatar(comment.author),:width => 42,:height => 42), user_path(comment.author)%>
    - <%= link_to_user_header(comment.author,false,:class => 'c_blue fb fl mb10 ') if comment.respond_to?(:author) %><%= format_time(comment.created_on) %> + <%= link_to_user_header(comment.author,false,:class => 'c_blue fb fl mb10 ') if comment.respond_to?(:author) %> + + <%= format_time(comment.created_on) %> +
    -

    <%= textAreailizable(comment.comments) %>

    +

    <%= comment.comments.html_safe %>

    -
    <%= link_to_if_authorized_course image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment}, - :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %> +
    + <%= link_to_if_authorized_course image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment}, + :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %>
    diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 64b8898f4..fcb72ee78 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -158,7 +158,7 @@ function regexTitle() { $("#title_notice_span").text("标题不能为空"); $("#title_notice_span").css('color','#ff0000'); - $("#title_notice_span").focus(); + $("#news_title").focus(); return false; } else if(name.length <= 60) @@ -171,7 +171,7 @@ function regexTitle() { $("#title_notice_span").text("标题超过60个字符"); $("#title_notice_span").css('color','#ff0000'); - $("#title_notice_span").focus(); + $("#news_title").focus(); return false; } } @@ -214,6 +214,12 @@ function submitFocus(obj) $(obj).focus(); } +function submitComment() +{ + comment_editor.sync(); + $("#add_comment_form").submit(); +} + /////////////////////////////////////////////////课程讨论区 function course_board_submit_message_replay() { diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index b9202279c..fa9e9787c 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -175,7 +175,7 @@ a:hover.work_edit{color: #fff; background: #64bdd9;} .wzan a{ display: block;} a.wzan_img{background:url(images/pic_zan.png) 0 -59px no-repeat; display:block; height:31px; width:30px; color:#fff;} a.wzan_visited{background:url(images/pic_zan.png) 0 0 no-repeat;} -.msg_box{ width:670px; height:200px; border-bottom:1px dashed #CCC; padding-top:10px;} +.msg_box{ width:670px; height:205px; border-bottom:1px dashed #CCC; padding-top:10px;} .msg_box h4{ } .msg_box textarea{width:658px;height:90px;padding:5px;overflow:hidden;background-color: #ffffff; border:1px solid #CCC; margin:5px 0px; color:#666; font-size:12px; } /*.msg_box a{ float:right; display:block; width:50px; height:22px; background:#15bccf; padding-top:3px; color:#fff; margin-left:10px; text-align:center; margin-top:5px; }*/ From c5b55042d4cf8de882482ec9bfd51bfffac6c6a1 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 8 Apr 2015 17:25:52 +0800 Subject: [PATCH 13/95] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E5=A4=8D=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E8=AE=A8=E8=AE=BA=E5=8C=BA=E5=BC=95=E7=94=A8=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=202=E3=80=81=E5=9B=9E=E5=A4=8D=E6=97=B6=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D=E6=A1=86=E8=87=AA=E5=8A=A8=E8=8E=B7=E5=BE=97=E7=84=A6?= =?UTF-8?q?=E7=82=B9=203=E3=80=81=E5=BC=95=E7=94=A8=E6=A0=B7=E5=BC=8F=204?= =?UTF-8?q?=E3=80=81=E4=BF=AE=E6=94=B9=E6=8F=90=E4=BA=A4=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E6=97=B6=E4=B8=8B=E9=9D=A2=E5=87=BA=E7=8E=B0=E7=9A=84=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/messages_controller.rb | 2 +- app/helpers/application_helper.rb | 2 +- app/views/boards/_course_show.html.erb | 21 ++++----- app/views/messages/_course_show.html.erb | 59 +++++++----------------- app/views/messages/_form_course.html.erb | 5 +- app/views/messages/quote.js.erb | 2 +- public/javascripts/course.js | 4 +- public/stylesheets/courses.css | 17 +++++++ 8 files changed, 52 insertions(+), 60 deletions(-) diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 455981d9c..436418430 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -192,7 +192,7 @@ class MessagesController < ApplicationController @content = "> #{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> " @temp = Message.new - @temp.content = "
    #{@message.content.html_safe}
    ".html_safe + @temp.content = "
    #{ll(Setting.default_language, :text_user_wrote, @message.author)}
    #{@message.content.html_safe}
    ".html_safe end def preview diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c94108dc1..f36e4b397 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -303,7 +303,7 @@ module ApplicationHelper onclick = "$('##{id}').slideToggle(); " onclick << (options[:focus] ? "$('##{options[:focus]}').focus(); " : "this.blur(); ") onclick << "return false;" - link_to(name, "#", :onclick => onclick,:class => options[:class]) + link_to(name, "javascript:void(0)", :onclick => onclick,:class => options[:class]) end def image_to_function(name, function, html_options = {}) diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index c27546e85..ed2c20448 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -1,13 +1,7 @@ -
  • - + <%= text_area :quote,:quote,:style => 'display:none' %> <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> <% if replying %> diff --git a/app/views/messages/quote.js.erb b/app/views/messages/quote.js.erb index 3d8fe7237..157e20764 100644 --- a/app/views/messages/quote.js.erb +++ b/app/views/messages/quote.js.erb @@ -1,7 +1,7 @@ $('#message_subject').val("<%= raw escape_javascript(@subject) %>"); $('#message_quote').html("<%= raw escape_javascript(@temp.content.html_safe) %>"); //$('#message_content').val("<#%= raw escape_javascript(@content) %>"); -$('#quote_quote').html("<%= raw escape_javascript(@content) %>"); +$('#quote_quote').html("<%= raw escape_javascript(@temp.content.html_safe) %>"); showAndScrollTo("reply", "message_content"); $('#message_content').scrollTop = $('#message_content').scrollHeight - $('#message_content').clientHeight; diff --git a/public/javascripts/course.js b/public/javascripts/course.js index fcb72ee78..2b3ee1f18 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -232,12 +232,12 @@ function course_board_submit_message_replay() function MessageReplayVevify() { var content = message_content_editor.html();//$.trim($("#message_content").val()); if (content.length == 0) { - $("#message_content_span").text("<%= l(:label_reply_empty) %>"); + $("#message_content_span").text("回复不能为空"); $("#message_content_span").css('color', '#ff0000'); return false; } else { - $("#message_content_span").text("<%= l(:label_field_correct) %>"); + $("#message_content_span").text("填写正确"); $("#message_content_span").css('color', '#008000'); return true; } diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index fa9e9787c..00d4e445f 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -451,6 +451,23 @@ a.link_file_board{ background:url(../images/pic_file.png) 0 3px no-repeat !impor filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF); } +blockquote { + /* font-style: italic; */ + border-left: 1px solid #e0e0e0; + border-right: 1px solid #e0e0e0; + border-top: 1px solid #e0e0e0; + border-bottom: 1px solid #e0e0e0; + padding-left: 0.6em; + padding-top: 0.6em; + padding-right: 0.6em; + padding-bottom: 0.6em; + margin-left: 1.4em; + margin-right: 0.4em; + border-radius: 4px; + font-family: "Microsoft YaHei"; + background: url('../images/requirements/reference.jpg'); +} + From ba743c120be84f89958b7ac9ab9b18cd6570a5bf Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 8 Apr 2015 17:58:53 +0800 Subject: [PATCH 14/95] =?UTF-8?q?1=E3=80=81=E8=AF=BE=E7=A8=8B=E7=95=99?= =?UTF-8?q?=E8=A8=80=E5=9B=9E=E5=A4=8D=E6=A1=86=E5=A4=A7=E5=B0=8F=202?= =?UTF-8?q?=E3=80=81=E8=AF=BE=E7=A8=8B=E7=95=99=E8=A8=80=E6=9C=89html?= =?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/courses/_courses_jours.html.erb | 12 ++++--- app/views/courses/_history.html.erb | 7 +---- app/views/courses/feedback.html.erb | 38 ----------------------- 3 files changed, 8 insertions(+), 49 deletions(-) diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb index e79dac59b..ef1d25bd4 100644 --- a/app/views/courses/_courses_jours.html.erb +++ b/app/views/courses/_courses_jours.html.erb @@ -12,11 +12,13 @@ <% else %> <%= form_for('new_form', :method => :post, :url => {:controller => 'words', :action => 'leave_course_message'},:html => {:id=>'leave_message_form'}) do |f|%> - <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> - <%= f.kindeditor 'course_message',:editor_id => 'leave_message_editor',:input_html=>{:id => "leave_meassge",:style => "resize: none;", - :placeholder => "#{l(:label_welcome_my_respond)}",:maxlength => 250}%> - 取  消 - <%= l(:button_leave_meassge)%> + <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> + <%= f.kindeditor 'course_message',:height => '140px;',:editor_id => 'leave_message_editor',:input_html=>{:id => "leave_meassge",:style => "resize: none;", + :placeholder => "#{l(:label_welcome_my_respond)}",:maxlength => 250}%> + 取  消 + + <%= l(:button_leave_meassge)%> + <% end %> <% end %> diff --git a/app/views/courses/_history.html.erb b/app/views/courses/_history.html.erb index 01990602d..a302d0981 100644 --- a/app/views/courses/_history.html.erb +++ b/app/views/courses/_history.html.erb @@ -16,7 +16,7 @@

    - <%= textilizable journal.notes%> + <%= journal.notes.html_safe %>

    @@ -35,11 +35,6 @@ <% end %>
    - <% ids = 'project_respond_form_'+ journal.id.to_s%> <% if reply_allow %>
    diff --git a/app/views/courses/feedback.html.erb b/app/views/courses/feedback.html.erb index 0a8458a22..c45259efd 100644 --- a/app/views/courses/feedback.html.erb +++ b/app/views/courses/feedback.html.erb @@ -9,42 +9,4 @@ :locals => { :contest => @contest, :journals => @jour, :state => false} %> -<% html_title(l(:label_user_response)) -%> - <% html_title(l(:label_course_feedback)) -%> \ No newline at end of file From d08329631aa5c6d5e5dc3606590590439d2a7b61 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 8 Apr 2015 18:10:39 +0800 Subject: [PATCH 15/95] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E8=AE=A8=E8=AE=BA=E5=8C=BA=E5=BC=95=E7=94=A8=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/views/messages/_project_show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb index 01465188c..cbc985c2b 100644 --- a/app/views/messages/_project_show.html.erb +++ b/app/views/messages/_project_show.html.erb @@ -167,7 +167,7 @@
    - <%= textilizable message,:content,:attachments => message.attachments %> + <%= textAreailizable message,:content,:attachments => message.attachments %>
    <%= link_to_attachments message, :author => false %> From c399ab2e4fb9a1322f377ba89307b0f141eecead Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 8 Apr 2015 18:15:58 +0800 Subject: [PATCH 16/95] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=96=B0=E9=97=BB=20?= =?UTF-8?q?=E8=AF=84=E8=AE=BA=E5=86=85=E5=AE=B9=E8=8E=B7=E5=8F=96=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/comments_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index bb84b1fa4..d226000c0 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -27,7 +27,7 @@ class CommentsController < ApplicationController raise Unauthorized unless @news.commentable? @comment = Comment.new - @comment.comments = params[:comment] + @project ? @comment.comments = params[:comment][:comments] : @comment.comments = params[:comment] @comment.author = User.current if @news.comments << @comment if params[:asset_id] From 6612ae357abcebb644d5432b8eca9c5f4eeebc94 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 8 Apr 2015 18:20:27 +0800 Subject: [PATCH 17/95] =?UTF-8?q?=E6=8F=90=E7=A4=BA=E8=A6=81=E4=B8=BA?= =?UTF-8?q?=E4=B8=AD=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/users_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/users_service.rb b/app/services/users_service.rb index 80aa34d45..8f86029d9 100644 --- a/app/services/users_service.rb +++ b/app/services/users_service.rb @@ -192,7 +192,7 @@ class UsersService #raise @current_user.errors.full_message #return @current_user else - raise 'wrong password' + raise l(:notice_account_wrong_password,:locale => 'zh') end @current_user end From 66a7d267c8f847855d09551cf1b050c487f13911 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 8 Apr 2015 18:21:36 +0800 Subject: [PATCH 18/95] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=20=202901?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/courses_service.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 73cf4452d..de72cab7c 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -161,10 +161,15 @@ class CoursesService #显示课程 def show_course(params,current_user) course = Course.find(params[:id]) + if course.school + work_unit = course.school.name + else + work_unit = get_user_work_unit course.teacher + end unless (course.is_public == 1 || current_user.member_of_course?(course) || current_user.admin?) raise '403' end - {:course => course,:img_url => url_to_avatar(course),:current_user_is_member => current_user.member_of_course?(course),:current_user_is_teacher => is_course_teacher(current_user,course)} + {:course => course,:work_unit => work_unit, :img_url => url_to_avatar(course),:current_user_is_member => current_user.member_of_course?(course),:current_user_is_teacher => is_course_teacher(current_user,course)} end #创建课程 From d1b5d28ff0fd4bd970bb10552ec1156a247018a5 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 8 Apr 2015 18:22:16 +0800 Subject: [PATCH 19/95] =?UTF-8?q?2901=20=E5=B7=A5=E4=BD=9C=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/entities/course.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/api/mobile/entities/course.rb b/app/api/mobile/entities/course.rb index 4c91738c1..520f73384 100644 --- a/app/api/mobile/entities/course.rb +++ b/app/api/mobile/entities/course.rb @@ -58,6 +58,7 @@ module Mobile end course_expose :current_user_is_member course_expose :current_user_is_teacher + course_expose :work_unit end end end From a04122bb8e27a51cb5509f61af31d67d469523b1 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 8 Apr 2015 18:22:53 +0800 Subject: [PATCH 20/95] =?UTF-8?q?=E6=8F=90=E7=A4=BA=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E4=B8=AD=E6=96=87=202903?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/apis/auth.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/mobile/apis/auth.rb b/app/api/mobile/apis/auth.rb index fbec9a3b0..9e4cb1bc6 100644 --- a/app/api/mobile/apis/auth.rb +++ b/app/api/mobile/apis/auth.rb @@ -26,7 +26,7 @@ module Mobile present :data, {token: key.access_token, user: api_user}, using: Entities::Auth present :status, 0 else - raise 'Unauthorized.' + raise "无效的用户名或密码" end end From 13273cecf1a02d8bac6949929b66d8dadf886284 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 9 Apr 2015 10:08:47 +0800 Subject: [PATCH 21/95] =?UTF-8?q?app=E7=9A=84=E5=88=9B=E5=BB=BA=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/zh.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 17c445ae8..5a95d1bd3 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2014,6 +2014,8 @@ zh: label_recently_updated_courseware: 最近更新了课件 label_no_courses: 您没有参与任何课程,请搜索课程、加入课程,或者创建课程吧! label_commit_failed: 提交失败 + label_recently: 最近被 + label_creat: 创建 #api end label_end_time: 截止时间 From 590dd0cac5823164d9b580d4cf140597cbddf93e Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 9 Apr 2015 10:09:47 +0800 Subject: [PATCH 22/95] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=BF=99=E4=B8=AAdemo?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E8=A1=A8=E5=88=9B=E5=BB=BA=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20150316032155_create_discuss_demos.rb | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 db/migrate/20150316032155_create_discuss_demos.rb diff --git a/db/migrate/20150316032155_create_discuss_demos.rb b/db/migrate/20150316032155_create_discuss_demos.rb deleted file mode 100644 index af7a2a6ed..000000000 --- a/db/migrate/20150316032155_create_discuss_demos.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateDiscussDemos < ActiveRecord::Migration - def change - create_table :discuss_demos do |t| - t.string :title - t.text :body - t.timestamps - end - end -end From 988f8b79189b33ca76351c2fba41ceaa34e521f7 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 9 Apr 2015 10:33:15 +0800 Subject: [PATCH 23/95] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E9=9D=9E=E9=A1=B9=E7=9B=AE=E4=BF=A1=E6=81=AF=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E8=B7=AF=E7=94=B1=20=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=8C=89=E9=92=AE=E4=BA=8B=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=9A=84=E5=AD=98=E5=82=A8=E4=B8=8E=E4=BF=AE=E6=94=B9=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/settings_controller.rb | 19 +++++++++++++++++++ app/views/settings/edit.html.erb | 4 +++- app/views/settings/hidden_non_project.js.erb | 5 +++++ config/locales/zh.yml | 2 ++ config/routes.rb | 1 + config/settings.yml | 2 ++ 6 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 app/views/settings/hidden_non_project.js.erb diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb index c60d1bd8f..93e0e9c4b 100644 --- a/app/controllers/settings_controller.rb +++ b/app/controllers/settings_controller.rb @@ -29,6 +29,9 @@ class SettingsController < ApplicationController end def edit + hidden_non_project = Setting.find_by_name("hidden_non_project") + @text = (hidden_non_project && hidden_non_project.value == "0") ? l(:label_show_non_project) : l(:label_hidden_non_project) + @notifiables = Redmine::Notifiable.all if request.post? && params[:settings] && params[:settings].is_a?(Hash) settings = (params[:settings] || {}).dup.symbolize_keys @@ -70,4 +73,20 @@ class SettingsController < ApplicationController rescue Redmine::PluginNotFound render_404 end + + #隐藏/显示非项目信息 + def hidden_non_project + @notifiable = Setting.find_by_name("hidden_non_project") + if @notifiable + @notifiable.value == "1" ? @notifiable.value = 0 : @notifiable.value = 1 + @notifiable.save + else + @notifiable = Setting.new() + @notifiable.name = "hidden_non_project" + @notifiable.value = 0 + @notifiable.save + end + + redirect_to settings_url + end end diff --git a/app/views/settings/edit.html.erb b/app/views/settings/edit.html.erb index 8de53f55c..798db291b 100644 --- a/app/views/settings/edit.html.erb +++ b/app/views/settings/edit.html.erb @@ -1,4 +1,6 @@ -

    <%= l(:label_settings) %>

    +

    <%=l(:label_settings)%>

    +<%= link_to @text,settings_hidden_non_project_path,:id => "hidden_non_project",:style => "float: right;margin-right: 60px;margin-top: 9px;"%> +
    <%= render_tabs administration_settings_tabs %> diff --git a/app/views/settings/hidden_non_project.js.erb b/app/views/settings/hidden_non_project.js.erb new file mode 100644 index 000000000..370fea33a --- /dev/null +++ b/app/views/settings/hidden_non_project.js.erb @@ -0,0 +1,5 @@ +<% if @notifiable.value == "0"%> + $("#hidden_non_project").replaceWith("<%= escape_javascript(link_to '显示非项目信息',settings_hidden_non_project_path,:id => 'hidden_non_project',:style => 'float: right;margin-right: 60px;margin-top: 9px;', :remote => true)%>"); +<% else%> + $("#hidden_non_project").replaceWith("<%= escape_javascript(link_to '隐藏非项目信息',settings_hidden_non_project_path,:id => 'hidden_non_project',:style => 'float: right;margin-right: 60px;margin-top: 9px;', :remote => true)%>"); +<% end%> \ No newline at end of file diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 17c445ae8..9cae8b25a 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2031,4 +2031,6 @@ zh: modal_valid_unpassing: 该分班已经存在 mail_footer: 点击修改邮件发送设置 + label_show_non_project: 显示非项目信息 + label_hidden_non_project: 隐藏非项目信息 diff --git a/config/routes.rb b/config/routes.rb index c9220769c..03ed4d2ab 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -736,6 +736,7 @@ RedmineApp::Application.routes.draw do match 'settings', :controller => 'settings', :action => 'index', :via => :get match 'settings/edit', :via => [:get, :post] match 'settings/plugin/:id', :to => 'settings#plugin', :via => [:get, :post], :as => 'plugin_settings' + match 'settings/hidden_non_project', :via => [:get, :post] match 'sys/projects', :via => :get match 'sys/projects/:id/repository', :to => 'sys#create_project_repository', :via => :post diff --git a/config/settings.yml b/config/settings.yml index cd3f2974e..28d6c5dbc 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -266,6 +266,8 @@ repository_domain: default: repository.trustie.net please_chose: default: 请选择 +hidden_non_project: + default: 1 plugin_redmine_ckeditor: serialized: true default: --- !ruby/hash:ActiveSupport::HashWithIndifferentAccess From 78b60efbbeb7571f3bd3808028a7106669a7bbb0 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 9 Apr 2015 10:53:56 +0800 Subject: [PATCH 24/95] =?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=A0=8F=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E9=85=8D=E7=BD=AE=E4=BF=A1=E6=81=AF=E7=A1=AE=E5=AE=9A?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E6=98=BE=E7=A4=BA=E9=9D=9E=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f36e4b397..cfc4545a9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1947,6 +1947,8 @@ module ApplicationHelper end def bootstrap_render_dynamic_nav + hidden_non_project = Setting.find_by_name("hidden_non_project") + visiable = !(hidden_non_project && hidden_non_project.value == "0") main_course_link = link_to l(:label_course_practice), {:controller => 'welcome', :action => 'index', :host => Setting.course_domain} main_project_link = link_to l(:label_project_deposit), {:controller => 'welcome', :action => 'index', :host => Setting.project_domain} @@ -1964,21 +1966,21 @@ module ApplicationHelper #@nav_dispaly_project_label nav_list = Array.new - nav_list.push(school_all_school_link) if @nav_dispaly_course_all_label && @show_course == 1 + nav_list.push(school_all_school_link) if @nav_dispaly_course_all_label && @show_course == 1 && visiable # nav_list.push(course_all_course_link) if @nav_dispaly_course_all_label && @show_course == 1 - nav_list.push(course_teacher_all_link) if @nav_dispaly_teacher_all_label && @show_course == 1 + nav_list.push(course_teacher_all_link) if @nav_dispaly_teacher_all_label && @show_course == 1 && visiable nav_list.push(main_project_link) if @nav_dispaly_main_project_label - nav_list.push(main_course_link) if @nav_dispaly_main_course_label && @show_course == 1 - nav_list.push(main_contest_link) if @nav_dispaly_main_contest_label && @show_contest == 1 + nav_list.push(main_course_link) if @nav_dispaly_main_course_label && @show_course == 1 && visiable + nav_list.push(main_contest_link) if @nav_dispaly_main_contest_label && @show_contest == 1 && visiable - nav_list.push(courses_link) if @nav_dispaly_course_label && @show_course == 1 + nav_list.push(courses_link) if @nav_dispaly_course_label && @show_course == 1 && visiable # nav_list.push(projects_link) if @nav_dispaly_project_label #nav_list.push(users_link) if @nav_dispaly_user_label # nav_list.push(contest_link) if @nav_dispaly_contest_label && @show_contest == 1 - nav_list.push(bids_link) if @nav_dispaly_bid_label - nav_list.push(forum_link) if @nav_dispaly_forum_label - nav_list.push(stores_link) if @nav_dispaly_store_all_label + nav_list.push(bids_link) if @nav_dispaly_bid_label && visiable + nav_list.push(forum_link) if @nav_dispaly_forum_label && visiable + nav_list.push(stores_link) if @nav_dispaly_store_all_label && visiable content_li = '' nav_list.collect do |nav_item| From a737342a66da61144c2c26bc196c7a1de443a0cb Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 9 Apr 2015 11:00:39 +0800 Subject: [PATCH 25/95] =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E4=B8=8B=E6=8B=89=E3=80=81=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E4=B8=8B=E6=A0=87=E7=9A=84=E9=9A=90=E8=97=8F=E9=9D=9E=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E4=BF=A1=E6=81=AF=E7=9A=84=E5=AE=9A=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_header.html.erb | 4 +++- app/views/welcome/_link_to_another.html.erb | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/_base_header.html.erb b/app/views/layouts/_base_header.html.erb index 75c39a407..9eaf7f6ed 100644 --- a/app/views/layouts/_base_header.html.erb +++ b/app/views/layouts/_base_header.html.erb @@ -11,8 +11,10 @@
    +<% end%> \ No newline at end of file From 503d1fc2eec6f55e74c3f0cdb76d69fb625eda6b Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 9 Apr 2015 11:31:41 +0800 Subject: [PATCH 26/95] =?UTF-8?q?=E5=BC=80=E5=90=AF=E5=8C=BF=E8=AF=84?= =?UTF-8?q?=E3=80=81=E5=85=B3=E9=97=AD=E5=8C=BF=E8=AF=84js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/start_anonymous_comment.js.erb | 5 ++--- app/views/bids/stop_anonymous_comment.js.erb | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/views/bids/start_anonymous_comment.js.erb b/app/views/bids/start_anonymous_comment.js.erb index 5b13b2f77..431393a0e 100644 --- a/app/views/bids/start_anonymous_comment.js.erb +++ b/app/views/bids/start_anonymous_comment.js.erb @@ -1,9 +1,8 @@ <% if @statue == 1%> alert('启动成功'); - $("#<%= @bid.id %>_start_anonymous_comment").remove(); - $("#<%= @bid.id %>_anonymous_comment").append('<%= link_to "关闭匿评", alert_anonymous_comment_bid_path(@bid), remote: true, id:"#{@bid.id}_stop_anonymous_comment" %>'); + $("#<%= @bid.id %>_start_anonymous_comment").replaceWith('<%= escape_javascript(link_to "关闭匿评", alert_anonymous_comment_bid_path(@bid), remote: true, id:"#{@bid.id}_stop_anonymous_comment",:class => "fr mr10 work_edit")%>'); <% elsif @statue == 2 %> alert('启动失败\n作业总数大于等于2份时才能启动匿评'); <% elsif @statue == 3%> alert("已开启匿评,请务重复开启"); -<% end %> +<% end %> \ No newline at end of file diff --git a/app/views/bids/stop_anonymous_comment.js.erb b/app/views/bids/stop_anonymous_comment.js.erb index cf2096d3b..393bf59f3 100644 --- a/app/views/bids/stop_anonymous_comment.js.erb +++ b/app/views/bids/stop_anonymous_comment.js.erb @@ -1,2 +1,2 @@ alert('关闭成功'); -$("#<%= @bid.id %>_anonymous_comment").html('匿评结束'); +$("#<%= @bid.id %>_stop_anonymous_comment").replaceWith('匿评结束'); From 4b83296a9771ab5d4187b174149dcdeeb9203c23 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 9 Apr 2015 11:38:13 +0800 Subject: [PATCH 27/95] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=BC=80=E5=90=AF=E3=80=81=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E5=8C=BF=E8=AF=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/stop_anonymous_comment.js.erb | 2 +- app/views/layouts/base_homework.html.erb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/bids/stop_anonymous_comment.js.erb b/app/views/bids/stop_anonymous_comment.js.erb index 393bf59f3..cf22d0623 100644 --- a/app/views/bids/stop_anonymous_comment.js.erb +++ b/app/views/bids/stop_anonymous_comment.js.erb @@ -1,2 +1,2 @@ alert('关闭成功'); -$("#<%= @bid.id %>_stop_anonymous_comment").replaceWith('匿评结束'); +$("#<%= @bid.id %>_stop_anonymous_comment").replaceWith('匿评结束'); diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb index 27a8e67f4..dd7db06de 100644 --- a/app/views/layouts/base_homework.html.erb +++ b/app/views/layouts/base_homework.html.erb @@ -32,8 +32,10 @@ padding-left: 5px !important; padding-right: 5px !important; line-height: 1.9; + float: left; } .span_wping a:hover{ background-color:#03a1b3;} + .span_wping_background{background: #CCC !important;} From 6abdc4c7e16726a60f9514b125184c90946a022f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 9 Apr 2015 14:29:35 +0800 Subject: [PATCH 28/95] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=88=90=E5=91=98?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=95=8C=E9=9D=A2=EF=BC=8C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E7=9C=9F=E5=AE=9E=E5=A7=93=E5=90=8D=EF=BC=8C?= =?UTF-8?q?=E6=97=A0=E7=9C=9F=E5=AE=9E=E5=A7=93=E5=90=8D=E7=9A=84=E8=94=A1?= =?UTF-8?q?=E5=85=88=E7=94=9Flogin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 5 +++-- app/views/courses/_member.html.erb | 2 +- public/stylesheets/courses.css | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index cfc4545a9..095d0ada5 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -132,9 +132,10 @@ module ApplicationHelper def link_to_user_header user,canShowRealName=false,options={} if user.is_a?(User) if canShowRealName - name = h(user.realname(options[:format])) + name = user.show_name + name = user.login if name == "" else - name = h(user.name(options[:format])) + name = user.login end link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => options[:class] else diff --git a/app/views/courses/_member.html.erb b/app/views/courses/_member.html.erb index 53e7c15a5..a4b5bae6e 100644 --- a/app/views/courses/_member.html.erb +++ b/app/views/courses/_member.html.erb @@ -1,6 +1,6 @@ <% @members.each do |member| %>
  • - <%= link_to_user_header member.principal,false,:class => "w150 c_orange fl" %> + <%= link_to_user_header member.principal,true,:class => "w150 c_orange fl" %> <%= h member.roles.sort.collect(&:to_s).join(', ') %> <%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member), diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 00d4e445f..cfb27e20b 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -243,7 +243,7 @@ a:hover.tijiao{ background:#0f99a9;} .members_left ul li a{ float:left; text-align:center;} .members_left ul li span{ float:left; text-align:center; color:#484747;} -.w150{ text-align:center; width:150px;} +.w150{ text-align:center; width:150px;min-height: 10px;} .f_b{ font-weight: bold;} .members_right label{ margin-left:15px;} .N_search{ height:20px; border:1px solid #999;} From 0743ac2c7876a958ee17ef30b0c38fc1d2b54994 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 9 Apr 2015 14:32:14 +0800 Subject: [PATCH 29/95] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=88=90=E5=91=98?= =?UTF-8?q?=E9=85=8D=E7=BD=AE-=E6=B7=BB=E5=8A=A0=E6=88=90=E5=91=98?= =?UTF-8?q?=EF=BC=9A=E6=B2=A1=E6=9C=89=E6=90=9C=E7=B4=A2=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E5=88=99=E6=98=BE=E7=A4=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/members_helper.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/helpers/members_helper.rb b/app/helpers/members_helper.rb index 29ba94924..c8e8bd87b 100644 --- a/app/helpers/members_helper.rb +++ b/app/helpers/members_helper.rb @@ -44,7 +44,11 @@ module MembersHelper # add by nwb # 课程可添加的成员列表 def render_principals_for_new_course_members(course) - scope = Principal.active.sorted.not_member_of_course(course).like(params[:q]) + if params[:q] && params[:q] != "" + scope = Principal.active.sorted.not_member_of_course(course).like(params[:q]) + else + scope = [] + end principals = paginateHelper scope,10 s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5', :id => 'principals') From 4fbbd7ceb7f1cdc563ed596f0b968961ba9fe4fd Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 9 Apr 2015 14:41:17 +0800 Subject: [PATCH 30/95] =?UTF-8?q?=E5=85=AC=E5=85=B1=E8=B4=B4=E5=90=A7?= =?UTF-8?q?=EF=BC=8C=E6=8F=8F=E8=BF=B0=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_forums.html.erb | 2 +- app/views/layouts/base_memos.html.erb | 2 +- app/views/memos/show.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/base_forums.html.erb b/app/views/layouts/base_forums.html.erb index a7e2ef08a..f12b3186d 100644 --- a/app/views/layouts/base_forums.html.erb +++ b/app/views/layouts/base_forums.html.erb @@ -53,7 +53,7 @@