From bcaaa02bed3ffc08206b72032821b6180088ee8b Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 18 Jul 2014 10:01:54 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=B7=B2=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E8=AF=BE=E7=A8=8B=E5=9C=A8=E8=BD=AF=E4=BB=B6=E5=88=9B?= =?UTF-8?q?=E5=AE=A2=E5=88=97=E8=A1=A8=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/users_helper.rb | 20 +++++++++++++++++ app/views/users/_user_show.html.erb | 2 +- db/schema.rb | 33 ++++++++++++++++++++--------- 3 files changed, 44 insertions(+), 11 deletions(-) diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index e65fe174e..58935dd11 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -258,4 +258,24 @@ module UsersHelper end return result end + + #获取用户参与的公开的课程列表 + def user_public_course_list user + membership = user.coursememberships.all#@user.coursememberships.all(:conditions => Course.visible_condition(User.current)) + membership.sort! {|older, newer| newer.created_on <=> older.created_on } + memberships = [] + membership.collect { |e| + memberships.push(e) + } + ## 判断课程是否过期 [需封装] + memberships_doing = [] + memberships_done = [] + memberships.map { |e| + if course_endTime_timeout?(e.course) + memberships_done.push e + else + memberships_doing.push e + end + } + end end diff --git a/app/views/users/_user_show.html.erb b/app/views/users/_user_show.html.erb index 13f08f7ef..008905ef3 100644 --- a/app/views/users/_user_show.html.erb +++ b/app/views/users/_user_show.html.erb @@ -66,7 +66,7 @@ <%# unless user.memberships.empty? %> <%# cond = Project.visible_condition(User.current) + " AND projects.project_type = 1" %> <%# memberships = user.memberships.all(:conditions => cond) %> - <% user_courses = user.coursememberships.map(&:course) %> + <% user_courses = user_courses_list(user) %> <%= l(:label_x_course_contribute_to, :count => user_courses.count) %> <% for course in user_courses %> <%# if course.name != nil %> diff --git a/db/schema.rb b/db/schema.rb index ac5ca0644..4a14a02f2 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -809,18 +809,18 @@ ActiveRecord::Schema.define(:version => 20140716021558) do create_table "relative_memos", :force => true do |t| t.integer "osp_id" t.integer "parent_id" - t.string "subject", :null => false - t.text "content", :null => false + t.string "subject", :null => false + t.text "content", :limit => 16777215, :null => false t.integer "author_id" - t.integer "replies_count", :default => 0 + t.integer "replies_count", :default => 0 t.integer "last_reply_id" - t.boolean "lock", :default => false - t.boolean "sticky", :default => false - t.boolean "is_quote", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "viewed_count_crawl", :default => 0 - t.integer "viewed_count_local", :default => 0 + t.boolean "lock", :default => false + t.boolean "sticky", :default => false + t.boolean "is_quote", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "viewed_count_crawl", :default => 0 + t.integer "viewed_count_local", :default => 0 t.string "url" t.string "username" t.string "userhomeurl" @@ -844,6 +844,19 @@ ActiveRecord::Schema.define(:version => 20140716021558) do add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id" + create_table "rich_rich_files", :force => true do |t| + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "rich_file_file_name" + t.string "rich_file_content_type" + t.integer "rich_file_file_size" + t.datetime "rich_file_updated_at" + t.string "owner_type" + t.integer "owner_id" + t.text "uri_cache" + t.string "simplified_type", :default => "file" + end + create_table "roles", :force => true do |t| t.string "name", :limit => 30, :default => "", :null => false t.integer "position", :default => 1 From 6f858795ef0c9778c19b6a640790a24e617e0708 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 18 Jul 2014 10:24:49 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=9C=AA=E9=80=89=E4=B8=ADwiki=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=8F=96=E6=B6=88=E5=B7=A6=E4=BE=A7=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E9=9B=86=E7=9A=84WIKI=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/projects/_tools_expand.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/projects/_tools_expand.html.erb b/app/views/projects/_tools_expand.html.erb index aec1ad7a2..5ee70fa9d 100644 --- a/app/views/projects/_tools_expand.html.erb +++ b/app/views/projects/_tools_expand.html.erb @@ -6,7 +6,9 @@
+ <%= l(:label_user_activities_other) %> +
+ <% end %> + <% end %> <% else %> - <% unless @message.empty? %> -<%= l(:label_no_user_respond_you) %>
- <% end %> + <% else %> +<%= l(:label_no_user_respond_you) %>
+ <% end %> <% end %> \ No newline at end of file diff --git a/plugins/redmine_ckeditor/assets/ckeditor/plugins/iframe/dialogs/iframe.js b/plugins/redmine_ckeditor/assets/ckeditor/plugins/iframe/dialogs/iframe.js index dba1e9306..ebda240da 100644 --- a/plugins/redmine_ckeditor/assets/ckeditor/plugins/iframe/dialogs/iframe.js +++ b/plugins/redmine_ckeditor/assets/ckeditor/plugins/iframe/dialogs/iframe.js @@ -1,10 +1,75 @@ /* Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license -*/ -(function(){function c(b){var c=this instanceof CKEDITOR.ui.dialog.checkbox;b.hasAttribute(this.id)&&(b=b.getAttribute(this.id),c?this.setValue(e[this.id]["true"]==b.toLowerCase()):this.setValue(b))}function d(b){var c=""===this.getValue(),a=this instanceof CKEDITOR.ui.dialog.checkbox,d=this.getValue();c?b.removeAttribute(this.att||this.id):a?b.setAttribute(this.id,e[this.id][d]):b.setAttribute(this.att||this.id,d)}var e={scrolling:{"true":"yes","false":"no"},frameborder:{"true":"1","false":"0"}}; -CKEDITOR.dialog.add("iframe",function(b){var f=b.lang.iframe,a=b.lang.common,e=b.plugins.dialogadvtab;return{title:f.title,minWidth:350,minHeight:260,onShow:function(){this.fakeImage=this.iframeNode=null;var a=this.getSelectedElement();a&&(a.data("cke-real-element-type")&&"iframe"==a.data("cke-real-element-type"))&&(this.fakeImage=a,this.iframeNode=a=b.restoreRealElement(a),this.setupContent(a))},onOk:function(){var a;a=this.fakeImage?this.iframeNode:new CKEDITOR.dom.element("iframe");var c={},d= -{};this.commitContent(a,c,d);a=b.createFakeElement(a,"cke_iframe","iframe",!0);a.setAttributes(d);a.setStyles(c);this.fakeImage?(a.replace(this.fakeImage),b.getSelection().selectElement(a)):b.insertElement(a)},contents:[{id:"info",label:a.generalTab,accessKey:"I",elements:[{type:"vbox",padding:0,children:[{id:"src",type:"text",label:a.url,required:!0,validate:CKEDITOR.dialog.validate.notEmpty(f.noUrl),setup:c,commit:d}]},{type:"hbox",children:[{id:"width",type:"text",requiredContent:"iframe[width]", -style:"width:100%",labelLayout:"vertical",label:a.width,validate:CKEDITOR.dialog.validate.htmlLength(a.invalidHtmlLength.replace("%1",a.width)),setup:c,commit:d},{id:"height",type:"text",requiredContent:"iframe[height]",style:"width:100%",labelLayout:"vertical",label:a.height,validate:CKEDITOR.dialog.validate.htmlLength(a.invalidHtmlLength.replace("%1",a.height)),setup:c,commit:d},{id:"align",type:"select",requiredContent:"iframe[align]","default":"",items:[[a.notSet,""],[a.alignLeft,"left"],[a.alignRight, -"right"],[a.alignTop,"top"],[a.alignMiddle,"middle"],[a.alignBottom,"bottom"]],style:"width:100%",labelLayout:"vertical",label:a.align,setup:function(a,b){c.apply(this,arguments);if(b){var d=b.getAttribute("align");this.setValue(d&&d.toLowerCase()||"")}},commit:function(a,b,c){d.apply(this,arguments);this.getValue()&&(c.align=this.getValue())}}]},{type:"hbox",widths:["50%","50%"],children:[{id:"scrolling",type:"checkbox",requiredContent:"iframe[scrolling]",label:f.scrolling,setup:c,commit:d},{id:"frameborder", -type:"checkbox",requiredContent:"iframe[frameborder]",label:f.border,setup:c,commit:d}]},{type:"hbox",widths:["50%","50%"],children:[{id:"name",type:"text",requiredContent:"iframe[name]",label:a.name,setup:c,commit:d},{id:"title",type:"text",requiredContent:"iframe[title]",label:a.advisoryTitle,setup:c,commit:d}]},{id:"longdesc",type:"text",requiredContent:"iframe[longdesc]",label:a.longDescr,setup:c,commit:d}]},e&&e.createAdvancedTab(b,{id:1,classes:1,styles:1},"iframe")]}})})(); \ No newline at end of file + */ +(function () { + function c(b) { + var c = this instanceof CKEDITOR.ui.dialog.checkbox; + b.hasAttribute(this.id) && (b = b.getAttribute(this.id), c ? this.setValue(e[this.id]["true"] == b.toLowerCase()) : this.setValue(b)) + } + + function d(b) { + var c = "" === this.getValue(), a = this instanceof CKEDITOR.ui.dialog.checkbox, d = this.getValue(); + c ? b.removeAttribute(this.att || this.id) : a ? b.setAttribute(this.id, e[this.id][d]) : b.setAttribute(this.att || this.id, d) + } + + var e = {scrolling: {"true": "yes", "false": "no"}, frameborder: {"true": "1", "false": "0"}}; + CKEDITOR.dialog.add("iframe", function (b) { + var f = b.lang.iframe, a = b.lang.common, e = b.plugins.dialogadvtab; + return{title: f.title, minWidth: 350, minHeight: 260, onShow: function () { + this.fakeImage = this.iframeNode = null; + var a = this.getSelectedElement(); + a && (a.data("cke-real-element-type") && "iframe" == a.data("cke-real-element-type")) && (this.fakeImage = a, this.iframeNode = a = b.restoreRealElement(a), this.setupContent(a)) + }, onOk: function () { + var a; + a = this.fakeImage ? this.iframeNode : new CKEDITOR.dom.element("iframe"); + var c = {}, d = + {}; + this.commitContent(a, c, d); + a = b.createFakeElement(a, "cke_iframe", "iframe", !0); + a.setAttributes(d); + a.setStyles(c); + this.fakeImage ? (a.replace(this.fakeImage), b.getSelection().selectElement(a)) : b.insertElement(a) + }, contents: [ + {id: "info", label: a.generalTab, accessKey: "I", elements: [ + {type: "vbox", padding: 0, children: [ + {id: "src", type: "text", label: a.url, required: !0, validate: CKEDITOR.dialog.validate.notEmpty(f.noUrl), setup: c, commit: d} + ]}, + {type: "hbox", children: [ + {id: "width", type: "text", requiredContent: "iframe[width]", + style: "width:100%", labelLayout: "vertical", label: a.width, validate: CKEDITOR.dialog.validate.htmlLength(a.invalidHtmlLength.replace("%1", a.width)), setup: c, commit: d}, + {id: "height", type: "text", requiredContent: "iframe[height]", style: "width:100%", labelLayout: "vertical", label: a.height, validate: CKEDITOR.dialog.validate.htmlLength(a.invalidHtmlLength.replace("%1", a.height)), setup: c, commit: d}, + {id: "align", type: "select", requiredContent: "iframe[align]", "default": "", items: [ + [a.notSet, ""], + [a.alignLeft, "left"], + [a.alignRight, + "right"], + [a.alignTop, "top"], + [a.alignMiddle, "middle"], + [a.alignBottom, "bottom"] + ], style: "width:100%", labelLayout: "vertical", label: a.align, setup: function (a, b) { + c.apply(this, arguments); + if (b) { + var d = b.getAttribute("align"); + this.setValue(d && d.toLowerCase() || "") + } + }, commit: function (a, b, c) { + d.apply(this, arguments); + this.getValue() && (c.align = this.getValue()) + }} + ]}, + {type: "hbox", widths: ["50%", "50%"], children: [ + {id: "scrolling", type: "checkbox", requiredContent: "iframe[scrolling]", label: f.scrolling, setup: c, commit: d}, + {id: "frameborder", + type: "checkbox", requiredContent: "iframe[frameborder]", label: f.border, setup: c, commit: d} + ]}, + {type: "hbox", widths: ["50%", "50%"], children: [ + {id: "name", type: "text", requiredContent: "iframe[name]", label: a.name, setup: c, commit: d}, + {id: "title", type: "text", requiredContent: "iframe[title]", label: a.advisoryTitle, setup: c, commit: d} + ]}, + {id: "longdesc", type: "text", requiredContent: "iframe[longdesc]", label: a.longDescr, setup: c, commit: d} + ]}, + e && e.createAdvancedTab(b, {id: 1, classes: 1, styles: 1}, "iframe") + ]} + }) +})(); \ No newline at end of file diff --git a/plugins/redmine_ckeditor/assets/ckeditor/plugins/image/dialogs/image.js b/plugins/redmine_ckeditor/assets/ckeditor/plugins/image/dialogs/image.js index 953de6967..8b0eb6a3c 100644 --- a/plugins/redmine_ckeditor/assets/ckeditor/plugins/image/dialogs/image.js +++ b/plugins/redmine_ckeditor/assets/ckeditor/plugins/image/dialogs/image.js @@ -1,43 +1,453 @@ /* Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license -*/ -(function(){var r=function(c,j){function r(){var a=arguments,b=this.getContentElement("advanced","txtdlgGenStyle");b&&b.commit.apply(b,a);this.foreach(function(b){b.commit&&"txtdlgGenStyle"!=b.id&&b.commit.apply(b,a)})}function i(a){if(!s){s=1;var b=this.getDialog(),d=b.imageElement;if(d){this.commit(f,d);for(var a=[].concat(a),e=a.length,c,g=0;g