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/models/attachment.rb b/app/models/attachment.rb index b301ba73c..85f36fc5f 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -227,7 +227,8 @@ class Attachment < ActiveRecord::Base def file=(incoming_file) unless incoming_file.nil? @temp_file = incoming_file - if @temp_file.size > 0 + # 允许上传文件大小为0的文件 + #if @temp_file.size > 0 if @temp_file.respond_to?(:original_filename) self.filename = @temp_file.original_filename self.filename.force_encoding("UTF-8") if filename.respond_to?(:force_encoding) @@ -239,7 +240,7 @@ class Attachment < ActiveRecord::Base self.content_type = Redmine::MimeType.of(filename) end self.filesize = @temp_file.size - end + #end end end @@ -255,7 +256,8 @@ class Attachment < ActiveRecord::Base # Copies the temporary file to its final location # and computes its MD5 hash def files_to_final_location - if @temp_file && (@temp_file.size > 0) + # # 允许上传文件大小为0的文件 + if @temp_file# && (@temp_file.size > 0) self.disk_directory = target_directory self.disk_filename = Attachment.disk_filename(filename, disk_directory) logger.info("Saving attachment '#{self.diskfile}' (#{@temp_file.size} bytes)") diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index c9f78d8e1..25d35d407 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -1,12 +1,12 @@ - + - +
<%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %> - <%= preview_link(preview_board_message_path(@board), 'message-form' ,target='preview',{:class => 'whiteButton m3p10'} )%> | - <%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' ,:class => 'whiteButton m3p10' %>
+ <%= preview_link(preview_board_message_path(@board), 'message-form', target='preview', {:class => 'whiteButton m3p10'}) %> + | + <%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;', :class => 'whiteButton m3p10' %> <% end %> <% end %><%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) %> | +<%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) %> |
|
+ |||||||||||
+ <%= authoring topic.created_on, topic.author %> |
+
- <%= l(:label_no_data) %> -
- <% else %> - <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %> -- -
-- -
-- <%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);" %> - <%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %> -
- <% end %> -+ <%= l(:label_no_data) %> +
+ <% else %> + <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %> ++ +
+ ++ +
+ ++ <%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);" %> + <%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %> +
+ <% end %> +
-
- <%= text_field_tag 'user', params[:user], :size => 30 %>
- <%= submit_tag l(:label_search_by_user), :class => "small", :name => nil %>
-
- |
-
+
+ <%= text_field_tag 'user', params[:user], :size => 30 %>
+ <%= submit_tag l(:label_search_by_user), :class => "small", :name => nil %>
+
+ |
+
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %> | -
-
|
+
- <%= l(:label_user_activities_other) %> -
- <% end %> - <% end %> + <% end %> + ++ <%= 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/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 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