From e5547b953ea7231b069668c46bfd9c776a04e31a Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 22 Jul 2014 13:35:10 +0800 Subject: [PATCH 01/28] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=95=99=E5=B8=88?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E7=94=A8=E6=88=B7=E6=89=93=E5=8C=85=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=89=80=E6=9C=89=E4=BD=9C=E4=B8=9A=E7=9A=84=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ReadMe.txt | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/ReadMe.txt b/ReadMe.txt index 8c57f348c..2505c295b 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -57,15 +57,9 @@ bundle exec rake db:migrate:up VERSION=20140410021724 2.运行 bundle install --without development test 3.运行 rake redmine:plugins:migrate RAILS_ENV=production 4.启动服务器 -5.把文本格式 (Administration > Settings > General > Text formatting)改为CKEditor -6.配置CKEditor插件(Administration > Plugins > Configure) - -某些情况数据库未插入插件配置值解决方案: -1 复制plugins -2 启动rails -3 运行migrate -3 打开admin配置插件(http://127.0.0.1:3000/settings/plugin/redmine_ckeditor) -4 点击“查询”(就是确定的功能) +5.配置CKEditor插件(Administration > Plugins > Configure) +6.把文本格式 (Administration > Settings > General > Text formatting)改为CKEditor +注意:一定要先配置CKEditor插件再见文本格式更改,不然,数据库不会生成对应记录,会报错。。 =============================================================================== 0719:若遇到首页定制报错问题请尝试如下操作 如果运行迁移文件有报错与‘sort_type’相关 先运行 bundle exec rake db:migrate:down version=20140716021202 bundle exec rake db:migrate:up version=20140716021202 From 42c2f6c2eeb94ff52d366c4fd9e7bf5f10f2a7ef Mon Sep 17 00:00:00 2001 From: nwb Date: Tue, 22 Jul 2014 13:47:05 +0800 Subject: [PATCH 02/28] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E6=8C=89=E4=BD=9C=E8=80=85=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/documents_controller.rb | 3 ++- db/schema.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/documents_controller.rb b/app/controllers/documents_controller.rb index b0ad6b109..2b92c32bb 100644 --- a/app/controllers/documents_controller.rb +++ b/app/controllers/documents_controller.rb @@ -42,7 +42,8 @@ class DocumentsController < ApplicationController when 'title' @grouped = documents.group_by {|d| d.title.first.upcase} when 'author' - @grouped = documents.select{|d| d.attachments.any?}.group_by {|d| d.attachments.last.author} + # @grouped = documents.select{|d| d.attachments.any?}.group_by {|d| d.attachments.last.author} + @grouped = documents.group_by {|d| d.user.name } else @grouped = documents.group_by(&:category) end diff --git a/db/schema.rb b/db/schema.rb index 05d24bf9b..20858ec97 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 => 20140721074353) do +ActiveRecord::Schema.define(:version => 20140722024513) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false From de17a84061dca4d765d1b0dfb6a6d64faf3e1819 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 22 Jul 2014 13:48:30 +0800 Subject: [PATCH 03/28] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E6=8D=95=E8=8E=B7=EF=BC=8C=E5=BD=93=E4=BD=9C=E4=B8=9A=E6=9C=AA?= =?UTF-8?q?=E6=89=BE=E5=88=B0=E7=9B=B8=E5=BA=94=E6=96=87=E4=BB=B6=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E8=B7=B3=E5=88=B0=E6=96=87=E4=BB=B6=E6=9C=AA=E6=89=BE?= =?UTF-8?q?=E5=88=B0=E9=A1=B5=E9=9D=A2(=E4=B8=8D=E6=8A=A5500=E9=94=99?= =?UTF-8?q?=E8=AF=AF)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/zipdown_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index 653400cbe..16e6ea870 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -41,7 +41,7 @@ class ZipdownController < ApplicationController if homework != nil if homework.attachments.count > 0 zipfile = zip_homework_by_user homework - send_file zipfile, :filename => homework.name+".zip", :type => detect_content_type(zipfile) if zipfile + send_file zipfile, :filename => homework.name+".zip", :type => detect_content_type(zipfile) if(zipfile) else render_403 :message => :no_file_dowmload end @@ -51,6 +51,8 @@ class ZipdownController < ApplicationController else render_403 :message => :notice_not_authorized end + rescue => e + render file: 'public/file_not_found.html' end private From 095cb7fc32115e840b7927e2180d26d8a12007fb Mon Sep 17 00:00:00 2001 From: nwb Date: Tue, 22 Jul 2014 15:02:58 +0800 Subject: [PATCH 04/28] =?UTF-8?q?=E5=8A=A0=E5=BC=BA=E5=AF=B9chrome?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=99=A8=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/_form.html.erb | 2 ++ public/javascripts/attachments.js | 30 ++++++++++++++-------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb index 7f1887b23..b237c7d25 100644 --- a/app/views/attachments/_form.html.erb +++ b/app/views/attachments/_form.html.erb @@ -35,3 +35,5 @@ <% content_for :header_tags do %> <%= javascript_include_tag 'attachments' %> <% end %> + + diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js index c60a77bd3..1b60b370e 100644 --- a/public/javascripts/attachments.js +++ b/public/javascripts/attachments.js @@ -156,23 +156,23 @@ function uploadBlob(blob, uploadUrl, attachmentId, options) { } function addInputFiles(inputEl) { - var clearedFileInput = $(inputEl).clone().val(''); - - if (inputEl.files) { - // upload files using ajax - uploadAndAttachFiles(inputEl.files, inputEl); - $(inputEl).remove(); - } else { - // browser not supporting the file API, upload on form submission - var attachmentId; - var aFilename = inputEl.value.split(/\/|\\/); - attachmentId = addFile(inputEl, { name: aFilename[ aFilename.length - 1 ] }, false); - if (attachmentId) { - $(inputEl).attr({ name: 'attachments[' + attachmentId + '][file]', style: 'display:none;' }).appendTo('#attachments_' + attachmentId); + // var clearedFileInput = $(inputEl).clone().val(''); + + if (inputEl.files) { + // upload files using ajax + uploadAndAttachFiles(inputEl.files, inputEl); + // $(inputEl).remove(); + } else { + // browser not supporting the file API, upload on form submission + var attachmentId; + var aFilename = inputEl.value.split(/\/|\\/); + attachmentId = addFile(inputEl, { name: aFilename[ aFilename.length - 1 ] }, false); + if (attachmentId) { + $(inputEl).attr({ name: 'attachments[' + attachmentId + '][file]', style: 'display:none;' }).appendTo('#attachments_' + attachmentId); + } } - } - clearedFileInput.insertAfter('#attachments_fields'); + //clearedFileInput.insertAfter('#attachments_fields'); } function uploadAndAttachFiles(files, inputEl) { From dee09aad751854fe9d92af5333e393cef1d3dc36 Mon Sep 17 00:00:00 2001 From: z9hang Date: Tue, 22 Jul 2014 15:59:35 +0800 Subject: [PATCH 05/28] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=BC=E8=88=AAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 1 + app/controllers/attachments_controller.rb | 1 + app/controllers/homework_attach_controller.rb | 1 + .../issue_categories_controller.rb | 1 + app/controllers/users_controller.rb | 8 +-- app/views/admin/contest_page_made.html.erb | 12 ++++- app/views/homework_attach/edit.html.erb | 5 +- app/views/layouts/project_base.html.erb | 47 +++++++++++++++++ app/views/layouts/users_base.html.erb | 50 +++++++++++++++++++ app/views/users/index.html.erb | 6 +-- app/views/users/new.html.erb | 6 +-- db/schema.rb | 13 +++++ 12 files changed, 132 insertions(+), 19 deletions(-) create mode 100644 app/views/layouts/project_base.html.erb create mode 100644 app/views/layouts/users_base.html.erb diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 171d34377..05045ab12 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -24,6 +24,7 @@ class AdminController < ApplicationController before_filter :require_admin helper :sort helper :Users + helper :Settings include SortHelper def index diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index bef128e50..b5baf4d71 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -16,6 +16,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class AttachmentsController < ApplicationController + layout "users_base" before_filter :find_project, :only => [:show, :download, :thumbnail, :destroy, :delete_homework]#, :except => [:upload, :autocomplete] before_filter :file_readable, :read_authorize, :only => [:show, :thumbnail]#Modified by young before_filter :delete_authorize, :only => :destroy diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index 7ad0702e8..1cb3fa197 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -1,4 +1,5 @@ class HomeworkAttachController < ApplicationController + layout "course_base" include CoursesHelper ############################### #判断当前角色权限时需先找到当前操作的project diff --git a/app/controllers/issue_categories_controller.rb b/app/controllers/issue_categories_controller.rb index 9803eb789..3bc0ff245 100644 --- a/app/controllers/issue_categories_controller.rb +++ b/app/controllers/issue_categories_controller.rb @@ -16,6 +16,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class IssueCategoriesController < ApplicationController + layout "project_base" menu_item :settings model_object IssueCategory before_filter :find_model_object, :except => [:index, :new, :create] diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 9e7ee0229..0ca810cbe 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -315,7 +315,7 @@ class UsersController < ApplicationController # get users ActiveRecord @users = @users_statuses.includes(:user).map(&:user) - @user_base_tag = params[:id] ? 'base_users':'base' + @user_base_tag = params[:id] ? 'base_users':'users_base' respond_to do |format| format.html { @groups = Group.all.sort @@ -344,7 +344,7 @@ class UsersController < ApplicationController scope = scope.like(params[:name]) if params[:name].present? @user_count = scope.count @user_pages = Paginator.new @user_count, @limit, params['page'] - @user_base_tag = params[:id] ? 'base_users':'base' + @user_base_tag = params[:id] ? 'base_users':'users_base' @offset ||= @user_pages.reverse_offset unless @offset == 0 @users = scope.offset(@offset).limit(@limit).all.reverse @@ -475,7 +475,7 @@ class UsersController < ApplicationController def new @user = User.new(:language => Setting.default_language, :mail_notification => Setting.default_notification_option) @auth_sources = AuthSource.all - render :layout => "base" + render :layout => "users_base" end def create @@ -510,7 +510,7 @@ class UsersController < ApplicationController @user.password = @user.password_confirmation = nil respond_to do |format| - format.html { render :action => 'new',:layout => "base" } + format.html { render :action => 'new',:layout => "users_base" } format.api { render_validation_errors(@user) } end end diff --git a/app/views/admin/contest_page_made.html.erb b/app/views/admin/contest_page_made.html.erb index a4407cd6b..ef99abf7d 100644 --- a/app/views/admin/contest_page_made.html.erb +++ b/app/views/admin/contest_page_made.html.erb @@ -1,6 +1,6 @@

<%=l(:label_first_page_made)%>

-<%= form_tag(:controller => 'admin', :action => 'contest_page_made') do %> +<%= form_tag(:controller => 'admin', :action => 'contest_page_made') do%>

<%= text_field_tag 'web_title', params[:wbe_title],:value => @first_page.web_title, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %> @@ -29,7 +29,17 @@ <%= text_area_tag 'contest_description',@contest_page.description,:rows => 8, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>

+

+ + +

+
+ + <% labelled_form_for %> + <%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %> +
<%= submit_tag l(:button_save), :class => "small", :name => nil %> <% end %>
diff --git a/app/views/homework_attach/edit.html.erb b/app/views/homework_attach/edit.html.erb index 8400eb805..a0876440c 100644 --- a/app/views/homework_attach/edit.html.erb +++ b/app/views/homework_attach/edit.html.erb @@ -1,7 +1,4 @@ -<% @nav_dispaly_course_all_label = 1 - @nav_dispaly_forum_label = 1 - @nav_dispaly_course_label = nil - @nav_dispaly_store_all_label = 1 %> +