This commit is contained in:
huang 2015-03-26 10:42:15 +08:00
commit dac4ffe66e
10 changed files with 275 additions and 105 deletions

View File

@ -126,7 +126,7 @@
<div class="grade">
<% if @project.project_type !=1 %>
<%= l(:label_project_grade)%>:
<%= l(:label_project_score)%>:
<span >
<%= link_to(format("%.2f" , red_project_scores(@project) ).to_i,
{:controller => 'projects',

View File

@ -1,68 +1,90 @@
<script>
function verifyAddress() {
var email = $.trim($('#mail').val());
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if(email == "")
{
$("#valid_email").html("邮箱地址不能为空!");
}
else if (filter.test(email)) {
$("#valid_email").html("");
return true;
}
else
{
$("#valid_email").html("您输入的邮箱格式不正确!");
}
return false;
}
function senderEmail(obj)
{
if(verifyAddress())
{
obj.parent().submit();
}
}
// if (filter.test(email)&& !(email.value == null)) return true;
// else
// {
// document.getElementById('valid_email').innerHTML = "您所填写的电子邮件格式不正确";
// document.getElementById('valid_email').style.color = "#FF0000";
// return false;
// }
//
// }
</script>
<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_invite_join)%></h2>
</div>
<div class="floatbox" style="margin:130px;">
<div >
<a href="#" class="box_close"></a>
</div>
<div class="cl"></div>
<div class="box_main">
<div style="padding-left: 20px;">
<h3 class="box_h3"><%= l(:label_invite_new_user)%></h3>
<p class="box_p">
<%= l(:label_invite_email_tips)%>
</p>
<div id="is_registed">
<%= render :partial => 'regested', locals: { :isregisted => false} %>
</div>
<%= form_tag('send_mail_to_member', :controller => 'projects',:action => 'send_mail_to_member', method: 'get') do %>
<span id="valid_email" style="color: #FF0000;"></span>
<%= text_field_tag 'mail', '', :class => "fb_item fl", :placeholder => l(:label_input_email), :onblur => "verifyAddress();" %>
<div class="cl"></div>
<div class="cl"></div>
<a href="#" class="btn_free" onclick="senderEmail($(this));">
<%= l(:label_send_email)%>
</a>
<%#= submit_tag '免费发送', :style => "display:block; width:80px; text-align:center; color:#fff; height:26px; padding-top:3px; margin-bottom:10px;" %>
<% end %>
</div>
</div>
<script type="text/javascript" src="/javascripts/jquery.min.js"></script>
<script type="text/javascript" src="/javascripts/jQuery.autoMail.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#mail").mailAutoComplete({
boxClass: "out_box", //外部box样式
listClass: "list_box", //默认的列表样式
focusClass: "focus_box", //列表选样式中
markCalss: "mark_box", //高亮样式
autoClass: false,
textHint: true //提示文字自动隐藏
});
});
</script>
<style type="text/css">
.out_box{border:1px solid #ccc; background:#fff; font:12px/20px Tahoma;}
.list_box{border-bottom:1px solid #eee; padding:0 5px; cursor:pointer;}
.focus_box{background:#83DAF6;}
.mark_box{color:#FF7143;}
</style>
<script>
function verifyAddress() {
var email = $.trim($('#mail').val());
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if(email == "")
{
$("#valid_email").html("邮箱地址不能为空!");
}
else if (filter.test(email)) {
$("#valid_email").html("");
return true;
}
else
{
$("#valid_email").html("您输入的邮箱格式不正确!");
}
return false;
}
function senderEmail(obj)
{
if(verifyAddress())
{
obj.parent().submit();
}
}
// if (filter.test(email)&& !(email.value == null)) return true;
// else
// {
// document.getElementById('valid_email').innerHTML = "您所填写的电子邮件格式不正确";
// document.getElementById('valid_email').style.color = "#FF0000";
// return false;
// }
//
// }
</script>
<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_invite_join)%></h2>
</div>
<div class="floatbox" style="margin:130px;">
<div >
<a href="#" class="box_close"></a>
</div>
<div class="cl"></div>
<div class="box_main">
<div style="padding-left: 20px;">
<h3 class="box_h3"><%= l(:label_invite_new_user)%></h3>
<p class="box_p">
<%= l(:label_invite_email_tips)%>
</p>
<div id="is_registed">
<%= render :partial => 'regested', locals: { :isregisted => false} %>
</div>
<%= form_tag('send_mail_to_member', :controller => 'projects',:action => 'send_mail_to_member', method: 'get') do %>
<span id="valid_email" style="color: #FF0000;"></span>
<div class="lin1_2">
<%= text_field_tag 'mail', '', :class => "fb_item fl", :placeholder => l(:label_input_email), :onkeyup => "this.value=this.value.replace(' ','')", :style => "ime-mode:disabled;", :onblur => "verifyAddress(this);" %>
</div>
<div class="cl"></div>
<div class="cl"></div>
<a href="#" class="btn_free" onclick="senderEmail($(this));">
<%= l(:label_send_email)%>
</a>
<%#= submit_tag '免费发送', :style => "display:block; width:80px; text-align:center; color:#fff; height:26px; padding-top:3px; margin-bottom:10px;" %>
<% end %>
</div>
</div>
</div>

View File

@ -337,7 +337,6 @@ en:
label_work_description_lengthlimit: less than 500 characters
label_create_new_projects: Create a project
label_work_scores_people: The total number of users given scores
label_project_grade: Score
# Personal signature tips
@ -629,8 +628,7 @@ en:
label_preview: Preview
label_feed_plural: Feeds
label_changes_details: Details of all changes
label_issue_tracking: Issue tracking
label_overall_spent_time: Overall spent time
label_f_hour: "%{value} hour"
label_f_hour_plural: "%{value} hours"
@ -937,11 +935,7 @@ en:
default_issue_status_rejected: Rejected
default_doc_category_user: User documentation
default_doc_category_tech: Technical documentation
default_priority_low: Low
default_priority_normal: Normal
default_priority_high: High
default_priority_urgent: Urgent
default_priority_immediate: Immediate
default_activity_design: Design
default_activity_development: Development
@ -1529,12 +1523,12 @@ en:
label_project_notice: release the notice
label_no_file_uploaded: No file uploaded
label_forum_new: New forum
label_memo_new_from_forum: Release memo
bale_edit_notice: Edit
label_user_grade: Individual score
label_course_term: Semester
label_comment_time: Comment time

View File

@ -45,7 +45,7 @@ en:
label_invite_new_user: "Send e-mail to invite new user"
label_invite_trustie_user: "Invite the Trustie registered user"
label_issue_tracking: Issue Tracking
label_issue_tracking: Issues
label_release_issue: New Issue
project_module_boards: Forums
@ -106,11 +106,11 @@ en:
# 资源库(附件)公用
label_relation_files: Select an existing resource
label_search_by_keyword: "Search by keywords"
label_files_filter: "Files Filter:"
label_files_filter: "Filter Files:"
attachment_all: "All"
attachment_browse: "Attachment Content Browse"
attachment_sufix_browse: "Attachment Type Browse"
attachment_browse: "By Attachment Content "
attachment_sufix_browse: "By Attachment Type "
label_unknow_type: Unknow type
field_filename: File
@ -130,7 +130,7 @@ en:
label_max_size: Maximum size
label_optional_description: Description
label_file_count: "%{count} files were uploaded successfully"
label_file_count: "files were uploaded successfully"
#
# 项目托管平台
@ -140,6 +140,14 @@ en:
#
# 问题优先级
default_priority_low: Low
default_priority_normal: Normal
default_priority_high: High
default_priority_urgent: Urgent
default_priority_immediate: Immediate
#
# 项目托管平台
#
@ -192,7 +200,7 @@ en:
label_input_email: Please input email address
label_invite_trustie_user: "Invite Trustie registered users"
label_invite_trustie_user_tips: "Please enter the Trustie user name"
label_invite_trustie_user_tips: "Type to find users"
label_invite_project: "invites you to join the project"
label_invite_success: Successful invitation
label_invite_members: Invite

View File

@ -136,6 +136,7 @@ zh:
label_max_size: 最大文件大小
label_optional_description: 可选的描述
label_file_count: "个文件已上传"
text_are_you_sure_all: 您确定要删除所有文件吗
#
@ -146,7 +147,11 @@ zh:
#
default_priority_low:
default_priority_normal: 普通
default_priority_high:
default_priority_urgent: 紧急
default_priority_immediate: 立刻
#

View File

@ -25,7 +25,8 @@ en:
# 左边栏
#
label_user_edit: Edit information
label_user_grade: Individual score
label_user_score: Individual synthetic score
label_user_score_of_influence: Influence score
label_user_score_of_collaboration: Collaborative score

View File

@ -34,7 +34,8 @@ zh:
# 左边栏
#
label_user_edit: "修改资料"
label_user_grade: 个人得分
label_user_score: 个人综合得分
# 用户身份在/my的修改资料下
label_user_score_of_collaboration: 协同得分

View File

@ -91,14 +91,7 @@ zh:
field_course_un: 暂未填写
#end
field_summary: 摘要
field_is_required: 必填
field_firstname: 名字
firstname_empty: 名字不能为空
field_firstname_eg: '(例:张三丰,请填写[三丰])'
field_lastname: 姓氏
lastname_empty: 姓氏不能为空
enterprise_empty: 企业名不能为空
field_lastname_eg: '(例:张三丰,请填写[张])'
@ -1005,11 +998,7 @@ zh:
default_issue_status_rejected: 已拒绝
default_doc_category_user: 用户文档
default_doc_category_tech: 技术文档
default_priority_low:
default_priority_normal: 普通
default_priority_high:
default_priority_urgent: 紧急
default_priority_immediate: 立刻
default_activity_design: 设计
default_activity_development: 开发
@ -1708,8 +1697,6 @@ zh:
label_school_not_fount: 没有符合的高校信息
label_project_grade: 项目得分
label_user_grade: 个人得分
label_system_grade: 系统评分
label_ta: 助教
@ -1999,7 +1986,7 @@ zh:
label_poll_proportion: 比例
label_poll_valid_commit: 本题有效填写人次
label_poll_result: 问卷调查_问卷统计
label_answer: 答案:
label_answer: "答案:"
label_poll_answer_valid_result: 以上为有效问答题答案!
label_poll_republish_success: 取消成功
label_answer_total: 总计:
@ -2031,7 +2018,6 @@ zh:
label_end_time: 截止时间
label_send_email: 确定发送
label_input_email: 请输入邮箱地址

View File

@ -22,7 +22,7 @@ module Redmine
@defaults = {
'email_delivery' => nil,
'max_concurrent_ajax_uploads' => 2,
'pic_types' => "bmp,jpeg,jpg,png,gif"
'pic_types' => "bmp,jpeg,jpg,png,gif,BMP,JPEG,JPG,PNG,GIF"
}
@config = nil

View File

@ -0,0 +1,153 @@
/**
* 2015-01-11
* edit by meng
*/
(function($){
$.fn.mailAutoComplete = function(options){
var defaults = {
boxClass: "mailListBox", //外部box样式
listClass: "mailListDefault", //默认的列表样式
focusClass: "mailListFocus", //列表选中样式
markCalss: "mailListHlignt", //高亮样式
zIndex: 1,
autoClass: true,//是否使用插件自带class样式
mailArr: ["qq.com","gmail.com","126.com","163.com","hotmail.com","live.com","sohu.com","sina.com","sina.cn","139.cn","189.cn"], //邮件数组
textHint: false, //文字提示的自动显示与隐藏
hintText: "",
focusColor: "#333"
//blurColor: "#999
};
var settings = $.extend({}, defaults, options || {});
//页面装载CSS样式
if(settings.autoClass && $("#mailListAppendCss").size() === 0){
$('<style id="mailListAppendCss" type="text/css">.mailListBox{border:1px solid #369; background:#fff; font:12px/20px Arial;}.mailListDefault{padding:0 5px;cursor:pointer;white-space:nowrap;}.mailListFocus{padding:0 5px;cursor:pointer;white-space:nowrap;background:#369;color:white;}.mailListHlignt{color:red;}.mailListFocus .mailListHlignt{color:#fff;}</style>').appendTo($("head"));
}
var cb = settings.boxClass, cl = settings.listClass, cf = settings.focusClass, cm = settings.markCalss; //插件的class变量
var z = settings.zIndex, newArr = mailArr = settings.mailArr, hint = settings.textHint, text = settings.hintText, fc = settings.focusColor, bc = settings.blurColor;
//创建邮件内部列表内容
$.createHtml = function(str, arr, cur){
var mailHtml = "";
if($.isArray(arr)){
$.each(arr, function(i, n){
if(i === cur){
mailHtml += '<div class="mailHover '+cf+'" id="mailList_'+i+'"><span class="'+cm+'">'+str+'</span>@'+arr[i]+'</div>';
}else{
mailHtml += '<div class="mailHover '+cl+'" id="mailList_'+i+'"><span class="'+cm+'">'+str+'</span>@'+arr[i]+'</div>';
}
});
}
return mailHtml;
};
//一些全局变量
var index = -1, s;
$(this).each(function(){
var that = $(this), i = $(".justForJs").size();
if(i > 0){ //只绑定一个文本框
return;
}
var w = that.outerWidth(), h = that.outerHeight(); //获取当前对象(即文本框)的宽高
//样式的初始化
that.wrap('<span style="display:inline-block;position:relative;"></span>')
.before('<div id="mailListBox_'+i+'" class="justForJs '+cb+'" style="min-width:'+w+'px;_width:'+w+'px;position:absolute;left:-6000px;top:'+h+'px;z-index:'+z+';"></div>');
var x = $("#mailListBox_" + i), liveValue; //列表框对象
that.focus(function(){
//父标签的层级
$(this).css("color", fc).parent().css("z-index", z);
//提示文字的显示与隐藏
if(hint && text){
var focus_v = $.trim($(this).val());
if(focus_v === text){
$(this).val("");
}
}
//键盘事件
$(this).keyup(function(e){
s = v = $.trim($(this).val());
if(/@/.test(v)){
s = v.replace(/@.*/, "");
}
if(v.length > 0){
//如果按键是上下键
if(e.keyCode === 38){
//向上
if(index <= 0){
index = newArr.length;
}
index--;
}else if(e.keyCode === 40){
//向下
if(index >= newArr.length - 1){
index = -1;
}
index++;
}else if(e.keyCode === 13){
//回车
if(index > -1 && index < newArr.length){
//如果当前有激活列表
$(this).val($("#mailList_"+index).text());
}
}else{
if(/@/.test(v)){
index = -1;
//获得@后面的值
//s = v.replace(/@.*/, "");
//创建新匹配数组
var site = v.replace(/.*@/, "");
newArr = $.map(mailArr, function(n){
var reg = new RegExp(site);
if(reg.test(n)){
return n;
}
});
}else{
newArr = mailArr;
}
}
x.html($.createHtml(s, newArr, index)).css("left", 0);
if(e.keyCode === 13){
//回车
if(index > -1 && index < newArr.length){
//如果当前有激活列表
x.css("left", "-6000px");
}
}
}else{
x.css("left", "-6000px");
}
}).blur(function(){
if(hint && text){
var blur_v = $.trim($(this).val());
if(blur_v === ""){
$(this).val(text);
}
}
$(this).css("color", bc).unbind("keyup").parent().css("z-index",0);
x.css("left", "-6000px");
}).keydown(function(event){
if(event.keyCode == 13){
return false;
}
});
//鼠标经过列表项事件
//鼠标经过
$(".mailHover").live("mouseover", function(){
index = Number($(this).attr("id").split("_")[1]);
liveValue = $("#mailList_"+index).text();
x.children("." + cf).removeClass(cf).addClass(cl);
$(this).addClass(cf).removeClass(cl);
});
$(".mailHover").live("click", function(){
$("#mail").val($(this).html());
});
});
x.bind("mousedown", function(){
that.val(liveValue);
});
});
};
})(jQuery);