From bb94a41435db111385804b6786e86d0c00baa7da Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Mon, 21 Dec 2015 15:11:41 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E7=BA=A2=E7=82=B9=E4=B8=AD=E5=8C=85?= =?UTF-8?q?=E5=90=ABat=E7=9A=84=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/user.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 2714117e9..aa048888c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -344,7 +344,8 @@ class User < Principal user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count user_memo_count = MemoMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count system_messages_count = SystemMessage.where("created_at >?", User.current.onclick_time.onclick_time).count - messages_count = course_count + forge_count + user_feedback_count + user_memo_count + system_messages_count + at_count = AtMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count + messages_count = course_count + forge_count + user_feedback_count + user_memo_count + system_messages_count + at_count end # 查询指派给我的缺陷记录 From 8cdd7c58cf945786a367c28cfed01985c94981d7 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Mon, 21 Dec 2015 15:14:51 +0800 Subject: [PATCH 2/8] =?UTF-8?q?at=E5=90=8D=E5=8D=95=E5=8A=A0=E5=AE=BD?= =?UTF-8?q?=E4=B8=80=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/at/jquery.atwho.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/kindeditor/at/jquery.atwho.css b/public/assets/kindeditor/at/jquery.atwho.css index 9a4c21d9b..df3ff9d94 100644 --- a/public/assets/kindeditor/at/jquery.atwho.css +++ b/public/assets/kindeditor/at/jquery.atwho.css @@ -9,7 +9,7 @@ border: 1px solid #DDD; border-radius: 3px; box-shadow: 0 0 5px rgba(0,0,0,0.1); - min-width: 120px; + min-width: 200px; max-height: 200px; overflow: auto; z-index: 11110 !important; From b235e8de70a3aded02a09ca1338bb2fdbaf6bfa2 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Mon, 21 Dec 2015 15:15:39 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E6=94=B9=E4=B8=BA=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/configuration.yml.example | 73 ++++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 22 deletions(-) diff --git a/config/configuration.yml.example b/config/configuration.yml.example index 27eb86f68..880c613e9 100644 --- a/config/configuration.yml.example +++ b/config/configuration.yml.example @@ -23,7 +23,7 @@ # email_delivery: # delivery_method: :smtp # smtp_settings: -# address: "localhost" +# address: smtp.163.com # port: 25 # # ==== SMTP server at example.com using LOGIN authentication and checking HELO for foo.com @@ -32,12 +32,12 @@ # email_delivery: # delivery_method: :smtp # smtp_settings: -# address: "example.com" -# port: 25 +# address: smtp.gmail.com +# port: 587 # authentication: :login # domain: 'foo.com' -# user_name: 'myaccount' -# password: 'password' +# user_name: senluowanxiangt@gmail.com +# password: 1913TXBja # # ==== SMTP server at example.com using PLAIN authentication # @@ -45,12 +45,12 @@ # email_delivery: # delivery_method: :smtp # smtp_settings: -# address: "example.com" -# port: 25 +# address: smtp.gmail.com +# port: 587 # authentication: :plain # domain: 'example.com' -# user_name: 'myaccount' -# password: 'password' +# user_name: senluowanxiangt@gmail.com +# password: 1913TXBja # # ==== SMTP server at using TLS (GMail) # @@ -62,12 +62,12 @@ # delivery_method: :smtp # smtp_settings: # enable_starttls_auto: true -# address: "smtp.gmail.com" +# address: smtp.gmail.com # port: 587 # domain: "smtp.gmail.com" # 'your.domain.com' for GoogleApps # authentication: :plain -# user_name: "your_email@gmail.com" -# password: "your_password" +# user_name: senluowanxiangt@gmail.com +# password: 1913TXBja # # # === More configuration options @@ -78,18 +78,17 @@ # http://wiki.rubyonrails.org/rails/pages/HowToSendEmailsWithActionMailer -# default configuration options for all environments + default: - # Outgoing emails configuration (see examples above) email_delivery: delivery_method: :smtp smtp_settings: - address: smtp.example.net - port: 25 - domain: example.net - authentication: :login - user_name: "redmine@example.net" - password: "redmine" + address: mail.trustie.net + port: 25 + domain: mail.trustie.net + authentication: :login + user_name: "mail@trustie.net" + password: "loong2010" # Absolute path to the directory where attachments are stored. # The default is the 'files' directory in your Redmine instance. @@ -104,7 +103,7 @@ default: # autologin_cookie_name: the name of the cookie (default: autologin) # autologin_cookie_path: the cookie path (default: /) # autologin_cookie_secure: true sets the cookie secure flag (default: false) - autologin_cookie_name: + autologin_cookie_name: "autologin_trustie" autologin_cookie_path: autologin_cookie_secure: @@ -170,7 +169,7 @@ default: # Absolute path (e.g. /usr/bin/convert, c:/im/convert.exe) to # the ImageMagick's `convert` binary. Used to generate attachment thumbnails. - #imagemagick_convert_command: + imagemagick_convert_command: '/home/pdl/redmine-2.3.2-0/common/bin/convert' # Configuration of RMagcik font. # @@ -196,11 +195,41 @@ default: # Maximum number of simultaneous AJAX uploads #max_concurrent_ajax_uploads: 2 + #pic_types: "bmp,jpeg,jpg,png,gif" + + repository_root_path: '/tmp/htdocs' + judge_server: 'http://judge.trustie.net/' + + # Git's url + gitlab_address: 'http://gitfast.trustie.net' # specific configuration options for production environment # that overrides the default ones production: + # CJK support + rmagick_font_path: /usr/share/fonts/ipa-mincho/ipam.ttf + judge_server: 'http://192.168.80.21:8080/' + repository_root_path: '/home/pdl/redmine-2.3.2-0/apache2/htdocs' + cookie_domain: ".trustie.net" + email_delivery: + delivery_method: :smtp + smtp_settings: + address: mail.trustie.net + port: 25 + domain: mail.trustie.net + authentication: :login + user_name: "mail@trustie.net" + password: "loong2010" # specific configuration options for development environment # that overrides the default ones development: + email_delivery: + delivery_method: :smtp + smtp_settings: + address: mail.trustie.net + port: 25 + domain: mail.trustie.net + authentication: :login + user_name: "mail@trustie.net" + password: "loong2010" From 22d8fc9abd7c4d5d3138593ce4bbc851c184ab14 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 22 Dec 2015 15:45:17 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E4=B9=B1=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/zipdown_controller.rb | 21 +++++++++++++++++---- public/javascripts/application.js | 27 ++++++++++++++++++++++++--- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index 1a01ac97b..2a4430935 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -1,4 +1,8 @@ -require 'zip' +#coding=utf-8 + +require "base64" +require 'zip' + class ZipdownController < ApplicationController #查找项目(课程) before_filter :find_project_by_bid_id, :only => [:assort] @@ -11,7 +15,12 @@ class ZipdownController < ApplicationController def download if User.current.logged? begin - send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => filename_for_content_disposition(params[:filename]), :type => detect_content_type(params[:file]) + if params[:base64file] + file = Base64.decode64(params[:base64file]) + send_file "#{OUTPUT_FOLDER}/#{file}", :filename => filename_for_content_disposition(file), :type => detect_content_type(file) + else + send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => filename_for_content_disposition(params[:filename]), :type => detect_content_type(params[:file]) + end rescue => e render file: 'public/no_file_found.html' end @@ -107,7 +116,9 @@ class ZipdownController < ApplicationController bid_homework_path, OUTPUT_FOLDER) } [{files:[out_file.file_path], count: 1, index: 1, - real_file: out_file.file_path, file: File.basename(out_file.file_path), + real_file: out_file.file_path, + file: File.basename(out_file.file_path), + base64file: Base64.encode64(File.basename(out_file.file_path)), size:(out_file.pack_size / 1024.0 / 1024.0).round(2) }] end @@ -129,7 +140,9 @@ class ZipdownController < ApplicationController bid_homework_path, OUTPUT_FOLDER) } [{files:[out_file.file_path], count: 1, index: 1, - real_file: out_file.file_path, file: File.basename(out_file.file_path), + real_file: out_file.file_path, + file: File.basename(out_file.file_path), + base64file: Base64.encode64(File.basename(out_file.file_path)), size:(out_file.pack_size / 1024.0 / 1024.0).round(2) }] end diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 901e302d3..0cbe647d6 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -870,7 +870,10 @@ function redo() { window.location.reload() } -function encodeHomeworkUrl(url){ +function encodeHomeworkUrl(url, is_base64){ + if(typeof is_base64 === 'boolean' && is_base64){ + return '/zipdown/download?base64file='+url; + } var file = encodeURI(url).replace(/\+/g, '%2B'); return '/zipdown/download?file='+file; } @@ -891,7 +894,10 @@ $(function(){ } if(res.length==1){ - location.href = encodeHomeworkUrl(res[0].file);return; + if(res[0].base64file){ + location.href = encodeHomeworkUrl(res[0].base64file, true);return; + } + location.href = encodeHomeworkUrl(res[0].file);return; } document.getElementById('light').style.display='block'; @@ -904,8 +910,12 @@ $(function(){ } else { des = '第'+res[i].index+'个学生的作品下载'; } - $('
  • '+(i+1)+'. '+des+'  (共'+res[i].size+'M)
  • ').appendTo($container); + if(res[i].base64file){ + $('
  • '+(i+1)+'. '+des+'  (共'+res[i].size+'M)
  • ').appendTo($container); + } else { + $('
  • '+(i+1)+'. '+des+'  (共'+res[i].size+'M)
  • ').appendTo($container); + } } } }); @@ -973,3 +983,14 @@ function showNormalImage(id) { } } + +$(function(){ + //at 加链接 + $("span.at").hover(function(){ + $(this).css('cursor', 'pointer'); + }); + $("span.at").live('click', function(){ + var userId = $(this).attr('data-user-id'); + $(window.location).attr('href', '/users/'+userId); + }); +}); \ No newline at end of file From fd746c25f3acda39f5a73d804b0de4837691beaa Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 22 Dec 2015 16:11:09 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E6=94=B9=E4=B8=BAbase64=E4=BC=A0=E8=BE=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/application.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 0cbe647d6..3d9fba942 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -931,7 +931,10 @@ $(function(){ else { if(res.length==1){ - location.href = encodeHomeworkUrl(res[0].file);return; + if(res[0].base64file){ + location.href = encodeHomeworkUrl(res[0].base64file, true);return; + } + location.href = encodeHomeworkUrl(res[0].file);return; } document.getElementById('light').style.display='block'; $container = $('#light .upload_box_ul'); @@ -943,7 +946,12 @@ $(function(){ } else { des = '第'+res[i].index+'个学生的作品下载'; } + + if(res[i].base64file){ + $('
  • '+(i+1)+'. '+des+'  (共'+res[i].size+'M)
  • ').appendTo($container); + } else { $('
  • '+(i+1)+'. '+des+'  (共'+res[i].size+'M)
  • ').appendTo($container); + } } } From 2eca28a10de25d8511b5bb784ecebac1e8710e7b Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 23 Dec 2015 10:02:54 +0800 Subject: [PATCH 6/8] =?UTF-8?q?LastName=20=E5=A7=93=20FirstName=20?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/my/account.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 30072777e..56cf4b915 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -18,8 +18,8 @@
  • 登录名 : *
  • 邮箱 : *
  • 身份 : *
  • -
  • 姓(First Name) : *
  • -
  • 名(Last Name) : *
  • +
  • 姓(Last Name) : *
  • +
  • 名(First Name) : *
  • 组织名 : *
  • 性别 : 
  • 工作单位 : 
  • From 7688546e7a00ba9356b45cdc9cbafe4abfb2d296 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 23 Dec 2015 11:12:34 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E8=AE=BA=E5=9D=9B=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8E=E6=B2=A1=E6=9C=89=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/memos/edit.html.erb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/views/memos/edit.html.erb b/app/views/memos/edit.html.erb index c8510c8cf..6806e0996 100644 --- a/app/views/memos/edit.html.erb +++ b/app/views/memos/edit.html.erb @@ -21,10 +21,7 @@ $.ajax({ url:' /forums/'+'<%= @memo.forum_id.to_s %>'+'/memos/<%= @memo.id.to_s%>', type:'put', - data:{ - 'memo[subject]':$("#memo_subject").val(), - 'memo[content]':$("#memo_content").val() - }, + data:$("#edit_memo").serialize(), success:function(data){ }, From e8bf93e4ad3e5f8bea48e935f4fc7ad670db426c Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 23 Dec 2015 11:13:14 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0button?= =?UTF-8?q?=E7=9A=84=E8=B7=AF=E5=BE=84=E5=8E=BB=E6=8E=89project=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/blog_comments/_blog_attachments.erb | 2 +- app/views/forums/_file_form.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/blog_comments/_blog_attachments.erb b/app/views/blog_comments/_blog_attachments.erb index dd8be659b..86298a330 100644 --- a/app/views/blog_comments/_blog_attachments.erb +++ b/app/views/blog_comments/_blog_attachments.erb @@ -57,7 +57,7 @@ :max_file_size => Setting.attachment_max_size.to_i.kilobytes, :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, - :upload_path => uploads_path(:format => 'js', :project => container), + :upload_path => uploads_path(:format => 'js'), :description_placeholder => l(:label_optional_description), :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), diff --git a/app/views/forums/_file_form.html.erb b/app/views/forums/_file_form.html.erb index 2510952f1..9bbbc9188 100644 --- a/app/views/forums/_file_form.html.erb +++ b/app/views/forums/_file_form.html.erb @@ -58,7 +58,7 @@ :max_file_size => Setting.attachment_max_size.to_i.kilobytes, :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, - :upload_path => uploads_path(:format => 'js', :project => project), + :upload_path => uploads_path(:format => 'js'), :description_placeholder => l(:label_optional_description), :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure),