Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop

This commit is contained in:
huang 2016-07-01 17:54:38 +08:00
commit 67cad6fc25
9 changed files with 34 additions and 27 deletions

View File

@ -239,17 +239,18 @@ class AccountController < ApplicationController
end end
def resendmail def resendmail
status = 1 result = {:status=>1, :email=>""}
user = User.find(params[:user]) if params[:user] user = User.find(params[:user]) if params[:user]
result[:email] = user.mail
token = Token.new(:user => user, :action => "register") token = Token.new(:user => user, :action => "register")
if token.save if token.save
# Mailer.run.register(token) # Mailer.run.register(token)
Mailer.register(token).deliver Mailer.register(token).deliver
else else
yield if block_given? yield if block_given?
status = 0 result[:status] = 0
end end
render :json => status render :json => result
end end
def email_activation def email_activation

View File

@ -23,7 +23,7 @@ module OrganizationsHelper
when 'activity' then when 'activity' then
return '动态' return '动态'
when 'course' then when 'course' then
return '课程' return '班级'
when 'project' then when 'project' then
return '项目' return '项目'
end end

View File

@ -23,9 +23,15 @@
url, url,
{user: id }, {user: id },
function (data) { function (data) {
console.log("1111111111"); //邮箱@之前用a**b格式显示
console.log(data); var mail = data.email;
$(".email_verify_btn").replaceWith("<p class='email_verify_p mt30 ml30'>激活邮件已发送至您的注册邮箱,请及时登录邮箱进行验证。</p>"); var pos = mail.indexOf("@");
var restr = mail.substring(1,pos-1);
if( mail.split("@")[0].length > 2 ){
mail = mail.replace(restr,"***");
}
$(".email_verify_btn").replaceWith("<p class='email_verify_p mt30 ml30'>激活邮件已发送至您的注册邮箱("+mail+"),请及时登录邮箱进行验证。</p>");
} }
); );
} }
@ -37,16 +43,16 @@
pop_up_box(htmlvalue,580,30,50); pop_up_box(htmlvalue,580,30,50);
return; return;
} }
$.get(
url, $.ajax({
{user:user,text:$(".email_prompt_mes").val() }, url: url,
function (data) { data: {user: user, text: $(".email_prompt_mes").val() },
console.log("2222222"); type: "POST",
console.log(data); success: function (data) {
var htmlvalue = "<div class='email_tancon'><h2 class='email_tan_title'>您的留言已发送</h2><p class='email_tan_p'>我们将尽快处理好,并通过邮件通知您。感谢您的反馈!</p></div>" var htmlvalue = "<div class='email_tancon'><h2 class='email_tan_title'>您的留言已发送</h2><p class='email_tan_p'>我们将尽快处理好,并通过邮件通知您。感谢您的反馈!</p></div>"
pop_up_box(htmlvalue,580,30,50); pop_up_box(htmlvalue, 580, 30, 45);
$(".email_prompt_mes").val(""); $(".email_prompt_mes").val("");
} }
); });
} }
</script> </script>

View File

@ -24,12 +24,12 @@
<body> <body>
<!--<div class="resourceSharePopup">--> <!--<div class="resourceSharePopup">-->
<div> <div>
<div class="relateText">请选择关联到组织的课程</div> <div class="relateText">请选择关联到组织的班级</div>
<div class="c_red">您的私有课程不能被关联到组织</div> <div class="c_red">您的私有班级不能被关联到组织</div>
</div> </div>
<div class="fl"> <div class="fl">
<%=form_tag url_for(:controller => 'organizations', :action => 'join_courses', :organization_id => organization_id),:method => 'post', :id => 'join_courses_form', :remote => true,:class=>"resourcesSearchBox" do %> <%=form_tag url_for(:controller => 'organizations', :action => 'join_courses', :organization_id => organization_id),:method => 'post', :id => 'join_courses_form', :remote => true,:class=>"resourcesSearchBox" do %>
<input type="text" name="courses" placeholder="搜索您已加入的课程的名称" class="searchCourse" /> <input type="text" name="courses" placeholder="搜索您已加入的班级的名称" class="searchCourse" />
<div id="search_courses_result_list" class="mb8 maxHeight100" style="overflow:auto;"></div> <div id="search_courses_result_list" class="mb8 maxHeight100" style="overflow:auto;"></div>
<div class="courseSendSubmit"> <div class="courseSendSubmit">
<a href="javascript:void(0);" onclick="org_join_courses(<%= organization_id %>);" class="sendSourceText">关联</a> <a href="javascript:void(0);" onclick="org_join_courses(<%= organization_id %>);" class="sendSourceText">关联</a>

