From 3476731b83a418fa31153866e64245a6ecb16554 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Wed, 9 Dec 2015 09:59:13 +0800 Subject: [PATCH 01/66] =?UTF-8?q?=E5=B0=86at=20js=20data=E6=95=B4=E5=90=88?= =?UTF-8?q?=E5=88=B0=E6=96=87=E4=BB=B6=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/at_controller.rb | 25 +++++++++++++++++++++++ app/controllers/issues_controller.rb | 29 ++++++++++----------------- app/helpers/application_helper.rb | 10 +-------- app/views/at/show.js.erb | 8 ++++++++ app/views/issues/show.html.erb | 2 +- config/routes.rb | 3 ++- public/assets/kindeditor/at/config.js | 5 ++--- 7 files changed, 50 insertions(+), 32 deletions(-) create mode 100644 app/controllers/at_controller.rb create mode 100644 app/views/at/show.js.erb diff --git a/app/controllers/at_controller.rb b/app/controllers/at_controller.rb new file mode 100644 index 000000000..92506d4e8 --- /dev/null +++ b/app/controllers/at_controller.rb @@ -0,0 +1,25 @@ +#coding=utf-8 + +class AtController < ApplicationController + respond_to :js + + def show + type = params[:type] + case type + when "Issue" + @users = find_issue(params) + else + end + end + + private + def find_issue(params) + #1. issues list persons + #2. project persons + issue = Issue.find(params[:id]) + journals = issue.journals + at_persons = journals.map(&:user) + issue.project.users + at_persons.uniq{|u| u.id}.delete_if{|u| u.id == User.current.id} + end + +end \ No newline at end of file diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 7cdc838e2..6f441c29a 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -142,24 +142,17 @@ class IssuesController < ApplicationController @project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'#by young @available_watchers = (@issue.project.users.sort + @issue.watcher_users).uniq - #id name email - #1. issues list persons - #2. project persons - @at_persons = @journals.map(&:user) + @issue.project.users - @at_persons = @at_persons.uniq{|u| u.id}.delete_if{|u| u.id == User.current.id} - @at_persons = nil - - respond_to do |format|`` - format.html { - retrieve_previous_and_next_issue_ids - render :template => 'issues/show', :layout => @project_base_tag#by young - } - format.api - format.atom { render :template => 'journals/index', :layout => false, :content_type => 'application/atom+xml' } - format.pdf { - pdf = issue_to_pdf(@issue, :journals => @journals) - send_data(pdf, :type => 'application/pdf', :filename => filename_for_content_disposition("#{@project.identifier}-#{@issue.id}.pdf") ) - } + respond_to do |format| + format.html { + retrieve_previous_and_next_issue_ids + render :template => 'issues/show', :layout => @project_base_tag#by young + } + format.api + format.atom { render :template => 'journals/index', :layout => false, :content_type => 'application/atom+xml' } + format.pdf { + pdf = issue_to_pdf(@issue, :journals => @journals) + send_data(pdf, :type => 'application/pdf', :filename => filename_for_content_disposition("#{@project.identifier}-#{@issue.id}.pdf") ) + } end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ba8fe4f53..227de930f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2624,15 +2624,7 @@ int main(int argc, char** argv){ opt = {enable_at: true, prettify: false, init_activity: false}.merge default_opt ss = '' if opt[:enable_at] - ss = '" + ss += %Q|| end ss += javascript_include_tag("/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg') diff --git a/app/views/at/show.js.erb b/app/views/at/show.js.erb new file mode 100644 index 000000000..df253f237 --- /dev/null +++ b/app/views/at/show.js.erb @@ -0,0 +1,8 @@ +(function(){ + window.atPersonLists = []; + <% @users && @users.each_with_index do |person,index| %> + var o = {id: <%=index%>, name: '<%=person.show_name%>', login: '<%=person.login%>', searchKey: '<%=person.get_at_show_name%>'}; + atPersonLists.push(o); + <% end %> + +})(); diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 80d3aaac1..67d1186c4 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -1,5 +1,5 @@ <%= content_for(:header_tags) do %> -<%= import_ke(enable_at: true) %> +<%= import_ke(enable_at: {id: @issue.id, type: 'Issue'}) %> <% end %>
diff --git a/config/routes.rb b/config/routes.rb index 59eb29d70..656f55720 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1035,13 +1035,14 @@ RedmineApp::Application.routes.draw do match 'system_log/clear' ##ended by lizanle - resources :git_callback do collection do post 'post_update' end end + resources :at + Dir.glob File.expand_path("plugins/*", Rails.root) do |plugin_dir| file = File.join(plugin_dir, "config/routes.rb") if File.exists?(file) diff --git a/public/assets/kindeditor/at/config.js b/public/assets/kindeditor/at/config.js index b9769c42e..0a1bbf11a 100644 --- a/public/assets/kindeditor/at/config.js +++ b/public/assets/kindeditor/at/config.js @@ -1,4 +1,4 @@ -function enableAt(_editor) { +var enableAt = function(_editor) { var editor = _editor; if(editor.edit == undefined || editor.edit.iframe == undefined){ return; @@ -11,7 +11,7 @@ function enableAt(_editor) { console.log("enable at"); $.fn.atwho.debug = true; - if(!atPersonLists){ + if("undefined" === (typeof atPersonLists) || !atPersonLists){ return; } var names = atPersonLists; @@ -32,7 +32,6 @@ function enableAt(_editor) { } $inputor = $(ifrBody).atwho(at_config); - window.aaa= $inputor; $inputor.caret('pos', 47); $inputor.focus().atwho('run'); }; From e9cfe007bbe4bcc1f160a6c0377a11bf8f94ddb9 Mon Sep 17 00:00:00 2001 From: houxiang Date: Thu, 10 Dec 2015 15:59:31 +0800 Subject: [PATCH 02/66] modify by hx --- Gemfile | 2 +- app/controllers/repositories_controller.rb | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index 0125e9d60..deecb67e3 100644 --- a/Gemfile +++ b/Gemfile @@ -44,7 +44,7 @@ group :development do gem 'grape-swagger' gem 'better_errors', '~> 1.1.0' gem 'rack-mini-profiler', '~> 0.9.3' - gem 'win32console' + #gem 'win32console' end group :development, :test do diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index dd3f4ede9..db303af53 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -346,10 +346,6 @@ update # end # end - - - - @changesets = g.commits(@project.gpid) # @changesets = @repository.latest_changesets(@path, @rev) # @changesets_count = @repository.latest_changesets(@path, @rev).count @@ -406,7 +402,7 @@ update count = count_commits(@project.gpid , 25 , 50)+ 25 * 20 elsif g.commits(@project.gpid , :page=>75).count ==0 count = count_commits(@project.gpid , 50 , 75)+ 50 * 20 - elsif g.commits(@project.gpid , :page=>100).count== 0 + elsif g.commits(@project.gpid , :page=>100).count==0 count = count_commits(@project.gpid , 75 , 100) + 75 * 20 elsif g.commits(@project.gpid , :page=>125).count==0 count = count_commits(@project.gpid , 100 , 125) + 100 * 20 From 91b245ad2cb694726996c31811276b5129a0be7e Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Sat, 12 Dec 2015 18:06:59 +0800 Subject: [PATCH 03/66] =?UTF-8?q?lastname=E4=B8=BA=E7=A9=BA=E6=97=B6?= =?UTF-8?q?=E4=B9=9F=E5=8F=AF=E4=BB=A5=E5=8A=A0,=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E7=9C=81=E6=8E=89=E6=9F=A5=E8=AF=A2extensions=E7=9A=84?= =?UTF-8?q?=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/user.rb | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 65c0bf858..0d3d465e2 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -399,16 +399,7 @@ class User < Principal end def show_name - name = "" - unless self.user_extensions.nil? - if self.user_extensions.identity == 2 - name = firstname - else - name = lastname+firstname - end - else - name = lastname+firstname - end + name = lastname + firstname name.empty? || name.nil? ? login : name end ## end From f61f639af2fe13598a74d1e35507470b15d735e1 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Mon, 14 Dec 2015 17:13:57 +0800 Subject: [PATCH 04/66] =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E4=B8=BAremote=20js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/at_controller.rb | 134 ++++++++++++++++-- app/helpers/application_helper.rb | 19 ++- app/views/at/show.js.erb | 8 -- app/views/at/show.json.erb | 6 + app/views/bids/_new_homework_form.html.erb | 4 +- app/views/blog_comments/_edit.html.erb | 6 +- app/views/blog_comments/_reply_form.html.erb | 6 +- app/views/blog_comments/quote.js.erb | 2 +- app/views/blog_comments/reply.js.erb | 4 +- app/views/blog_comments/show.html.erb | 2 +- app/views/blogs/_article_list.html.erb | 2 +- app/views/boards/_course_new.html.erb | 6 +- app/views/boards/_course_show.html.erb | 2 +- app/views/comments/create.js.erb | 2 +- app/views/courses/_course_activity.html.erb | 6 +- app/views/courses/_courses_jours.html.erb | 5 +- app/views/courses/syllabus.html.erb | 4 +- .../start_anonymous_comment.js.erb | 4 +- .../stop_anonymous_comment.js.erb | 4 +- app/views/issues/_edit.html.erb | 5 +- app/views/issues/_form.html.erb | 2 +- app/views/issues/add_journal.js.erb | 2 +- app/views/issues/add_journal_in_org.js.erb | 2 +- app/views/issues/new.html.erb | 2 +- app/views/issues/show.html.erb | 2 +- app/views/memos/show.html.erb | 2 +- app/views/messages/_course_show.html.erb | 2 +- app/views/messages/quote.js.erb | 2 +- app/views/messages/reply.js.erb | 2 +- .../_reply_form.html.erb | 2 +- .../org_document_comments/add_reply.js.erb | 2 +- .../org_document_comments/index.html.erb | 2 +- app/views/org_document_comments/quote.js.erb | 2 +- app/views/org_document_comments/show.html.erb | 2 +- .../organizations/_org_activities.html.erb | 2 +- app/views/organizations/show.html.erb | 2 +- .../forbidden_anonymous_comment.js.erb | 4 +- app/views/student_work/set_score_rule.js.erb | 4 +- app/views/users/_user_activities.html.erb | 6 +- app/views/users/_user_homework_form.html.erb | 6 +- app/views/users/_user_homework_list.html.erb | 6 +- app/views/words/create_reply.js.erb | 2 +- app/views/words/leave_homework_message.js.erb | 4 +- .../lib/rails_kindeditor/helper.rb | 13 +- public/assets/kindeditor/at/config.js | 17 ++- .../javascripts/init_activity_KindEditor.js | 9 +- 46 files changed, 242 insertions(+), 92 deletions(-) delete mode 100644 app/views/at/show.js.erb create mode 100644 app/views/at/show.json.erb diff --git a/app/controllers/at_controller.rb b/app/controllers/at_controller.rb index 92506d4e8..3759abf53 100644 --- a/app/controllers/at_controller.rb +++ b/app/controllers/at_controller.rb @@ -1,25 +1,143 @@ #coding=utf-8 class AtController < ApplicationController - respond_to :js + respond_to :json def show - type = params[:type] + @logger = Logger.new(Rails.root.join('log', 'at.log').to_s) + users = find_at_users(params[:type], params[:id]) + @users = users.uniq { |u| u.id }.delete_if { |u| u.id == User.current.id } + end + + private + def find_at_users(type, id) + @logger.info("#{type}, #{id}") case type when "Issue" - @users = find_issue(params) + find_issue(id) + when 'Project' + find_project(id) + when 'Course' + find_course(id) + when 'Activity', 'CourseActivity', 'ForgeActivity','UserActivity', 'OrgActivity','PrincipalActivity' + find_activity(id, type) + when 'Attachment' + find_attachment(id) + when 'Message' + find_message(id) else + nil end end - private - def find_issue(params) + def find_issue(id) #1. issues list persons #2. project persons - issue = Issue.find(params[:id]) - journals = issue.journals + issue = Issue.find(id) + journals = issue.journals at_persons = journals.map(&:user) + issue.project.users - at_persons.uniq{|u| u.id}.delete_if{|u| u.id == User.current.id} + at_persons.uniq { |u| u.id }.delete_if { |u| u.id == User.current.id } + end + + def find_project(id) + at_persons = Project.find(id).users + at_persons.delete_if { |u| u.id == User.current.id } + end + + def find_course(id) + at_persons = Course.find(id).users + at_persons.delete_if { |u| u.id == User.current.id } + end + + def find_activity(id, type) + + ## 基本上是本类型中的 加上所属类型的用户 + case type + when 'Activity' + activity = Activity.find(id) + (find_at_users(activity.act_type, activity.act_id) ||[]) + + (find_at_users(activity.activity_container_type, activity.activity_container_id) || []) + when 'CourseActivity' + activity = CourseActivity.find(id) + (find_at_users(activity.course_act_type, activity.course_act_id) || []) + (find_course(activity.course.id) || []) + when 'ForgeActivity' + activity = ForgeActivity.find(id) + (find_at_users(activity.forge_act_type, activity.forge_act_id) ||[]) + + (find_project(activity.project_id) || []) + when 'UserActivity' + activity = UserActivity.find(id) + (find_at_users(activity.act_type, activity.act_id) || []) + + (find_at_users(activity.container_type, activity.container_id) || []) + when 'OrgActivity' + activity = OrgActivity.find(id) + (find_at_users(activity.org_act_type, activity.org_act_id) || []) + + (find_at_users(activity.container_type, activity.container_id) || []) + when 'PrincipalActivity' + activity = PrincipalActivity.find(id) + find_at_users(activity.principal_act_type, activity.principal_act_id) + else + nil + end + end + + #作业应该是关联课程,取课程的用户列表 + def find_homework(id) + homework = HomeworkCommon.find(id) + find_course(homework.course_id) + end + + def find_attachment(id) + attachment = Attachment.find(id) + find_at_users(attachment.container_type, attachment.container_id) + end + + #Message + def find_message(id) + message = Message.find(id) + at_persons = message.board.messages.map(&:author) + + end + + #News + def find_news(id) + find_project(News.find(id).project_id) + end + + #JournalsForMessage + def find_journals_for_message(id) + jounrnal = JournalsForMessage.find(id) + find_at_users(jounrnal.jour_type, jounrnal.jour_id) + end + + #Poll + def find_poll(id) + end + + #Journal + def find_journal(id) + journal = Journal.find(id) + find_at_users(journal.journalized_type, journal.journalized_id) + end + + #Document + def find_document(id) + find_project(Document.find(id).project_id) + end + + #ProjectCreateInfo + def find_project_create_info(id) + + end + + #Principal + def find_principal(id) + + end + + #BlogComment + def find_blog_comment(id) + blog = BlogComment.find(id).blog + blog.users end end \ No newline at end of file diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 227de930f..98249dbc8 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1716,6 +1716,13 @@ module ApplicationHelper # def javascript_include_tag(*sources) options = sources.last.is_a?(Hash) ? sources.pop : {} + + @sources ||= [] + sources = sources.delete_if do|source| + @sources.include?(source) + end + @sources += sources + if plugin = options.delete(:plugin) sources = sources.map do |source| if plugin @@ -1725,7 +1732,12 @@ module ApplicationHelper end end end - super sources, options + + if sources && !sources.empty? + super(sources, options) + else + '' + end end def content_for(name, content = nil, &block) @@ -2621,11 +2633,8 @@ int main(int argc, char** argv){ end def import_ke(default_opt={}) - opt = {enable_at: true, prettify: false, init_activity: false}.merge default_opt + opt = {enable_at: false, prettify: false, init_activity: false}.merge default_opt ss = '' - if opt[:enable_at] - ss += %Q|| - end ss += javascript_include_tag("/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg') if opt[:enable_at] diff --git a/app/views/at/show.js.erb b/app/views/at/show.js.erb deleted file mode 100644 index df253f237..000000000 --- a/app/views/at/show.js.erb +++ /dev/null @@ -1,8 +0,0 @@ -(function(){ - window.atPersonLists = []; - <% @users && @users.each_with_index do |person,index| %> - var o = {id: <%=index%>, name: '<%=person.show_name%>', login: '<%=person.login%>', searchKey: '<%=person.get_at_show_name%>'}; - atPersonLists.push(o); - <% end %> - -})(); diff --git a/app/views/at/show.json.erb b/app/views/at/show.json.erb new file mode 100644 index 000000000..7af729ff7 --- /dev/null +++ b/app/views/at/show.json.erb @@ -0,0 +1,6 @@ +[ + <% @users && @users.each_with_index do |person,index| %> + {"id": <%=index%>, "name": "<%=person.show_name%>", "login": "<%=person.login%>", "searchKey": "<%=person.get_at_show_name%>"} + <%= index != @users.size-1 ? ',' : '' %> + <% end %> +] diff --git a/app/views/bids/_new_homework_form.html.erb b/app/views/bids/_new_homework_form.html.erb index 5958fccff..815ff27e4 100644 --- a/app/views/bids/_new_homework_form.html.erb +++ b/app/views/bids/_new_homework_form.html.erb @@ -15,10 +15,10 @@ <% if edit_mode %> - <%= f.kindeditor :description,:width=>'91%',:editor_id => 'bid_description_editor',:owner_id => bid.id,:owner_type =>OwnerTypeHelper::BID,:resizeType => 0 %> + <%= f.kindeditor :description,:width=>'91%',:editor_id => 'bid_description_editor',:owner_id => bid.id,:owner_type =>OwnerTypeHelper::BID,:resizeType => 0,act_id: @course.id, act_type: @course.class.to_s %> <% else %> <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> - <%= f.kindeditor :description,:width=>'91%',:editor_id => 'bid_description_editor',:resizeType => 0 %> + <%= f.kindeditor :description,:width=>'91%',:editor_id => 'bid_description_editor',:resizeType => 0, act_id: @course.id, act_type: @course.class.to_s %> <% end %>
diff --git a/app/views/blog_comments/_edit.html.erb b/app/views/blog_comments/_edit.html.erb index c7065ece4..048402635 100644 --- a/app/views/blog_comments/_edit.html.erb +++ b/app/views/blog_comments/_edit.html.erb @@ -1,5 +1,5 @@ <%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false) %> + <%= import_ke(enable_at: true, prettify: false) %> <%= javascript_include_tag 'blog' %> <% end %> @@ -34,7 +34,9 @@ :class => 'talk_text fl', :input_html => { :id => 'message_content', :class => 'talk_text fl', - :maxlength => 5000 }%> + :maxlength => 5000 }, + act_id: article.id, act_type: article.class.to_s + %>

