This commit is contained in:
sw 2015-03-07 11:32:28 +08:00
commit 3e3cde0805
14 changed files with 508 additions and 287 deletions

View File

@ -22,7 +22,7 @@ gem 'spreadsheet'
gem 'ruby-ole'
#gem 'email_verifier', path: 'lib/email_verifier'
gem 'rufus-scheduler'
gem 'dalli', path: 'lib/dalli-2.7.2'
#gem 'dalli', path: 'lib/dalli-2.7.2'
group :development do
gem 'grape-swagger'
gem 'grape-swagger-ui', git: 'https://github.com/guange2015/grape-swagger-ui.git'

View File

@ -332,10 +332,18 @@ class ProjectsController < ApplicationController
@wiki ||= @project.wiki
end
def send_mail_to_member
unless params[:mail].nil?
email = params[:mail]
Mailer.send_invite_in_project(email, @project, User.current).deliver
end
end
#发送邮件邀请新用户
def invite_members_by_mail
respond_to do |format|
format.html
format.js
end
end
# 邀请Trustie注册用户

View File

@ -9,9 +9,8 @@
</script>
<div id="add-message" class="add_frame" style="display:none;">
<% if User.current.logged? %>
s
<div class="add_frame_header">
<%= l(:label_message_new) %>
<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_message_new) %></h2>
</div>
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'messages/form', :locals => {:f => f} %>

View File

@ -127,11 +127,13 @@
</div><!--项目信息 end-->
<div class="subNavBox">
<% if User.current.member_of?(@project) %>
<div class="subNav currentDd currentDt subNav_jiantou">邀请</div>
<ul class="navContent " style="display:block; padding-left: 0px; margin-top:0px;">
<li><%= link_to "发送邮件邀请新用户" %></li>
<li><%= link_to "发送邮件邀请新用户", :controller=>"projects", :action=>"invite_members_by_mail", :id => @project %></li>
<li><%= link_to "邀请Trustie注册用户", :controller=>"projects", :action=>"invite_members", :id => @project %></li>
</ul>
<% end %>
<div class="subNav">
<%= link_to "动态", {:controller => 'projects', :action => 'show', :id => @project.id}, :style => "color:#3CA5C6" %>
</div>

View File

@ -0,0 +1,21 @@
<div class="floatbox" style="margin:100px;">
<div ><a href="#" class="box_close"></a></div>
<div class="cl"></div>
<div class="box_main">
<h3 class="box_h3">发送邮件邀请新用户</h3>
<p class="box_p">输入好友邮箱地址Trustie帮您免费发送</p>
<%= form_tag('send_mail_to_member', :controller => 'projects',:action => 'send_mail_to_member', method: 'get',:remote=>true) do %>
<ul>
<li >
<%= text_field_tag 'mail', '邮箱', :class => "fb_item fl" %>
</li>
<div class="cl"></div>
<div class="cl"></div>
</ul>
<%= submit_tag '免费发送', :class=> "btn_free" %>
<% end %>
</div>
</div>

View File

@ -0,0 +1,2 @@
<%= stylesheet_link_tag 'project', :media => 'all' %>
<%= render :partial => "invite_members_by_mail"%>

View File