View File

@ -2,7 +2,7 @@
<% if is_default_field?(field) %> <% if is_default_field?(field) %>
<% case field.name %> <% case field.name %>
<% when 'course' %> <% when 'course' %>
<h2 class="por_h2_index clear">课程动态</h2> <h2 class="por_h2_index clear">班级动态</h2>
<% if @course_acts.blank? %> <% if @course_acts.blank? %>
<p class="fontGrey2 f14 mt10 mb5">该模块暂时没有相关内容</p> <p class="fontGrey2 f14 mt10 mb5">该模块暂时没有相关内容</p>
<% else %> <% else %>

View File

@ -63,9 +63,9 @@
<% when 'course' %> <% when 'course' %>
<div style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>"> <div style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>">
<div class="homepageLeftMenuBlock"> <div class="homepageLeftMenuBlock">
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">课程</a> <a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">班级</a>
<% if User.current.logged? and User.current.admin_of_org?(organization) %> <% if User.current.logged? and User.current.admin_of_org?(organization) %>
<%=link_to "", join_course_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联课程"%> <%=link_to "", join_course_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联班级"%>
<% end %> <% end %>
</div> </div>
<div class="homepageLeftMenuCourses" id="homepageLeftMenuCourses" style="display:<%= organization.courses.count == 0 ?'none':'' %>"> <div class="homepageLeftMenuCourses" id="homepageLeftMenuCourses" style="display:<%= organization.courses.count == 0 ?'none':'' %>">

View File

@ -48,7 +48,7 @@
var last_name = $.trim($('#last_name').val()); var last_name = $.trim($('#last_name').val());
if(last_name.length > 30) if(last_name.length > 30)
{ {
$("#valid_email").text("用户姓过长,最长为30个字符"); $("#valid_email").text("用户姓过长,最长为30个字符");
return false; return false;
} }
else else

View File

@ -37,7 +37,7 @@ zh:
field_firstname: 名字或组织名 field_firstname: 名字或组织名
firstname_empty: 名字不能为空 firstname_empty: 名字不能为空
field_firstname_eg: '(例:张三丰,请填写[三丰])' field_firstname_eg: '(例:张三丰,请填写[三丰])'
field_lastname: field_lastname:
lastname_empty: 姓氏不能为空 lastname_empty: 姓氏不能为空
enterprise_empty: 企业名不能为空 enterprise_empty: 企业名不能为空
field_lastname_eg: '(例:张三丰,请填写[张])' field_lastname_eg: '(例:张三丰,请填写[张])'

View File

@ -496,7 +496,7 @@ RedmineApp::Application.routes.draw do
match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post] match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post]
#激活邮箱反馈问题 #激活邮箱反馈问题
match 'users/:id/leave_email_activation_message', :to => 'words#leave_email_activation_message', :via => :get, :as => "leave_email_activation_message" match 'users/:id/leave_email_activation_message', :to => 'words#leave_email_activation_message', :via => :post, :as => "leave_email_activation_message"
# boards # boards
match 'boards/:board_id/topics/new', :to => 'messages#new', :via => [:get, :post], :as => 'new_board_message' match 'boards/:board_id/topics/new', :to => 'messages#new', :via => [:get, :post], :as => 'new_board_message'