diff --git a/app/views/blog_comments/_reply_form.html.erb b/app/views/blog_comments/_reply_form.html.erb index 32f4333c2..67642069c 100644 --- a/app/views/blog_comments/_reply_form.html.erb +++ b/app/views/blog_comments/_reply_form.html.erb @@ -1,5 +1,5 @@ <%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false) %> + <%= import_ke(enable_at: true, prettify: false) %> <% end %>
  • @@ -27,7 +27,9 @@ :minHeight=>100, :input_html => { :id => 'message_content', :class => 'talk_text fl', - :maxlength => 5000 }%> + :maxlength => 5000 }, + at_id: article.id, at_type: article.class.to_s + %>

  • diff --git a/app/views/blog_comments/quote.js.erb b/app/views/blog_comments/quote.js.erb index 088b2cf67..cd53707d5 100644 --- a/app/views/blog_comments/quote.js.erb +++ b/app/views/blog_comments/quote.js.erb @@ -3,7 +3,7 @@ if($("#reply_message_<%= @blogComment.id%>").length > 0) { $(function(){ $('#reply_subject').val("<%= raw escape_javascript(@subject) %>"); $('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>"); - init_activity_KindEditor_data(<%= @blogComment.id%>,null,"85%"); + init_activity_KindEditor_data(<%= @blogComment.id%>,null,"85%", "<%=@blogComment.class.to_s%>"); }); }else if($("#reply_to_message_<%= @blogComment.id%>").length >0) { $("#reply_to_message_<%= @blogComment.id%>").replaceWith("

    "); diff --git a/app/views/blog_comments/reply.js.erb b/app/views/blog_comments/reply.js.erb index 1cb64b2b5..06adca74d 100644 --- a/app/views/blog_comments/reply.js.erb +++ b/app/views/blog_comments/reply.js.erb @@ -1,7 +1,7 @@ <% if @in_user_center%> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>"); - init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%"); + init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity'); <% else%> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'blogs/article', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>"); -init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%"); +init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity'); <% end %> \ No newline at end of file diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb index e46a7249f..aa984c621 100644 --- a/app/views/blog_comments/show.html.erb +++ b/app/views/blog_comments/show.html.erb @@ -27,7 +27,7 @@ } } $(function() { - init_activity_KindEditor_data(<%= @article.id%>,null,"85%"); + init_activity_KindEditor_data(<%= @article.id%>,null,"85%", '<%=@article.class.to_s%>'); showNormalImage('message_description_<%= @article.id %>'); }); diff --git a/app/views/blogs/_article_list.html.erb b/app/views/blogs/_article_list.html.erb index a91dd8151..f6383c95b 100644 --- a/app/views/blogs/_article_list.html.erb +++ b/app/views/blogs/_article_list.html.erb @@ -74,7 +74,7 @@ } $(function () { - init_activity_KindEditor_data(<%= topic.id%>, null, "87%"); + init_activity_KindEditor_data(<%= topic.id%>, null, "87%", "<%=topic.class.to_s%>"); showNormalImage('activity_description_<%= topic.id %>'); /*var description_images=$("div#activity_description_<%#= topic.id %>").find("img"); if (description_images.length>0) { diff --git a/app/views/boards/_course_new.html.erb b/app/views/boards/_course_new.html.erb index e4cf57ae3..31cdf41eb 100644 --- a/app/views/boards/_course_new.html.erb +++ b/app/views/boards/_course_new.html.erb @@ -1,5 +1,5 @@ <%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false) %> + <%= import_ke(enable_at: true, prettify: false) %> <% end %> <%= error_messages_for 'message' %> @@ -34,7 +34,9 @@ :class => 'talk_text fl', :input_html => { :id => 'message_content', :class => 'talk_text fl', - :maxlength => 5000 }%> + :maxlength => 5000 }, + at_id: topic.id, at_type: topic.class.to_s + %>

    diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index 306a0c7ce..074da9af1 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -74,7 +74,7 @@ } $(function () { - init_activity_KindEditor_data(<%= topic.id%>, null, "87%"); + init_activity_KindEditor_data(<%= topic.id%>, null, "87%", "<%=topic.class.to_s%>"); showNormalImage('activity_description_<%= topic.id %>'); /*var description_images=$("div#activity_description_<%#= topic.id %>").find("img"); if (description_images.length>0) { diff --git a/app/views/comments/create.js.erb b/app/views/comments/create.js.erb index ea904a63f..c3942ee38 100644 --- a/app/views/comments/create.js.erb +++ b/app/views/comments/create.js.erb @@ -1,3 +1,3 @@ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>"); -init_activity_KindEditor_data('<%= @user_activity_id%>',"","87%"); +init_activity_KindEditor_data('<%= @user_activity_id%>',"","87%", "UserActivity"); diff --git a/app/views/courses/_course_activity.html.erb b/app/views/courses/_course_activity.html.erb index b4c560fa4..d31b28bc0 100644 --- a/app/views/courses/_course_activity.html.erb +++ b/app/views/courses/_course_activity.html.erb @@ -1,5 +1,5 @@ <%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false, init_activity: true) %> + <%= import_ke(enable_at: true, prettify: false, init_activity: true) %> <% end %> <%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false, init_activity: true) %> + <%= import_ke(enable_at: true, prettify: false, init_activity: true) %> <% end %> - diff --git a/app/views/courses/syllabus.html.erb b/app/views/courses/syllabus.html.erb index f4b8ce8a4..9d20b5adb 100644 --- a/app/views/courses/syllabus.html.erb +++ b/app/views/courses/syllabus.html.erb @@ -1,6 +1,6 @@ <%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false, init_activity: true) %> + <%= import_ke(enable_at: true, prettify: false, init_activity: true) %> <%= javascript_include_tag 'blog' %> <% end %> @@ -40,7 +40,7 @@ } } $(function() { - init_activity_KindEditor_data(<%= @article.id%>,null,"87%"); + init_activity_KindEditor_data(<%= @article.id%>,null,"87%", "<%=@article.class.to_s%>"); showNormalImage('message_description_<%= @article.id %>'); }); diff --git a/app/views/homework_common/start_anonymous_comment.js.erb b/app/views/homework_common/start_anonymous_comment.js.erb index ea63ea12c..ffeda2cb5 100644 --- a/app/views/homework_common/start_anonymous_comment.js.erb +++ b/app/views/homework_common/start_anonymous_comment.js.erb @@ -2,10 +2,10 @@ alert('启动成功'); <% if @user_activity_id == -1 %> $("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>"); - init_activity_KindEditor_data(<%= @homework.id%>,"","87%"); + init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>"); <% else %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>"); - init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%"); + init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity"); <% end %> /*$("#<%#= @homework.id %>_start_anonymous_comment").replaceWith('<%#= escape_javascript(link_to "关闭匿评", alert_anonymous_comment_homework_common_path(@homework), remote: true, id:"#{@homework.id}_stop_anonymous_comment",:class => "postOptionLink")%>');*/ <% elsif @statue == 2 %> diff --git a/app/views/homework_common/stop_anonymous_comment.js.erb b/app/views/homework_common/stop_anonymous_comment.js.erb index 214a157dc..308e8a39f 100644 --- a/app/views/homework_common/stop_anonymous_comment.js.erb +++ b/app/views/homework_common/stop_anonymous_comment.js.erb @@ -1,10 +1,10 @@ alert('关闭成功'); <% if @user_activity_id == -1 %> $("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>"); -init_activity_KindEditor_data(<%= @homework.id%>,"","87%"); +init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>"); <% else %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>"); -init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%"); +init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity'); <% end %> /* $("#<%#= @homework.id %>_stop_anonymous_comment").replaceWith('');*/ diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb index b8f362429..05793ea7c 100644 --- a/app/views/issues/_edit.html.erb +++ b/app/views/issues/_edit.html.erb @@ -1,8 +1,7 @@ <%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> + <%= import_ke(enable_at: true, prettify: false, init_activity: false) %> <% end %> - <%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true} do |f| %> <%= error_messages_for 'issue', 'time_entry' %> <%= render :partial => 'conflict' if @conflict %> @@ -24,7 +23,7 @@
    回复 - <%= f.kindeditor :notes, :style => "width:99%;",:height=>'100px', :cssData =>"blockquote { padding:0px}", :rows => "5", :no_label => true, :editor_id=>'issue_journal_kind_reply' %> + <%= f.kindeditor :notes, :style => "width:99%;",:height=>'100px', :cssData =>"blockquote { padding:0px}", :rows => "5", :no_label => true, :editor_id=>'issue_journal_kind_reply', at_id: @issue.id, at_type: @issue.class.to_s %>
    diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb index 0d5c876f1..c1d2a841b 100644 --- a/app/views/issues/_form.html.erb +++ b/app/views/issues/_form.html.erb @@ -49,7 +49,7 @@ <%= f.label_for_field :description, :required => @issue.required_attribute?('description'), :no_label => true, :class => "label" %> <%#= link_to_function image_tag('edit.png'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %> <%#= content_tag 'span', :id => "issue_description_and_toolbar" do %> - <%= f.kindeditor :description,:editor_id => "issue_desc_editor", :width=>'87%', :resizeType => 0, :no_label => true %> + <%= f.kindeditor :description,:editor_id => "issue_desc_editor", :width=>'87%', :resizeType => 0, :no_label => true,at_id: @project.id, at_type: @project.class.to_s %> <%# end %> <%#= wikitoolbar_for 'issue_description' %> <% end %> diff --git a/app/views/issues/add_journal.js.erb b/app/views/issues/add_journal.js.erb index 0b1c02b88..8ff5a71f1 100644 --- a/app/views/issues/add_journal.js.erb +++ b/app/views/issues/add_journal.js.erb @@ -1,3 +1,3 @@ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>"); -init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%"); \ No newline at end of file +init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity"); \ No newline at end of file diff --git a/app/views/issues/add_journal_in_org.js.erb b/app/views/issues/add_journal_in_org.js.erb index ad7a85540..34e874f13 100644 --- a/app/views/issues/add_journal_in_org.js.erb +++ b/app/views/issues/add_journal_in_org.js.erb @@ -1,3 +1,3 @@ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>"); -init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%"); \ No newline at end of file +init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity"); \ No newline at end of file diff --git a/app/views/issues/new.html.erb b/app/views/issues/new.html.erb index 9c6ad647c..c4daedaa4 100644 --- a/app/views/issues/new.html.erb +++ b/app/views/issues/new.html.erb @@ -1,5 +1,5 @@ <%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> + <%= import_ke(enable_at: true, prettify: false, init_activity: false) %> <% end %> diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 67d1186c4..80d3aaac1 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -1,5 +1,5 @@ <%= content_for(:header_tags) do %> -<%= import_ke(enable_at: {id: @issue.id, type: 'Issue'}) %> +<%= import_ke(enable_at: true) %> <% end %>
    diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 44f3e5a64..b7cc1a0c2 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -34,7 +34,7 @@ } } $(function() { - init_activity_KindEditor_data(<%= @memo.id%>,null,"87%"); + init_activity_KindEditor_data(<%= @memo.id%>,null,"87%", "<%=@memo.class.to_s%>"); }); function del_confirm(){ diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index 0f39b73d2..e06c04775 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -27,7 +27,7 @@ } } $(function() { - init_activity_KindEditor_data(<%= @topic.id%>,null,"85%"); + init_activity_KindEditor_data(<%= @topic.id%>,null,"85%", "<%=@topic.class.to_s%>"); showNormalImage('message_description_<%= @topic.id %>'); }); diff --git a/app/views/messages/quote.js.erb b/app/views/messages/quote.js.erb index eee820c61..b0e8ecb85 100644 --- a/app/views/messages/quote.js.erb +++ b/app/views/messages/quote.js.erb @@ -11,7 +11,7 @@ if($("#reply_message_<%= @message.id%>").length > 0) { $(function(){ $('#reply_subject').val("<%= raw escape_javascript(@subject) %>"); $('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>"); - init_activity_KindEditor_data(<%= @message.id%>,null,"85%"); + init_activity_KindEditor_data(<%= @message.id%>,null,"85%", "<%=@message.class.to_s%>"); }); }else if($("#reply_to_message_<%= @message.id%>").length >0) { $("#reply_to_message_<%= @message.id%>").replaceWith("

    "); diff --git a/app/views/messages/reply.js.erb b/app/views/messages/reply.js.erb index ac80de3b4..518479344 100644 --- a/app/views/messages/reply.js.erb +++ b/app/views/messages/reply.js.erb @@ -3,4 +3,4 @@ <%elsif @course%> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>"); <%end%> -init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%"); \ No newline at end of file +init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity"); \ No newline at end of file diff --git a/app/views/org_document_comments/_reply_form.html.erb b/app/views/org_document_comments/_reply_form.html.erb index 7871b910d..8808ff8b7 100644 --- a/app/views/org_document_comments/_reply_form.html.erb +++ b/app/views/org_document_comments/_reply_form.html.erb @@ -1,2 +1,2 @@ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>"); -init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%"); +init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity"); diff --git a/app/views/org_document_comments/add_reply.js.erb b/app/views/org_document_comments/add_reply.js.erb index 40ed2eeb2..84f8c1f83 100644 --- a/app/views/org_document_comments/add_reply.js.erb +++ b/app/views/org_document_comments/add_reply.js.erb @@ -1,3 +1,3 @@ $("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document, :act => @act}) %>"); -init_activity_KindEditor_data(<%= @act.id %>,"","87%"); \ No newline at end of file +init_activity_KindEditor_data(<%= @act.id %>,"","87%", "<%=@act.class.to_s%>"); \ No newline at end of file diff --git a/app/views/org_document_comments/index.html.erb b/app/views/org_document_comments/index.html.erb index 331e61bfd..ddbb6bf9c 100644 --- a/app/views/org_document_comments/index.html.erb +++ b/app/views/org_document_comments/index.html.erb @@ -19,7 +19,7 @@ <% @documents.each do |document| %> <%= render :partial => 'organizations/show_org_document', :locals => {:document => document, :act => OrgActivity.where("org_act_type='OrgDocumentComment'and org_act_id=?", document.id).first} %> diff --git a/app/views/org_document_comments/quote.js.erb b/app/views/org_document_comments/quote.js.erb index a71b23f0e..7ea5daf7b 100644 --- a/app/views/org_document_comments/quote.js.erb +++ b/app/views/org_document_comments/quote.js.erb @@ -3,7 +3,7 @@ if($("#reply_message_<%= @org_comment.id%>").length > 0) { $(function(){ $('#reply_subject').val("<%= raw escape_javascript(@subject) %>"); $('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>"); - init_activity_KindEditor_data(<%= @org_comment.id%>,null,"85%"); + init_activity_KindEditor_data(<%= @org_comment.id%>,null,"85%", "<%=@org_comment.class.to_s%>"); }); }else if($("#reply_to_message_<%= @org_comment.id %>").length >0) { $("#reply_to_message_<%= @org_comment.id%>").replaceWith("

    "); diff --git a/app/views/org_document_comments/show.html.erb b/app/views/org_document_comments/show.html.erb index 1b1eca418..3a50e5faa 100644 --- a/app/views/org_document_comments/show.html.erb +++ b/app/views/org_document_comments/show.html.erb @@ -5,7 +5,7 @@ diff --git a/app/views/organizations/_org_activities.html.erb b/app/views/organizations/_org_activities.html.erb index 33ac13e76..8f9acbc7b 100644 --- a/app/views/organizations/_org_activities.html.erb +++ b/app/views/organizations/_org_activities.html.erb @@ -2,7 +2,7 @@ <% org_activities.each do |act| %> <% if act.container_type == 'Organization' %> diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index 7200761a3..9d62dd1f9 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -59,7 +59,7 @@ <% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 %> <% act = OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?", @organization.home_id).first %> diff --git a/app/views/student_work/forbidden_anonymous_comment.js.erb b/app/views/student_work/forbidden_anonymous_comment.js.erb index a72c29509..47dfb4b51 100644 --- a/app/views/student_work/forbidden_anonymous_comment.js.erb +++ b/app/views/student_work/forbidden_anonymous_comment.js.erb @@ -1,7 +1,7 @@ <% if @user_activity_id == -1 %> $("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>"); -init_activity_KindEditor_data(<%= @homework.id%>,"","87%"); +init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>"); <% else %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>"); -init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%"); +init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity"); <% end %> \ No newline at end of file diff --git a/app/views/student_work/set_score_rule.js.erb b/app/views/student_work/set_score_rule.js.erb index ff3a0e7ed..180f04faa 100644 --- a/app/views/student_work/set_score_rule.js.erb +++ b/app/views/student_work/set_score_rule.js.erb @@ -1,8 +1,8 @@ clickCanel(); <% if @user_activity_id %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id}) %>"); - init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%"); + init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity"); <% else %> $("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework,:is_in_course => @is_in_course}) %>"); - init_activity_KindEditor_data(<%= @homework.id%>,"","87%"); + init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>"); <% end %> \ No newline at end of file diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index 4f1d3a5d8..557b9e9ee 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -1,12 +1,12 @@ <%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false, init_activity: true) %> + <%= import_ke(enable_at: true, prettify: false, init_activity: true) %> <% end %> <%= content_for(:header_tags) do %> <%= import_ke(enable_at: true, prettify: false, init_activity: true) %> + <%= javascript_include_tag "init_KindEditor" %> <% end %> \ No newline at end of file + +<% end %> \ No newline at end of file From 85bc9ce43d4a6a02bfef40cc317fc7adbd89c03e Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 18 Dec 2015 14:30:25 +0800 Subject: [PATCH 28/66] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E7=9A=84=E4=B8=80=E4=BA=9Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_upload_subfield_file.html.erb | 2 +- app/views/org_document_comments/edit.html.erb | 2 +- app/views/organizations/_join_course_menu.html.erb | 8 ++++---- app/views/organizations/_join_project_menu.html.erb | 8 ++++---- app/views/organizations/_org_members.html.erb | 2 +- app/views/organizations/join_course_menu.js.erb | 2 +- app/views/organizations/join_courses.js.erb | 11 ++++++----- app/views/organizations/join_project_menu.js.erb | 2 +- app/views/organizations/join_projects.js.erb | 11 ++++++----- 9 files changed, 25 insertions(+), 23 deletions(-) diff --git a/app/views/files/_upload_subfield_file.html.erb b/app/views/files/_upload_subfield_file.html.erb index 7137e14e7..33e4ce97c 100644 --- a/app/views/files/_upload_subfield_file.html.erb +++ b/app/views/files/_upload_subfield_file.html.erb @@ -9,7 +9,7 @@ <%= form_tag(org_subfield_files_path(org_subfield, :in_org => params[:in_org]), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %> <% if params[:in_org] %>
    - 软件 |  + 软件 |  媒体 |  代码 |  其他 diff --git a/app/views/org_document_comments/edit.html.erb b/app/views/org_document_comments/edit.html.erb index 700211433..33244ef14 100644 --- a/app/views/org_document_comments/edit.html.erb +++ b/app/views/org_document_comments/edit.html.erb @@ -15,7 +15,7 @@ } } -
    +
    编辑文章
    diff --git a/app/views/organizations/_join_course_menu.html.erb b/app/views/organizations/_join_course_menu.html.erb index 08488d6cd..c480e851c 100644 --- a/app/views/organizations/_join_course_menu.html.erb +++ b/app/views/organizations/_join_course_menu.html.erb @@ -87,10 +87,10 @@ url: "/organizations/"+orgId + "/join_courses?" + $("#join_courses_form").serialize(), type: "post", success: function (data) { - $.ajax({ - url: "/organizations/" + orgId + "/search_courses?name=" + $("input[name='courses']").val().trim(), - type: "get" - }); +// $.ajax({ +// url: "/organizations/" + orgId + "/search_courses?name=" + $("input[name='courses']").val().trim(), +// type: "get" +// }); } }); } diff --git a/app/views/organizations/_join_project_menu.html.erb b/app/views/organizations/_join_project_menu.html.erb index 20b04ab34..3d2055ec9 100644 --- a/app/views/organizations/_join_project_menu.html.erb +++ b/app/views/organizations/_join_project_menu.html.erb @@ -83,10 +83,10 @@ url: "/organizations/"+orgId + "/join_projects?" + $("#join_projects_form").serialize(), type: "post", success: function (data) { - $.ajax({ - url: "/organizations/" + orgId + "/search_projects?name=" + $("input[name='projects']").val().trim(), - type: "get" - }); +// $.ajax({ +// url: "/organizations/" + orgId + "/search_projects?name=" + $("input[name='projects']").val().trim(), +// type: "get" +// }); } }); } diff --git a/app/views/organizations/_org_members.html.erb b/app/views/organizations/_org_members.html.erb index ee15e19d7..53618fc92 100644 --- a/app/views/organizations/_org_members.html.erb +++ b/app/views/organizations/_org_members.html.erb @@ -1,5 +1,5 @@ <%= stylesheet_link_tag 'courses' %> -
    +

    组织成员

    diff --git a/app/views/organizations/join_course_menu.js.erb b/app/views/organizations/join_course_menu.js.erb index 9812d412b..0c9d3f49e 100644 --- a/app/views/organizations/join_course_menu.js.erb +++ b/app/views/organizations/join_course_menu.js.erb @@ -4,7 +4,7 @@ $('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_course_men showModal('ajax-modal', '320px'); $('#ajax-modal').siblings().hide(); $('#ajax-modal').before( - ""); + ""); //$('#ajax-modal').css('position','absolute') $('#ajax-modal').css("top","").css("left",""); $('#ajax-modal').parent().addClass("resourceSharePopup"); diff --git a/app/views/organizations/join_courses.js.erb b/app/views/organizations/join_courses.js.erb index dbe8b23ff..5f18d192d 100644 --- a/app/views/organizations/join_courses.js.erb +++ b/app/views/organizations/join_courses.js.erb @@ -1,6 +1,7 @@ -$("#homepageLeftMenuCourses").html(""); -$("#homepageLeftMenuCourses").append("
      "); -$("#homepageLeftMenuCourses").append("<%= escape_javascript(render :partial => 'layouts/org_courses', +//$("#homepageLeftMenuCourses").html(""); +//$("#homepageLeftMenuCourses").append("
        "); +//$("#homepageLeftMenuCourses").append("<%#= escape_javascript(render :partial => 'layouts/org_courses', :locals=>{:courses=>@organization.courses.reorder('created_at').uniq.limit(5),:org_id=>@organization.id,:page=> 1}) %>"); -$("#homepageLeftMenuCourses").append("
      "); -$("#homepageLeftMenuCourses").show(); \ No newline at end of file +//$("#homepageLeftMenuCourses").append("
    "); +//$("#homepageLeftMenuCourses").show(); +location.reload(); \ No newline at end of file diff --git a/app/views/organizations/join_project_menu.js.erb b/app/views/organizations/join_project_menu.js.erb index 81bd802a4..86c8f32e1 100644 --- a/app/views/organizations/join_project_menu.js.erb +++ b/app/views/organizations/join_project_menu.js.erb @@ -4,7 +4,7 @@ $('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_project_me showModal('ajax-modal', '320px'); $('#ajax-modal').siblings().hide(); $('#ajax-modal').before( - ""); + ""); //$('#ajax-modal').css('position','absolute'); $('#ajax-modal').css("top","").css("left",""); $('#ajax-modal').parent().addClass("resourceSharePopup"); diff --git a/app/views/organizations/join_projects.js.erb b/app/views/organizations/join_projects.js.erb index 53a9e4a02..c08a3c86e 100644 --- a/app/views/organizations/join_projects.js.erb +++ b/app/views/organizations/join_projects.js.erb @@ -1,6 +1,7 @@ -$("#homepageLeftMenuProjects").html(""); -$("#homepageLeftMenuProjects").append("
      "); -$("#homepageLeftMenuProjects").append("<%= escape_javascript(render :partial => 'layouts/org_projects', +//$("#homepageLeftMenuProjects").html(""); +//$("#homepageLeftMenuProjects").append("
        "); +//$("#homepageLeftMenuProjects").append("<%#= escape_javascript(render :partial => 'layouts/org_projects', :locals=>{:projects=>@organization.projects.reorder('created_at').uniq.limit(5),:org_id=>@organization.id,:page=> 1}) %>"); -$("#homepageLeftMenuProjects").append("
      "); -$("#homepageLeftMenuProjects").show(); \ No newline at end of file +//$("#homepageLeftMenuProjects").append("
    "); +//$("#homepageLeftMenuProjects").show(); +location.reload(); \ No newline at end of file From 70f93741d65b7c66a677f3650100faace107cc47 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 18 Dec 2015 14:38:04 +0800 Subject: [PATCH 29/66] =?UTF-8?q?issue=E5=9B=BE=E6=A0=87=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/_detail.html.erb | 15 ++++++++++++++- app/views/users/_project_issue.html.erb | 14 +++++++++++++- db/schema.rb | 2 +- public/stylesheets/courses.css | 7 +++++++ public/stylesheets/new_user.css | 8 +++++++- public/stylesheets/project.css | 9 ++++++++- 6 files changed, 50 insertions(+), 5 deletions(-) diff --git a/app/views/issues/_detail.html.erb b/app/views/issues/_detail.html.erb index b175bd417..664dcfa75 100644 --- a/app/views/issues/_detail.html.erb +++ b/app/views/issues/_detail.html.erb @@ -3,7 +3,20 @@ <%= link_to image_tag(url_to_avatar(@issue.author), :width => 46, :height => 46), user_path(@issue.author), :class => "ping_dispic" %>
    -

    <%= @issue.subject %> +

    + <% case @issue.tracker_id %> + <% when 1%> + + <% when 2%> + + <% when 3%> + + <% when 4%> + + <% when 5%> + + <% end %> + <%= @issue.subject %> <%= get_issue_priority(@issue.priority_id)[1] %>


    diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 88b880ada..7767fedc7 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -13,7 +13,19 @@ <%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%>
    - <%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey" %> + <% case activity.tracker_id %> + <% when 1%> + + <% when 2%> + + <% when 3%> + + <% when 4%> + + <% when 5%> + + <% end %> + <%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey ml5" %> <%= get_issue_priority(activity.priority_id)[1] %> diff --git a/db/schema.rb b/db/schema.rb index c0d4da2f8..9c7702aa2 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20151217051447) do +ActiveRecord::Schema.define(:version => 20151218022014) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 6a6c3a7e7..463fc710a 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -1231,3 +1231,10 @@ div.disable_link {background-color: #c1c1c1 !important;} /*新课程资源库*/ .reCon{ margin:5px; width:710px;} .reTop{width:710px; height:40px; background:#eaeaea; padding:5px;} + +/*问题状态图片*/ +.issues{ background:url(../images/public_icon.png) -66px 5px no-repeat; width:18px; height:21px;} +.duty{ background:url(../images/public_icon.png) -66px -18px no-repeat; width:18px; height:21px;} +.support{ background:url(../images/public_icon.png) -66px -45px no-repeat; width:18px; height:21px;} +.function{ background:url(../images/public_icon.png) -66px -70px no-repeat; width:18px; height:21px;} +.weekly{ background:url(../images/public_icon.png) -66px -95px no-repeat; width:18px; height:21px;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index bf69e4bb7..9b6f4f9fe 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1383,6 +1383,12 @@ a:hover.blueCir{ background:#3598db; color:#fff;} .mr150 {margin-right:150px;} /* @功能 定义 */ span.at {color:#269ac9;} -======= + .relatePInfo {position:absolute; background-color:#ffffff; padding:3px 8px; white-space:nowrap; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); z-index:999; color:#585858; cursor:pointer; display:none;} +/*问题状态图片*/ +.issues{ background:url(../images/public_icon.png) -66px 5px no-repeat; width:18px; height:21px;} +.duty{ background:url(../images/public_icon.png) -66px -18px no-repeat; width:18px; height:21px;} +.support{ background:url(../images/public_icon.png) -66px -45px no-repeat; width:18px; height:21px;} +.function{ background:url(../images/public_icon.png) -66px -70px no-repeat; width:18px; height:21px;} +.weekly{ background:url(../images/public_icon.png) -66px -95px no-repeat; width:18px; height:21px;} diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 1663df30f..f9c9c6c86 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -1084,4 +1084,11 @@ a.link_file_a{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-l a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} .imageFuzzy {filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity:0.5;opacity: 0.5;} .ReplyToMessageInputContainer {width: 582px;float: left;} -.ReplyToMessageContainer {border-bottom:1px solid #e3e3e3; width:632px; margin:0px auto; margin-top:15px; min-height:60px;} \ No newline at end of file +.ReplyToMessageContainer {border-bottom:1px solid #e3e3e3; width:632px; margin:0px auto; margin-top:15px; min-height:60px;} + +/*问题状态图片*/ +.issues{ background:url(../images/public_icon.png) -66px 5px no-repeat; width:18px; height:21px;} +.duty{ background:url(../images/public_icon.png) -66px -18px no-repeat; width:18px; height:21px;} +.support{ background:url(../images/public_icon.png) -66px -45px no-repeat; width:18px; height:21px;} +.function{ background:url(../images/public_icon.png) -66px -70px no-repeat; width:18px; height:21px;} +.weekly{ background:url(../images/public_icon.png) -66px -95px no-repeat; width:18px; height:21px;} \ No newline at end of file From 8a53978d2397644004b9472b61fc846e2d0e254d Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 18 Dec 2015 14:51:33 +0800 Subject: [PATCH 30/66] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=BE=97=E5=88=86?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/project_score_helper.rb | 4 +++- app/views/repositories/show.html.erb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/helpers/project_score_helper.rb b/app/helpers/project_score_helper.rb index 256e35a7a..4049cdd76 100644 --- a/app/helpers/project_score_helper.rb +++ b/app/helpers/project_score_helper.rb @@ -22,7 +22,9 @@ module ProjectScoreHelper #代码提交数量 def changesets_num project - # commit_count(project) + # g = Gitlab.client + # project.gpid.nil? ? 0 : g.commits_total_count(project.gpid) + # commits_total_count(project.gpid) project.changesets.count end diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index b385dff1f..da7f79dd8 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -27,7 +27,7 @@ <%# 针对公开项目:用户必须创建了项目,否则用户无法同步 %> <% if User.current.id != @project.user_id %> -
    <%= link_to "".html_safe+"Fork", {:controller => 'repositories', :action => 'forked'}, :class=>"vl_btn", :confirm=>"确认要fork该项目吗?" %> +
    <%= link_to "".html_safe+"Fork", {:controller => 'repositories', :action => 'forked'}, :class=>"vl_btn", :confirm=>"平台将为您创建一个新的同名项目和版本库,请问是否继续?" %> <%= @project.forked_count.to_i %>
    <% end %> From a7c006c59fec38264de2f239632939562a3325b5 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 18 Dec 2015 15:02:36 +0800 Subject: [PATCH 31/66] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AE=A8=E8=AE=BA?= =?UTF-8?q?=E5=8C=BA=E7=9A=84=E5=B1=95=E5=BC=80=E6=9B=B4=E5=A4=9A=E4=B8=8D?= =?UTF-8?q?=E5=8F=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/boards/_course_show.html.erb | 74 +------------------ app/views/boards/_course_show_detail.html.erb | 70 ++++++++++++++++++ app/views/boards/show.js.erb | 2 +- 3 files changed, 73 insertions(+), 73 deletions(-) create mode 100644 app/views/boards/_course_show_detail.html.erb diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index 306a0c7ce..de3b038e6 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -1,20 +1,3 @@ -<%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false) %> - <%= javascript_include_tag "init_activity_KindEditor" %> -<% end %> - - - <% if topic %> - <%= render :partial => 'users/course_message', :locals => {:activity => topic, :user_activity_id => topic.id} %> - <% end %> - <% end %> - - <% if topics.count == 10 %> -
    展开更多<%= link_to "", boards_topic_path(@board, :course_id => @board.course.id ,:page => page), :id => "more_topic_link", :remote => "true", :class => "none" %>
    - <% end %> -<% end%> + <%= render :partial=> 'course_show_detail',:locals =>{:topics => @topics, :page => 0} %>
    - - diff --git a/app/views/boards/_course_show_detail.html.erb b/app/views/boards/_course_show_detail.html.erb new file mode 100644 index 000000000..c324f1d69 --- /dev/null +++ b/app/views/boards/_course_show_detail.html.erb @@ -0,0 +1,70 @@ +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: false, prettify: false) %> + <%= javascript_include_tag "init_activity_KindEditor" %> +<% end %> + + +<% if topics%> + <% topics.each do |topic| %> + + <% if topic %> + <%= render :partial => 'users/course_message', :locals => {:activity => topic, :user_activity_id => topic.id} %> + <% end %> + <% end %> + + <% if topics.count == 10 %> +
    展开更多<%= link_to "", boards_topic_path(@board, :course_id => @board.course.id ,:page => page), :id => "more_topic_link", :remote => "true", :class => "none" %>
    + <% end %> +<% end%> + + \ No newline at end of file diff --git a/app/views/boards/show.js.erb b/app/views/boards/show.js.erb index dd5fa4688..c088abce5 100644 --- a/app/views/boards/show.js.erb +++ b/app/views/boards/show.js.erb @@ -1 +1 @@ -$("#show_more_course_topic").replaceWith("<%= escape_javascript( render :partial => 'boards/course_show',:locals => {:topics => @topics, :page => @page} )%>"); \ No newline at end of file +$("#show_more_course_topic").replaceWith("<%= escape_javascript( render :partial => 'boards/course_show_detail',:locals => {:topics => @topics, :page => @page} )%>"); \ No newline at end of file From 084844941f0d766c2f54f64d624db05e92b5a6d2 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 18 Dec 2015 15:22:29 +0800 Subject: [PATCH 32/66] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=82=20=E8=81=9A=E7=84=A6=E5=B0=B1?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=89=80=E6=9C=89=E7=9A=84=E5=AD=A6=E6=A0=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/school_controller.rb | 5 +- app/views/my/account.html.erb | 78 ++++++++++++++-------------- 2 files changed, 42 insertions(+), 41 deletions(-) diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb index d20a58b75..e0aff6254 100644 --- a/app/controllers/school_controller.rb +++ b/app/controllers/school_controller.rb @@ -120,15 +120,16 @@ class SchoolController < ApplicationController condition.scan(/./).each_with_index do |char,index| if char =~ /[a-zA-Z0-9]/ pinyin << char + elsif char =~ /\'/ else chinese << char end end if(condition == '') - @school = School.page((params[:page].to_i || 1) - 1).per(100) + @school = School.reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100) @school_count = School.count else - @school = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").page((params[:page].to_i || 1) - 1).per(100) + @school = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100) @school_count = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").count end diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 604953ad9..30072777e 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -642,45 +642,45 @@ $("#hint").hide(); } }); -// $("input[name='province']").on('focus', function (e) { -// if($(e.target).val() == ''){ // -// return; -// } -// if( $("input[name='occupation']").val() != ''){ //如果已经有id了。肯定存在,不用去找了。 -// return; -// } -// -// $.ajax({ -// url: '<%#= url_for(:controller => 'school',:action => 'on_search') %>' + '?name=' + e.target.value, -// type: 'post', -// success: function (data) { -// if(data.length != undefined && data.length != 0) { -// var i = 0; -// $("#search_school_result_list").html(''); -// for (; i < data.length; i++) { -// link = '' + data[i].school.name + '
    '; -// $("#search_school_result_list").append(link); -// } -// $("#search_school_result_list").css('left', $(e.target).offset().left); -// $("#search_school_result_list").css('top', $(e.target).offset().top + 28); -// $("#search_school_result_list").css("position", "absolute"); -// $("#search_school_result_list").show(); -// if ($(e.target).val().trim() != '') { -// str = e.target.value.length > 8 ? e.target.value.substr(0, 6) + "..." : e.target.value; -// $("#hint").html('找到了' + data.length + '个包含"' + str + '"的高校'); -// $("#hint").show(); -// } else { -// $("#hint").hide(); -// } -// }else { -// $("#search_school_result_list").html(''); -// str = e.target.value.length > 4 ? e.target.value.substr(0, 4)+"..." : e.target.value; -// $("#hint").html('没有找到包含"'+str+'"的高校,创建高校'); -// $("#hint").show(); -// } -// } -// }); -// }); + $("input[name='province']").on('focus', function (e) { + if( $("input[name='occupation']").val() != ''){ //如果已经有id了。肯定存在,不用去找了。 + return; + } + + $.ajax({ + url: '<%= url_for(:controller => 'school',:action => 'on_search') %>' + '?name=' + e.target.value+'&page='+page, + type: 'post', + success: function (data) { + schoolsResult = data.schools; + count = data.count; + maxPage = Math.ceil(count/100) //最大页码值 + if(schoolsResult.length != undefined && schoolsResult.length != 0) { + var i = 0; + $("#search_school_result_list").html(''); + for (; i < schoolsResult.length; i++) { + link = '' + schoolsResult[i].school.name + '
    '; + $("#search_school_result_list").append(link); + } + $("#search_school_result_list").css('left', $(e.target).offset().left); + $("#search_school_result_list").css('top', $(e.target).offset().top + 28); + $("#search_school_result_list").css("position", "absolute"); + $("#search_school_result_list").show(); + if($(e.target).val().trim() != '') { + str = e.target.value.length > 8 ? e.target.value.substr(0, 6)+"..." : e.target.value; + $("#hint").html('找到了' + count + '个包含"' + str + '"的高校'); + $("#hint").show(); + }else{ + $("#hint").hide(); + } + }else{ + $("#search_school_result_list").html(''); + str = e.target.value.length > 4 ? e.target.value.substr(0, 4)+"..." : e.target.value; + $("#hint").html('没有找到包含"'+str+'"的高校,创建高校'); + $("#hint").show(); + } + } + }); + }); // $("#province").leanModal({top: 100, closeButton: ".modal_close"}); From c6e7c8860da7784e3d894a1cc4ba12fd8a78a5dc Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 18 Dec 2015 15:45:23 +0800 Subject: [PATCH 33/66] dd --- db/schema.rb | 43 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index 9c7702aa2..eac8a81db 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -558,23 +558,26 @@ ActiveRecord::Schema.define(:version => 20151218022014) do add_index "documents", ["created_on"], :name => "index_documents_on_created_on" add_index "documents", ["project_id"], :name => "documents_project_id" - create_table "dts", :force => true do |t| - t.string "IPLineCode" - t.string "Description" - t.string "Num" - t.string "Variable" - t.string "TraceInfo" - t.string "Method" + create_table "dts", :primary_key => "Num", :force => true do |t| + t.string "Defect", :limit => 50 + t.string "Category", :limit => 50 t.string "File" - t.string "IPLine" - t.string "Review" - t.string "Category" - t.string "Defect" - t.string "PreConditions" - t.string "StartLine" + t.string "Method" + t.string "Module", :limit => 20 + t.string "Variable", :limit => 50 + t.integer "StartLine" + t.integer "IPLine" + t.string "IPLineCode", :limit => 200 + t.string "Judge", :limit => 15 + t.integer "Review", :limit => 1 + t.string "Description" + t.text "PreConditions", :limit => 2147483647 + t.text "TraceInfo", :limit => 2147483647 + t.text "Code", :limit => 2147483647 t.integer "project_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" + t.integer "id", :null => false end create_table "editor_of_documents", :force => true do |t| @@ -923,16 +926,6 @@ ActiveRecord::Schema.define(:version => 20151218022014) do add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" - create_table "journal_details_copy", :force => true do |t| - t.integer "journal_id", :default => 0, :null => false - t.string "property", :limit => 30, :default => "", :null => false - t.string "prop_key", :limit => 30, :default => "", :null => false - t.text "old_value" - t.text "value" - end - - add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id" - create_table "journal_replies", :id => false, :force => true do |t| t.integer "journal_id" t.integer "user_id" From 793a98ade12e33b93fe824a06785d3e5eb8363bf Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 18 Dec 2015 15:51:41 +0800 Subject: [PATCH 34/66] =?UTF-8?q?forge=5Factivities=E9=82=A3=E4=B8=AA?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E6=89=B9=E9=87=8F=E5=88=A0=E9=99=A4=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D=E5=8A=A8=E6=80=81=E8=84=9A=E6=9C=AC=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...18022014_batch_delete_project_journal_activities.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/db/migrate/20151218022014_batch_delete_project_journal_activities.rb b/db/migrate/20151218022014_batch_delete_project_journal_activities.rb index 95d6a39c5..6752b5b30 100644 --- a/db/migrate/20151218022014_batch_delete_project_journal_activities.rb +++ b/db/migrate/20151218022014_batch_delete_project_journal_activities.rb @@ -1,7 +1,15 @@ # encoding: utf-8 class BatchDeleteProjectJournalActivities < ActiveRecord::Migration def up - ForgeActivity.where('forge_act_type = \'Journal\'').destroy_all #需要触发回调 + #ForgeActivity.where('forge_act_type = \'Journal\'').destroy_all #需要触发回调 + count = ForgeActivity.where('forge_act_type = \'Journal\'').count / 30 + 2 + transaction do + for i in 1 ... count do i + ForgeActivity.where('forge_act_type = \'Journal\'').page(i).per(30).each do |activity| + activity.destroy + end + end + end end def down From a080306f756e06794f5d76c16b6f71d2dcf6b6fb Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 18 Dec 2015 16:05:39 +0800 Subject: [PATCH 35/66] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E4=B8=AD=EF=BC=8C=E7=82=B9=E5=87=BB=E6=8C=89?= =?UTF-8?q?=E9=92=AE=EF=BC=8C=E6=8F=90=E4=BA=A4=E5=A4=9A=E6=AC=A1=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_course_journalsformessage.html.erb | 5 +++-- public/javascripts/init_activity_KindEditor.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/users/_course_journalsformessage.html.erb b/app/views/users/_course_journalsformessage.html.erb index 27549f6d9..006743cd7 100644 --- a/app/views/users/_course_journalsformessage.html.erb +++ b/app/views/users/_course_journalsformessage.html.erb @@ -114,7 +114,7 @@
    <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %>
    - <%= form_for('new_form',:url => {:controller => 'words', :action => 'create_reply', :id => activity.id},:method => "post", :remote => true) do |f|%> + <%= form_for('new_form',:url => {:controller => 'words', :action => 'create_reply', :id => activity.id}, :method => "post", :remote => true) do |f|%> <%= hidden_field_tag 'reference_id', params[:reference_id], :value => activity.id %> <%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => activity.user.id %> <%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => activity.id %> @@ -132,4 +132,5 @@
    -
    \ No newline at end of file +
    + diff --git a/public/javascripts/init_activity_KindEditor.js b/public/javascripts/init_activity_KindEditor.js index b0e4b9c59..4c63d1695 100644 --- a/public/javascripts/init_activity_KindEditor.js +++ b/public/javascripts/init_activity_KindEditor.js @@ -153,7 +153,7 @@ function init_activity_KindEditor_data(id){ params.cancel_btn.click(function () { nh_reset_form(params); }); - params.submit_btn.click(function () { + params.submit_btn.one('click',function () { params.form.submit(); }); params.textarea.data('init', 1); From 7ce8e330c3e15a1fc5baf059a774f7df0f364889 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 18 Dec 2015 16:21:27 +0800 Subject: [PATCH 36/66] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=95=99=E8=A8=80?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../users/_course_journalsformessage.html.erb | 41 +++---------------- 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/app/views/users/_course_journalsformessage.html.erb b/app/views/users/_course_journalsformessage.html.erb index 27549f6d9..69f966979 100644 --- a/app/views/users/_course_journalsformessage.html.erb +++ b/app/views/users/_course_journalsformessage.html.erb @@ -26,7 +26,7 @@
    - <% count=course.journals_for_messages.where('m_parent_id IS NULL').count %> + <% count = fetch_user_leaveWord_reply(activity).count %>
    @@ -47,7 +47,7 @@ <% if count > 0 %>
      - <% course.journals_for_messages.where('m_parent_id IS NULL').reorder("created_on desc").each do |comment| %> + <% fetch_user_leaveWord_reply(activity).each do |comment| unless fetch_user_leaveWord_reply(activity).nil? %> -
      -
      - <%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33", :class =>"mt8"), user_path(reply.user_id), :alt => "用户头像" %> -
      -
      -
      - <% if reply.try(:user).try(:realname) == ' ' %> - <%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> - <% else %> - <%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> - <% end %> - <%= l(:label_reply_to)%> - <% if comment.try(:user).try(:realname) == ' ' %> - <%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14 ml10" %> - <% else %> - <%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14 ml10" %> - <% end %> - <%= format_time reply.created_on %> -
      -
      - <%= reply.notes.html_safe %>
      -
      -
      -
      -
      - <% end %> - <% end %> + <%= comment.notes.html_safe %> +
    + <% end %> <% end %>
    From c38191eb424e722182bda8eeb24a28aa3977004a Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 18 Dec 2015 16:25:14 +0800 Subject: [PATCH 37/66] =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=9B=9E=E5=A4=8Dat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index 115a70e7a..fd6171f18 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -18,7 +18,7 @@ } $(function () { - init_activity_KindEditor_data(<%= issue.id%>, null, "87%"); + init_activity_KindEditor_data(<%= issue.id%>, null, "87%", "<%= issue.class.name %>"); showNormalImage('activity_description_<%= issue.id %>'); if ($("#intro_content_<%= issue.id %>").height() > 360) { $("#intro_content_show_<%= issue.id %>").show(); From 71a0802a498eddab43add025663b40fa4458ae09 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 18 Dec 2015 16:46:35 +0800 Subject: [PATCH 38/66] =?UTF-8?q?at=E5=90=8E=E5=AD=97=E4=BD=93=E6=94=B9?= =?UTF-8?q?=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/kindeditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index 6f8e489f8..bd7c7ec35 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -260,7 +260,7 @@ K.options = { bodyClass : 'ke-content', indentChar : '\t', cssPath : K.basePath +'plugins/code/previewcode.css', - cssData : '', + cssData : 'font{color:#7d7d7d;}', minWidth : 650, minHeight : 100, minChangeSize : 1, From d0e139650f9a60846c0b93925edd564e0cbdaf33 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 18 Dec 2015 16:50:44 +0800 Subject: [PATCH 39/66] =?UTF-8?q?issue=E5=9B=9E=E5=A4=8D=E7=9A=84at?= =?UTF-8?q?=E5=87=BA=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/show.html.erb | 4 ++-- public/javascripts/create_kindeditor.js | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index c832c884f..4af757c77 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -1,9 +1,9 @@ <%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false) %> + <%= import_ke(enable_at: true) %> <%= javascript_include_tag 'create_kindeditor'%> <% end %> From 4dda355d2efbec6df3f8a10c6b01794d6134814a Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 18 Dec 2015 18:28:20 +0800 Subject: [PATCH 48/66] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/project_score_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/project_score_helper.rb b/app/helpers/project_score_helper.rb index 4049cdd76..67cb41234 100644 --- a/app/helpers/project_score_helper.rb +++ b/app/helpers/project_score_helper.rb @@ -22,10 +22,10 @@ module ProjectScoreHelper #代码提交数量 def changesets_num project - # g = Gitlab.client - # project.gpid.nil? ? 0 : g.commits_total_count(project.gpid) + g = Gitlab.client + project.gpid.nil? ? 0 : g.commits_total_count(project.gpid) # commits_total_count(project.gpid) - project.changesets.count + # project.changesets.count end #讨论区帖子数量 From 6a563d4256956301893c0c0091887354fca3c2f8 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 18 Dec 2015 18:47:36 +0800 Subject: [PATCH 49/66] =?UTF-8?q?=E5=8C=BF=E8=AF=84=E7=BB=93=E6=9D=9F?= =?UTF-8?q?=E5=90=8E=E4=B8=8D=E5=8F=AF=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=9A=84=E6=88=AA=E6=AD=A2=E6=97=A5=E6=9C=9F=EF=BC=8C=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E5=8F=91=E5=B8=83=E5=90=8E=E4=B8=8D=E5=8F=AF=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BD=9C=E4=B8=9A=E7=9A=84=E5=8F=91=E5=B8=83=E6=97=A5?= =?UTF-8?q?=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_homework_form.html.erb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index 265118def..a060cf386 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -26,14 +26,18 @@ <% end %>
    - <%= calendar_for('homework_end_time')%> + <% if homework.homework_detail_manual.comment_status.to_i < 3 %> + <%= calendar_for('homework_end_time')%> + <% end %>
    <% if edit_mode %> <% end %>
    - <%= calendar_for('homework_publish_time')%> + <% if homework.homework_detail_manual.comment_status.to_i == 0 %> + <%= calendar_for('homework_publish_time')%> + <% end %>
    From e673540323983e5211dd7e7638978bb50be20287 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 18 Dec 2015 18:51:29 +0800 Subject: [PATCH 50/66] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/project_score_helper.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/helpers/project_score_helper.rb b/app/helpers/project_score_helper.rb index 67cb41234..97375586c 100644 --- a/app/helpers/project_score_helper.rb +++ b/app/helpers/project_score_helper.rb @@ -22,10 +22,10 @@ module ProjectScoreHelper #代码提交数量 def changesets_num project - g = Gitlab.client - project.gpid.nil? ? 0 : g.commits_total_count(project.gpid) - # commits_total_count(project.gpid) - # project.changesets.count + # g = Gitlab.client + # project.gpid.nil? ? 0 : g.commits_total_count(project.gpid) + # # commits_total_count(project.gpid) + project.changesets.count end #讨论区帖子数量 From 08cd3808ad2226412b1bbcd7bc8084313d8c479e Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 18 Dec 2015 19:47:06 +0800 Subject: [PATCH 51/66] =?UTF-8?q?ke=E5=BC=95=E7=94=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_newfeedback.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/users/user_newfeedback.html.erb b/app/views/users/user_newfeedback.html.erb index 30ba54b28..f53983228 100644 --- a/app/views/users/user_newfeedback.html.erb +++ b/app/views/users/user_newfeedback.html.erb @@ -1,6 +1,6 @@ <%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false, init_activity: true) %> - <%= javascript_include_tag "user" %> + <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> + <%= javascript_include_tag "init_KindEditor","user" %> <% end %>