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/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
# 查询指派给我的缺陷记录
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),
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){
},
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) : *
组织名 : *
性别 :
工作单位 :
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"
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;
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index 901e302d3..3d9fba942 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);
+ }
}
}
});
@@ -921,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');
@@ -933,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);
+ }
}
}
@@ -973,3 +991,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