From 735d7f2c1fd3bcc80e6da600809c2f47090e272f Mon Sep 17 00:00:00 2001 From: nwb Date: Fri, 25 Jul 2014 14:05:25 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E6=9D=83=E9=99=90=E5=88=A4=E6=96=AD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index a0da2d025..182a37453 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -54,13 +54,13 @@ class AttachmentsController < ApplicationController # modify by nwb # 下载添加权限设置 candown = false - if @attachment.container.has_attribute?(:project) && @attachment.container.project + if (@attachment.container.has_attribute?(:project) || @attachment.container.has_attribute?(:project_id)) && @attachment.container.project project = @attachment.container.project candown= User.current.member_of?(project) || (project.is_public && @attachment.is_public == 1) elsif @attachment.container.is_a?(Project) project = @attachment.container candown= User.current.member_of?(project) || (project.is_public && @attachment.is_public == 1) - elsif @attachment.container.has_attribute?(:course) && @attachment.container.course + elsif (@attachment.container.has_attribute?(:course) ||@attachment.container.has_attribute?(:course_id) ) && @attachment.container.course course = @attachment.container.course candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1) elsif @attachment.container.is_a?(Course) From ea322d617744352b3422700d0374851a213c8850 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 25 Jul 2014 14:51:10 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=97=B6=E9=97=B4=E5=AD=97=E7=9A=84=E9=95=BF?= =?UTF-8?q?=E5=BA=A6=E8=BF=87=E9=95=BF=E6=97=B6=E4=BC=9A=E6=8D=A2=E8=A1=8C?= =?UTF-8?q?=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/projects/_project.html.erb | 18 +++++++++--------- db/schema.rb | 20 ++++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/app/views/projects/_project.html.erb b/app/views/projects/_project.html.erb index 1bdef9df9..c057202f8 100644 --- a/app/views/projects/_project.html.erb +++ b/app/views/projects/_project.html.erb @@ -18,37 +18,37 @@

- +
- - - - - - - - diff --git a/db/schema.rb b/db/schema.rb index fe80b7d6f..c01c1baa6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -843,18 +843,18 @@ ActiveRecord::Schema.define(:version => 20140725013735) 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" From 2a4daf04f90126449f45ca75dab21b9d7e0516d6 Mon Sep 17 00:00:00 2001 From: nwb Date: Fri, 25 Jul 2014 15:09:29 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 182a37453..026a12e9a 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -173,7 +173,7 @@ class AttachmentsController < ApplicationController respond_to do |format| # modify by nwb - if @attachment.container.is_a?(Course) || @attachment.container.course + if !@attachment.container.nil? && (@attachment.container.is_a?(Course) || @attachment.container.course) if @course.nil? format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) } else @@ -286,7 +286,7 @@ private raise ActiveRecord::RecordNotFound if params[:filename] && params[:filename] != @attachment.filename if @attachment.container_type == 'Course' @course = @attachment.course - elsif @attachment.container.has_attribute?(:course) && @attachment.container.course + elsif !@attachment.container.nil? && (@attachment.container.has_attribute?(:course) || @attachment.container.has_attribute?(:course)) && @attachment.container.course @course = @attachment.container.course else unless @attachment.container_type == 'Bid' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication' From b5b246f09806a9ea6a3b5809ed72b744ee9b4d68 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 25 Jul 2014 15:12:24 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=AA=E6=80=A7?= =?UTF-8?q?=E7=AD=BE=E5=90=8D=E6=9C=AA=E8=87=AA=E5=8A=A8=E6=8D=A2=E8=A1=8C?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_users.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb index aa0e66ed8..e116a800f 100644 --- a/app/views/layouts/base_users.html.erb +++ b/app/views/layouts/base_users.html.erb @@ -143,7 +143,7 @@

<% end %> <% unless @user.user_extensions.nil? %> -

+

<%= @user.user_extensions.brief_introduction %>

<% end %> From 758541250f73ee6e8f2d3fb671f3a16eb7941c15 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 25 Jul 2014 15:41:21 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=8F=92=E4=BB=B6=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BF=81=E7=A7=BB=E6=96=87=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E7=A1=AE=E4=BF=9D=E6=95=B0=E6=8D=AE=E5=BA=93=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20140725073357_insert_to_setting.rb | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 db/migrate/20140725073357_insert_to_setting.rb diff --git a/db/migrate/20140725073357_insert_to_setting.rb b/db/migrate/20140725073357_insert_to_setting.rb new file mode 100644 index 000000000..89c367a7d --- /dev/null +++ b/db/migrate/20140725073357_insert_to_setting.rb @@ -0,0 +1,28 @@ +class InsertToSetting < ActiveRecord::Migration + def up + ss = Setting.find_all_by_name("plugin_redmine_ckeditor") + if ss.nil? + sett = Setting.new + sett.name = "plugin_redmine_ckeditor" + sett.value = "--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess + skin: kama + ui_color: ! '#f4f4f4' + width: '' + height: '400' + enter_mode: '1' + show_blocks: '1' + toolbar_can_collapse: '0' + toolbar_location: top + toolbar: Source,ShowBlocks,--,Undo,Redo,-,Find,Replace,--,Bold,Italic,Underline,Strike,-,Subscript,Superscript,-,NumberedList,BulletedList,-,Outdent,Indent,Blockquote,-,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,-,Link,Unlink,-,richImage,Table,HorizontalRule,/,Styles,Format,Font,FontSize,-,TextColor,BGColor,Cut,Copy,Paste,BidiLtr,BidiRtl,PasteText,PasteFromWord,RemoveFormat,SelectAll" + sett.save + end + end + + def down + ss = Setting.find_all_by_name("plugin_redmine_ckeditor") + if ss.nil? + else + ss.destroy + end + end +end
+ <%= link_to @project.watcher_users.count, project_watcherlist_path(project)%> + <%= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %>
+ <%= link_to "#{@project.members.count}", project_member_path(@project)%> + <%= content_tag('span', l(:label_x_current_contributors, :count => @project.users.count)) %>
+ <%= content_tag('span', "#{(@project.repository.nil? || @project.repository.changesets[0].nil?) ? '0' : distance_of_time_in_words(Time.now, @project.repository.changesets[0].committed_on)}", :class => "info") %> + <%= content_tag('span', l(:label_since_last_commits)) %>
+ <% find_project_repository @project %> <%= content_tag('span', "#{@project.repository.nil? || @project.project_status.nil? ? '0' : @project.project_status.changesets_count }", :class => "info") %> + <%= content_tag('span', l(:label_commit_on)) %>