From f96fbe51504f89db879163d675992f7144e8520c Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 3 Apr 2015 14:35:50 +0800 Subject: [PATCH 01/28] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E4=B8=80=E8=A1=8C?= =?UTF-8?q?=E4=B8=8D=E9=9C=80=E8=A6=81=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/api.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/mobile/api.rb b/app/api/mobile/api.rb index 3673d623c..4724b0bc0 100644 --- a/app/api/mobile/api.rb +++ b/app/api/mobile/api.rb @@ -41,7 +41,7 @@ module Mobile mount Apis::Comments #add_swagger_documentation ({api_version: 'v1', base_path: 'http://u06.shellinfo.cn/trustie/api'}) - add_swagger_documentation ({api_version: 'v1', base_path: '/api'}) if Rails.env.development? + #add_swagger_documentation ({api_version: 'v1', base_path: '/api'}) if Rails.env.development? end end 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 02/28] =?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 452e2999668e772b05c6dc06ead87b99ad2b778b Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 3 Apr 2015 15:08:52 +0800 Subject: [PATCH 03/28] =?UTF-8?q?=E5=88=A0=E9=99=A4demo=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/discuss_demo.rb | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 app/models/discuss_demo.rb diff --git a/app/models/discuss_demo.rb b/app/models/discuss_demo.rb deleted file mode 100644 index 6ed8d15b6..000000000 --- a/app/models/discuss_demo.rb +++ /dev/null @@ -1,4 +0,0 @@ -class DiscussDemo < ActiveRecord::Base - attr_accessible :title, :body - has_many_kindeditor_assets :assets, :dependent => :destroy -end From 717463076cdb9ed44a43f06b43449e8af89c6bc8 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 3 Apr 2015 15:09:46 +0800 Subject: [PATCH 04/28] =?UTF-8?q?=E5=88=A0=E9=99=A4democontroller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/discuss_demos_controller.rb | 42 --------------------- 1 file changed, 42 deletions(-) delete mode 100644 app/controllers/discuss_demos_controller.rb diff --git a/app/controllers/discuss_demos_controller.rb b/app/controllers/discuss_demos_controller.rb deleted file mode 100644 index b0c9791cb..000000000 --- a/app/controllers/discuss_demos_controller.rb +++ /dev/null @@ -1,42 +0,0 @@ -class DiscussDemosController < ApplicationController - def index - - @discuss_demo_list = DiscussDemo.where("body is not null").order("created_at desc").page(params[:page] || 1).per(10) - end - - def new - @discuss_demo = DiscussDemo.create - @discuss_demo.save! - @discuss_demo - end - - def create - - end - - def update - @discuss_demo = DiscussDemo.find(params[:id]) - @discuss_demo.update_attributes(:title => params[:discuss_demo][:title],:body => params[:discuss_demo][:body]) - redirect_to :controller=> 'discuss_demos',:action => 'show',:id => params[:id] - end - - def delete - - end - - def destroy - asset = Kindeditor::Asset.find_by_owner_id(params[:id]) - if !asset.nil? - filepath = File.join(Rails.root,"public","files","uploads", - asset[:created_at].to_s.gsub("+0800","").to_datetime.strftime("%Y%m").to_s, - asset[:asset].to_s) - File.delete(filepath) if File.exist?filepath - end - DiscussDemo.destroy(params[:id]) - redirect_to :controller=> 'discuss_demos',:action => 'index' - end - - def show - @discuss_demo = DiscussDemo.find(params[:id]) - end -end From 5299d2d33270bdc09292640171757210c8da63b6 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 3 Apr 2015 15:13:51 +0800 Subject: [PATCH 05/28] =?UTF-8?q?=E5=88=A0=E9=99=A4demo=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/discuss_demos/index.html.erb | 25 ------------------------- app/views/discuss_demos/new.html.erb | 7 ------- app/views/discuss_demos/show.html.erb | 3 --- config/routes.rb | 1 - 4 files changed, 36 deletions(-) delete mode 100644 app/views/discuss_demos/index.html.erb delete mode 100644 app/views/discuss_demos/new.html.erb delete mode 100644 app/views/discuss_demos/show.html.erb diff --git a/app/views/discuss_demos/index.html.erb b/app/views/discuss_demos/index.html.erb deleted file mode 100644 index b24937357..000000000 --- a/app/views/discuss_demos/index.html.erb +++ /dev/null @@ -1,25 +0,0 @@ -

    文章列表

    -
    - - <% @discuss_demo_list.each do |e| %> - - - - - - - - - - <% end %> -
    <%= truncate(e.title,:length => 50) %> - <%= truncate(e.body,:length => 50) %>   - - <%= link_to '查看文章',{:controller => 'discuss_demos',:action => 'show',:id=>e.id} %> - -    - <%= link_to '删除文章',discuss_demo_path(e.id), :method => :delete,:confirm => l(:text_are_you_sure) %> -
    - <% paginate @discuss_demo_list %> - <%= link_to '新建文章',new_discuss_demo_path %> -
    \ No newline at end of file diff --git a/app/views/discuss_demos/new.html.erb b/app/views/discuss_demos/new.html.erb deleted file mode 100644 index 8cf1630e2..000000000 --- a/app/views/discuss_demos/new.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -<%= javascript_include_tag src='/assets/kindeditor/kindeditor' %> -

    新建文章

    -<%= form_for @discuss_demo,:url => {:controller => 'discuss_demos',:action => "show",:id =>@discuss_demo.id, :method => :put} do |f| %> - <%= f.text_field :title %> - <%= f.kindeditor :body ,:owner_id => @discuss_demo.id%> - <%= f.submit :value=> '提交' %> -<% end %> \ No newline at end of file diff --git a/app/views/discuss_demos/show.html.erb b/app/views/discuss_demos/show.html.erb deleted file mode 100644 index 4b6bd3cee..000000000 --- a/app/views/discuss_demos/show.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -

    <%= @discuss_demo.title %>

    -<%= textAreailizable @discuss_demo.body %> -<%=link_to "返回首页",discuss_demos_path %> \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index d702ba24c..c9220769c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -27,7 +27,6 @@ RedmineApp::Application.routes.draw do - resources :discuss_demos #match '/discuss_demos/new',:to => 'discuss_demo#create',:via =>[:post] #match '/discuss_demo/show',:to => 'discuss_demo#show' mount Mobile::API => '/api' 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 06/28] =?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 07/28] =?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 6e0de61458ddf403eb21d7db5e5443a565c09afb Mon Sep 17 00:00:00 2001 From: whimlex Date: Fri, 3 Apr 2015 16:13:31 +0800 Subject: [PATCH 08/28] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AE=A8=E8=AE=BA?= =?UTF-8?q?=E5=8C=BA=E5=9B=9E=E5=A4=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/boards/_project_show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb index 7ddd37ad6..e69fa2730 100644 --- a/app/views/boards/_project_show.html.erb +++ b/app/views/boards/_project_show.html.erb @@ -69,7 +69,7 @@ 添加于<%= format_time topic.created_on %> - 回复<%= link_to (topic.replies_count), board_message_path(@board, topic), :style =>"color:#fff;" %> + <%= link_to (l(:label_reply) + topic.replies_count.to_s), board_message_path(@board, topic), :style =>"color:#fff;" %>
    <% end %> From 1009f7ac073f1fc9c3f0ab892a7b97fcbbe38781 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 3 Apr 2015 16:35:46 +0800 Subject: [PATCH 09/28] =?UTF-8?q?=E8=B5=84=E6=BA=90id=E5=88=A4=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/comments_controller.rb | 6 ++++-- app/controllers/forums_controller.rb | 12 ++++++++---- app/controllers/messages_controller.rb | 13 ++++++++----- app/controllers/news_controller.rb | 6 ++++-- app/controllers/words_controller.rb | 6 ++++-- 5 files changed, 28 insertions(+), 15 deletions(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 0d1c39104..bb84b1fa4 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -30,8 +30,10 @@ class CommentsController < ApplicationController @comment.comments = params[:comment] @comment.author = User.current if @news.comments << @comment - ids = params[:asset_id].split(',') - update_kindeditor_assets_owner ids,@comment.id,OwnerTypeHelper::COMMENT + if params[:asset_id] + ids = params[:asset_id].split(',') + update_kindeditor_assets_owner ids,@comment.id,OwnerTypeHelper::COMMENT + end flash[:notice] = l(:label_comment_added) end diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index f59704a62..253e1d28d 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -63,8 +63,10 @@ class ForumsController < ApplicationController respond_to do |format| if @memo.save - ids = params[:asset_id].split(',') - update_kindeditor_assets_owner ids ,@memo.id,OwnerTypeHelper::MEMO + if params[:asset_id] + ids = params[:asset_id].split(',') + update_kindeditor_assets_owner ids ,@memo.id,OwnerTypeHelper::MEMO + end #end format.html { redirect_to (forum_memo_url(@forum, (@memo.parent_id.nil? ? @memo : @memo.parent_id))), notice: "#{l :label_memo_create_succ}" } format.json { render json: @memo, status: :created, location: @memo } @@ -170,8 +172,10 @@ class ForumsController < ApplicationController # Author lizanle # Description after save后需要进行资源记录的更新 # owner_type = 2 对应的是 forum - ids = params[:asset_id].split(',') - update_kindeditor_assets_owner ids ,@forum.id,OwnerTypeHelper::FORUM + if params[:asset_id] + ids = params[:asset_id].split(',') + update_kindeditor_assets_owner ids ,@forum.id,OwnerTypeHelper::FORUM + end #end respond_to do |format| diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 2ad388f41..c58ebf851 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -87,9 +87,10 @@ class MessagesController < ApplicationController @message.save_attachments(params[:attachments]) if @message.save # 更新kindeditor上传的图片资源所有者 - ids = params[:asset_id].split(',') - update_kindeditor_assets_owner ids,@message.id,OwnerTypeHelper::MESSAGE - + if params[:asset_id] + ids = params[:asset_id].split(',') + update_kindeditor_assets_owner ids,@message.id,OwnerTypeHelper::MESSAGE + end call_hook(:controller_messages_new_after_save, { :params => params, :message => @message}) render_attachment_warning_if_needed(@message) redirect_to board_message_url(@board, @message) @@ -121,8 +122,10 @@ class MessagesController < ApplicationController @topic.children << @reply #@topic.update_attribute(:updated_on, Time.now) if !@reply.new_record? - ids = params[:asset_id].split(',') - update_kindeditor_assets_owner ids,@reply.id,OwnerTypeHelper::MESSAGE + if params[:asset_id] + ids = params[:asset_id].split(',') + update_kindeditor_assets_owner ids,@reply.id,OwnerTypeHelper::MESSAGE + end call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply}) attachments = Attachment.attach_files(@reply, params[:attachments]) render_attachment_warning_if_needed(@reply) diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index 27c4aa37f..d41491349 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -137,8 +137,10 @@ class NewsController < ApplicationController @news.safe_attributes = params[:news] @news.save_attachments(params[:attachments]) if @news.save - ids = params[:asset_id].split(',') - update_kindeditor_assets_owner ids,@news.id,OwnerTypeHelper::NEWS + if params[:asset_id] + ids = params[:asset_id].split(',') + update_kindeditor_assets_owner ids,@news.id,OwnerTypeHelper::NEWS + end render_attachment_warning_if_needed(@news) flash[:notice] = l(:notice_successful_create) redirect_to course_news_index_url(@course) diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index de2fbc732..680a13963 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -209,8 +209,10 @@ class WordsController < ApplicationController message = params[:new_form][:course_message] feedback = Course.add_new_jour(user, message, params[:id]) if(feedback.errors.empty?) - ids = params[:asset_id].split(',') - update_kindeditor_assets_owner ids,feedback[:id],OwnerTypeHelper::JOURNALSFORMESSAGE + if params[:asset_id] + ids = params[:asset_id].split(',') + update_kindeditor_assets_owner ids,feedback[:id],OwnerTypeHelper::JOURNALSFORMESSAGE + end redirect_to course_feedback_url(params[:id]), notice: l(:label_feedback_success) else flash[:error] = feedback.errors.full_messages[0] From 84c2e39e6c6642ceda85c296fed9581f5482dcfe Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 3 Apr 2015 17:06:19 +0800 Subject: [PATCH 10/28] =?UTF-8?q?=E6=96=B0=E9=97=BB=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E9=94=99=E8=AF=AF=E3=80=82=E8=AF=AF=E5=B0=86?= =?UTF-8?q?safe=5Fattributes=E6=8D=A2=E4=B8=BA=E7=9B=B4=E6=8E=A5=E5=B1=9E?= =?UTF-8?q?=E6=80=A7comments?= 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..57ad9d4ce 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] + @comment.safe_attributes = params[:comment] @comment.author = User.current if @news.comments << @comment if params[:asset_id] From 7b09fd0489e237dfedc7b2449f22d57ea6c81a3d Mon Sep 17 00:00:00 2001 From: whimlex Date: Fri, 3 Apr 2015 17:33:33 +0800 Subject: [PATCH 11/28] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E9=80=89=E6=8B=A9=E5=99=A8=E9=80=89=E6=8B=A9=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=90=8E=E4=B8=8D=E8=83=BD=E8=87=AA=E5=8A=A8=E5=85=B3?= =?UTF-8?q?=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/course.js | 8 +++++++- public/javascripts/iPass.packed.js | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 public/javascripts/iPass.packed.js diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 3536478a8..5758a8412 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -404,4 +404,10 @@ $(function(){ //将右侧的最小高度设置成左侧高度,美化界面 $(document).ready(function () { $("#RSide").css("min-height",$("#LSide").height()-30); -}); \ No newline at end of file +}); + +// 日历选择日期后关闭 +function regexDeadLine() +{ + ('#ui-datepicker-div').hide; +} \ No newline at end of file diff --git a/public/javascripts/iPass.packed.js b/public/javascripts/iPass.packed.js new file mode 100644 index 000000000..d553a9c31 --- /dev/null +++ b/public/javascripts/iPass.packed.js @@ -0,0 +1,8 @@ +// ---------------------------------------------------------------------- // +// iPass - Iphone-like masked password input +// version 1.0 +// author: pixelboi8 (pixelboi8@gmail.com) +// created: 12/12/2010 +// ---------------------------------------------------------------------- // + +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(8($){$.1e.1l=8(D){2 c={\'I\':1r,\'1a\':1q,\'e\':\'%1w\'};5(D){$.1p(c,D)}2 v=[];2 l=[];2 T=1n 1s(\'[^\'+c[\'e\']+\']\',\'1v\');2 i=0;4.W(8(6){2 G=\'-\'+6;2 t=$(4);2 3=4.3;2 q=4.q;2 h=3+G;2 11=3+G;5(!3||!q){1t("1m 1d 1c \'3\' 1b \'q\' 1f w 1g!");12 16}$(\'\').1M(t);2 A=$(\'#\'+h);2 g=$(\'#\'+h)[0];5(4.x){g.x=4.x}5(4.F){g.F=4.F}5(4.E){g.E=4.E}5(4.z&&4.z!=\'-1\'){g.z=4.z}5(4.N){g.N=4.N}5(4.H){g.H=4.H}5(4.B){g.B=4.B}5(4.L){g.L=4.L}4.x=\'\';4.B=\'\';t.1O();A.Z(\'1J\',8(){2 m=A.j();v[6]=V(8(){M(6,3,h,m)},c[\'I\'])});A.Z(\'1A\',8(){e(6,h);18(v[6])});$(\'X\').W(8(){5(4.J==3){4.J=h}n 5(t[0].13.1y.1C()==\'X\'){t[0].13.J=h}})});M=8(6,r,3,m){2 o=$(\'#\'+3).j();5(o!=m){19(6,r,3)}n{e(6,3)}m=o;v[6]=V(8(){M(6,r,3,m)},c[\'I\'])};19=8(6,r,3){2 7=P(3);2 K=16;2 p=$(\'#\'+3);2 C=$(\'#\'+r);2 9=p.j().17(\'\');2 d=C.j().17(\'\');5(l[6]){18(l[6]);l[6]=10}w(i=0;i<9.f;i++){5(9[i]!=d[i]){5(9[i]!=u(c[\'e\'])){d.O(i,0,9[i])}n{d[i]=d[i]}}n{d.O(i,0,9[i])}}5(9.f Date: Tue, 7 Apr 2015 15:45:39 +0800 Subject: [PATCH 12/28] =?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 60838460fc245ed81793c4b6dc07d7fa75945f96 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 7 Apr 2015 16:32:53 +0800 Subject: [PATCH 13/28] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=9A=84=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E5=8A=A8=E6=80=81=E4=B9=9F=E8=A6=81=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/courses_service.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 7c1f14104..73cf4452d 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -373,6 +373,16 @@ class CoursesService unless latest_bid.nil? latest_course_dynamics << {:type => 4,:time => latest_bid.updated_on,:message => l(:label_recently_updated_homework,:locale => get_user_language(current_user))} end + + # Time 2015-04-07 14:58:30 + # Author lizanle + # Description 添加课程创建动态 + if(User.find_by_id(CourseInfos.find_by_course_id(course.id).try(:user_id))) + create_user_name = User.find_by_id(CourseInfos.find_by_course_id(course.id).user_id).realname + latest_course_dynamics << {:type => 5,:time => course.created_at,:message =>l(:label_recently,:locale => get_user_language(current_user)) << create_user_name << l(:label_creat,:locale => get_user_language(current_user))} + end + + #每个作业中的最新留言 messages = [] course.homeworks.each do |bid| 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 14/28] =?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 15/28] =?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 15567e7d7bf5163b1f106979fa1b679ce29e7956 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 8 Apr 2015 14:14:44 +0800 Subject: [PATCH 16/28] =?UTF-8?q?1=E3=80=81=E6=96=B0=E7=9A=84=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E8=B5=B7=E6=9C=AA=E5=AF=B9=E5=85=B6=202=E3=80=81?= =?UTF-8?q?=E8=80=81=E5=B8=88=E6=96=B0=E5=BB=BA=E4=BD=9C=E4=B8=9A=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0marting-bottom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/_new_homework_form.html.erb | 2 +- .../vendor/assets/javascripts/kindeditor/kindeditor.js | 2 +- public/assets/kindeditor/kindeditor.js | 2 +- public/stylesheets/courses.css | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/bids/_new_homework_form.html.erb b/app/views/bids/_new_homework_form.html.erb index 505fc88a8..129bcec5e 100644 --- a/app/views/bids/_new_homework_form.html.erb +++ b/app/views/bids/_new_homework_form.html.erb @@ -11,7 +11,7 @@

  • -
  • +
  • <% if edit_mode %> diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/kindeditor.js b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/kindeditor.js index e58e4b2be..d5dd1e443 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 ke-container-' + self.themeType).css('width', width); + .addClass('ke-container ml56 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 680899eee..9bdcff891 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 ke-container-' + self.themeType).css('width', width); + .addClass('ke-container ml56 ke-container-' + self.themeType).css('width', width); if (fullscreenMode) { container.css({ position : 'absolute', diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index c60fca5cc..b9202279c 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -316,6 +316,7 @@ a:hover.st_img { border:1px solid #1c9ec7; } .st_boxlist ul li a span{ color:#1c9ec7;} .st_boxlist ul li a:hover span{ color:#ff8e15;} .ml50{ margin-left:50px;} +.ml56{ margin-left:56px !important;} .ml358{ margin-left:358px;} .ml258{ margin-left:254px;} .ml65{ margin-left:65px;} From 657b022baaffd204c19acd87d405d1ca6ba63eba Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 8 Apr 2015 14:24:42 +0800 Subject: [PATCH 17/28] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/homework.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/courses/homework.html.erb b/app/views/courses/homework.html.erb index 98440abab..cbb5d6fc1 100644 --- a/app/views/courses/homework.html.erb +++ b/app/views/courses/homework.html.erb @@ -32,7 +32,7 @@
    - <%= 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 20/28] =?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 21/28] =?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 | 63 +++++++----------------- 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, 54 insertions(+), 62 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 22/28] =?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 23/28] =?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 24/28] =?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 25/28] =?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 26/28] =?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 27/28] =?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 28/28] =?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