@ -0,0 +1,10 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'invite_members_by_mail') %>');
showModal('ajax-modal', '513px');
$('#ajax-modal').css('height','569px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
"<a href='#' onclick='hidden_homework_atert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().removeClass("alert_praise");
$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("alert_box");

View File

@ -369,6 +369,8 @@ RedmineApp::Application.routes.draw do
get 'feedback', :action => 'feedback', :as => 'project_feedback'
get 'watcherlist', :action=> 'watcherlist'
get 'invite_members', :action=> 'invite_members'
get 'invite_members_by_mail', :action=> 'invite_members_by_mail'
get 'send_mail_to_member', :action => 'send_mail_to_member'
match 'user_watcherlist', :to => 'projects#watcherlist', :via => :get, :as => "watcherlist" #add by huang
get 'homework', :action => 'homework', :as => 'homework'
get 'new_homework', :action => 'new_homework', :as => 'new_homework'

View File

@ -11,11 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
<<<<<<< HEAD
ActiveRecord::Schema.define(:version => 20150305081132) do
=======
ActiveRecord::Schema.define(:version => 20150305011359) do
>>>>>>> 001b8bb1120fadea713d280e7d5bbabf7f5e57b8
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -819,19 +815,18 @@ ActiveRecord::Schema.define(:version => 20150305011359) do
t.integer "project_id"
end
<<<<<<< HEAD
create_table "phone_app_versions", :force => true do |t|
t.string "version"
t.text "description"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
=======
create_table "organizations", :force => true do |t|
t.string "name"
t.string "logo_link"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
>>>>>>> 001b8bb1120fadea713d280e7d5bbabf7f5e57b8
end
create_table "phone_app_versions", :force => true do |t|
t.string "version"
t.text "description"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "poll_answers", :force => true do |t|

View File

@ -67,7 +67,7 @@ a:hover.subnav_green{ background:#14ad5a;}
.lg-foot:hover{ color:#787b7e;}
/*右侧内容--动态*/
.project_r_h{ height:40px; background:#eaeaea;}
.project_r_h{ height:40px; background:#eaeaea; margin-bottom: 5px;}
.project_h2{ background:#64bdd9; color:#fff; height:30px; width:90px; text-align:center; font-weight:normal; padding-top:3px; font-size:16px; padding-top:9px;}
.project_r_box{ border:1px solid #e2e1e1; width:670px; margin-top:10px;}
.project_h3 { color:#646464; font-size:14px; padding:0 10px; border-bottom:1px solid #e2e1e1;}

View File

@ -0,0 +1,182 @@
@charset "utf-8";
/* CSS Document */
body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#eaebec; font-style:normal;}
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span,ol{ margin:0; padding:0;}
div,img,tr,td,table{ border:0;}
table,tr,td{border:0;cellspacing:0; cellpadding:0;}
ol,ul,li{ list-style-type:none}
.cl{ clear:both; overflow:hidden; }
a{ text-decoration:none; cursor:pointer;}
.ml10{ margin-left:10px;}
.ml20{ margin-left:20px;}
.mr10{ margin-right:10px;}
.mb5{ margin-bottom:5px;}
.mb10{ margin-bottom:10px;}
.fl{ float: left;}
.fr{ float:right;}
.project_h4{ font-size:14px; color:#3b3b3b;}
.project_content{ width:940px; margin:10px auto;}
.project_left{ float:left;}
.project_right{ width:670px; float:left;background:#fff; padding:10px;}
/*项目信息*/
.project_info{ background:#fff; padding:10px;width:222px; padding-right:8px;}
.pr_info_id{ width:137px; color:#5a5a5a; font-size:14px;}
.pr_info_join{}
.pr_info_join a{ color:#fff; display:block; padding:0 5px; margin-right:10px; float:left; height:22px; background:#64bdd9; text-align:center; }
.pr_info_join a:hover{ background:#41a8c8;}
a.pr_info_name{ color:#3e4040; font-size:14px; line-height:1.5;}
a:hover.pr_info_name{ color:#3ca5c6;}
.pr_info_score{ font-size:14px; color:#3e4040; }
.pr_info_score a{ color:#ff7143;}
.pr_info_score a:hover{ color:#64bdd9;}
.img_private{ background:url(../images/img_project.png) 0 0 no-repeat; width:32px; height:16px; color:#fff; font-size:12px; padding-left:7px; }
a.info_foot_num{ font-weight: bold; color:#3ca5c6; }
.pr_info_foot{ color:#7f7f7f; margin-top:5px; }
a:hover.info_foot_num{ color:#2390b2;}
/*左侧导航*/
.subNavBox{width:240px; background:#fff;margin:10px 10px 0 0;}
.subNav{border-bottom:solid 1px #e5e3da;cursor:pointer;font-weight:bold;font-size:14px;color:#3ca5c6;line-height:28px;padding-left:10px;background-color:#fff;}
.subNav_jiantou{background:url(../images/jiantou1.jpg) no-repeat;background-position:95% 50%; background-color:#fff;}
.subNav_jiantou:hover{color:#0781b4; }
.currentDd{color:#0781b4; }
.currentDt{background-color:#fff; }
.navContent{display: none;border-bottom:solid 1px #e5e3da; }
.navContent li a{display:block;width:240px;heigh:28px;text-align:center;font-size:12px;line-height:28px;color:#333}
.navContent li a:hover{color:#fff;background-color:#b3e0ee}
.subnav_num{ font-weight:normal; color:#ff7143; font-size:12px;}
a.subnav_green{ background:#28be6c; color:#fff; font-size:12px; font-weight:normal;height:20px; padding:0px 5px; text-align:center; margin-top:5px; margin-left:82px;}
a.ml95{ margin-left:97px;}
a.ml105{ margin-left:120px;}
a:hover.subnav_green{ background:#14ad5a;}
/*简介*/
.project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d;}
.lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;}
.lg-foot:hover{ color:#787b7e;}
/****标签(和资源库的tag样式一致)***/
.project_Label{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px;}
a.yellowBtn{ display:inline-block;color:#0d90c3; height:22px;}
.submit{height:21px;border:0; cursor:pointer; background:url(../images/btn.png) no-repeat 0 0;width:42px; margin-top:2px; margin-left:3px; }
.isTxt{background:#fbfbfb url(../images/inputBg.png) repeat-x left top;height:22px;line-height:22px;border:1px solid #c1c1c1;padding:0 5px;color:#666666;}
.re_tag{ width: auto; padding:0 5px; height:22px; border:1px solid #f8df8c; background:#fffce6; margin-right:5px; }
.re_tag a{ color:#0d90c3;}
.tag_h span,.tag_h a{ margin-bottom:5px;}
/*右侧内容--动态*/
.project_r_h{ width:670px; height:40px; background:#eaeaea;}
.project_h2{ background:#64bdd9; color:#fff; height:37px; width:90px; text-align:center; font-weight:normal; padding-top:3px; font-size:16px;}
.project_r_box{ border:1px solid #e2e1e1; width:670px; margin-top:10px;}
.project_h3 { color:#646464; font-size:14px; padding:0 10px; border-bottom:1px solid #e2e1e1;}
a.more{ float:right; font-size:12px; font-weight:normal; color:#a9a9a9; margin-top:3px;}
a:hover.more{ color:#64bdd9;}
.project_box_ul{ padding:0 10px;}
.project_box_list{ padding:10px 0; border-bottom:1px dashed #e2e1e1; padding-left:30px; color:#6f6c6c;}
.img_problem{ background:url(../images/img_project.png) 0 -20px no-repeat;}
.img_talk{ background:url(../images/img_project.png) 0 -62px no-repeat;}
.img_ziyuan{ background:url(../images/img_project.png) 0 -115px no-repeat;}
.img_edition{ background:url(../images/img_project.png) 0 -167px no-repeat;}
.project_name{ color:#058c42;}
.project_name:hover{ color:#016f33;}
.project_txt{ color:#0781b4; width:445px; display:block; float:left; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.project_txt02{ color:#0781b4; width:618px; display:block; float:left; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.project_txt:hover{ color:#066e9a;}
.noline{ border-bottom:none;}
/*弹框*/
.floatbox{ width:420px; border:3px solid #15bccf; background:#fff; padding:5px;}
.box_close{ display:block; float:right; width:16px; height:16px; background:url(../images/img_floatbox.png) 0 0 no-repeat;}
.box_close:hover{background:url(../images/img_floatbox.png) -22px 0 no-repeat;}
/*邮件邀请*/
.box_main{ width:345px; margin:0 auto;}
.box_h3{ color:#15bccf; text-align:center; font-size:16px;}
.box_p{ color:#404040; margin-bottom:5px;}
.fb_item{ color:#919191; border:1px solid #919191; height:28px; margin-bottom:10px; padding-left:5px; width:290px;}
.icon_addm{ background:url(../images/img_floatbox.png) 0 -33px no-repeat; width:16px; height:16px; display:block; margin:5px 0 0 5px;}
.icon_addm:hover{background:url(../images/img_floatbox.png) 0 -61px no-repeat; }
.icon_removem{ background:url(../images/img_floatbox.png) -22px -33px no-repeat;width:16px; height:16px; display:block; margin:5px 0 0 5px}
.icon_removem:hover{background:url(../images/img_floatbox.png) -22px -61px no-repeat;}
.btn_free{ background:#ff5722; display:block; width:80px; text-align:center; color:#fff; height:26px; padding-top:3px; margin-bottom:10px;}
.btn_free:hover{ background:#d63502;}
/*成员邀请*/
.invi_search{ width:230px; margin:0 auto;}
.invi_search_input{ border:1px solid #15bccf; width:180px; height:24px; color:#9b9b9b; padding-left:5px; margin-bottom:10px;}
.invi_search_btn{ background:#15bccf; color:#fff; text-align: center; width:40px; height:22px;border:1px solid #15bccf; padding-top:2px; cursor:pointer;}
.invi_search_btn:hover{ background:#0da1b2; border:1px solid #0da1b2;}
/*问题跟踪*/
.problem_top{ margin:10px 0 ;}
.problem_search_input{ border:1px solid #64bdd9; width:180px; height:24px; color:#9b9b9b; padding-left:5px; margin-bottom:10px;}
.problem_search_btn{ background:#64bdd9; color:#fff; text-align: center; width:40px; height:22px;border:1px solid #64bdd9; padding-top:2px; cursor:pointer;}
.problem_search_btn:hover{ background:#3da1c1; border:1px solid #3da1c1;}
.problem_new_btn{ margin-left:10px; border:1px solid #ff7143; color:#ff7143; width:60px; height:22px; font-size:12px; text-align:center; padding-top:2px;}
.problem_new_btn:hover{ background:#ff7143; color:#fff;}
.problem_p{ color:#535252; margin-top:5px;}
.problem_p span{ color:#ff3e00;}
.problem_pic{ display:block; width:42px; height:42px; padding:3px; border:1px solid #e3e3e3; margin-top:5px;}
.problem_pic:hover{border:1px solid #64bdd9;}
.problem_txt{ width:610px; margin-left:10px; color:#777777;}
.problem_name{ color:#ff5722;}
.problem_name:hover{ color:#d33503;}
.problem_tit{ color:#0781b4; width:430px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.problem_tit:hover{ color:#09658c; }
.problem_main{ border-bottom:1px dashed #d4d4d4; padding-bottom:10px; margin-bottom:10px;}
/****翻页***/
.wlist{}
.wlist a{ float:right; border:1px solid #64bdd9; padding:0 5px; margin-left:3px; color:#64bdd9;}
.wlist a:hover{border:1px solid #64bdd9; background-color:#64bdd9; color:#fff; text-decoration:none;}
.wlist_select a { background-color:#48aac9; color:#fff;}
/****讨论区***/
.talk_top{ margin:10px 0; font-size:14px; color:#4c4c4c;}
.talk_top span{ color:#ff7143;}
.talk_txt{ width:460px; margin-left:10px; color:#676868;}
.talk_up{ color:#f63c00;}
.talk_pic{width:32px; height:32px; padding:2px;}
.talk_btn{ background:#64bdd9; width:50px; height:22px; color:#fff; text-align:center; margin-top:12px; padding-top:2px;}
.talk_btn:hover{ background:#2a9dc1;}
/****讨论区内页***/
.mt0{ margin-top:0px;}
.talk_info{ color:#7d7d7d; margin-left:50px; margin-top:10px;}
.talk_edit{ color:#426e9a; margin-right:5px;}
.talk_edit:hover{ color:#ff5722;}
.talk_reply { background:#eeeeee; padding:10px; margin-bottom:10px;}
.talk_text{ border:1px solid #64bdd9; width:600px; color:#7d7d7d; padding:5px; margin:10px 0 10px 50px;}
/****资源库***/
.f_l{ float:left;}
.f_r{ float:right;}
.resource a{ text-align:center;}
.b_lblue{ background:#64bdd9;}
.b_dblue{ background:#55a1b9; cursor:pointer;}
.f_b{ font-weight: bold;}
.c_blue{ color:#64bdd9;}
.c_grey{ color:#999999;}
.c_grey02{ color:#666666;}
.f_14{ font-size:14px;}
.c_dblue{ color:#3e6d8e;}
.w90{width:90px;}
.ml10{margin-left:10px;}
.resource{ width:670px;}
.re_top{width:660px; height:40px; background:#eaeaea; padding:5px;}
.re_top input{ float:left;}
.re_search{ margin-top:7px; margin-left:5px;}
.re_schbox{ width:240px; height:24px; border:1px solid #64bdd9; color:#666666;}
.re_schbtn{ width:60px; height:26px; color:#fff; margin-right:5px; border:none; margin-left:0px; }
a.re_fabu { display:block; width:90px; height:35px; font-size:14px; color:#fff; text-align:center; padding-top:5px; }
a:hover.re_fabu{background:#55a1b9;}
.re_con{ margin:5px; width:665px;}
.re_con_top{color:#494949; }
.re_con_top span{ color:#999999; font-weight:bold;}
a.re_select{ display:block; width:88px; height:22px; border:1px solid #ff9900; color:#ff9900; margin-left:10px;}
a:hover.re_select{ background:#ff9900; color:#fff; text-decoration:none;}
.re_open{display:block; width:46px; height:22px; border:1px solid #64bdd9; color:#64bdd9; margin-left:10px;}
a:hover.re_open{ background:#64bdd9; color:#fff; text-decoration:none;}
a.re_de{ color:#6883b6; margin-left:15px;}
.re_con_box{ border-bottom:1px dashed #dadada; padding-bottom:10px; margin-bottom:10px;}
/****资源库***/
.setting{ background:url(../images/setting.jpg) 0 0 no-repeat; width:670px; height:443px;}