项目添加新用户邮件发送功能

Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
alan 2015-03-07 10:52:20 +08:00
parent fd97302947
commit 5ff43fdea7
11 changed files with 502 additions and 282 deletions

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

@ -129,7 +129,7 @@
<div class="subNavBox">
<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>
<div class="subNav">

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

@ -1,67 +1,67 @@
<div class="project_r_h">
<h2 class="project_h2">邀请加入</h2>
</div>
<%= error_messages_for 'member' %>
<%
roles = Role.givable.all
if @project.project_type == Project::ProjectType_course
roles = roles[3..5]
else
roles = roles[0..2]
end
members = @project.member_principals.includes(:roles, :principal).all.sort
%>
<div style="margin-left: 30px" >
<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">邀请Trustie注册用户</h3>
<% if roles.any? %>
<%= form_for(@member, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
<div class="invi_search">
<%= label_tag "principal_search", l(:label_principal_search) %>
<%= text_field_tag 'principal_search', nil %>
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js') }')" %>
<div id="principals_for_new_member">
<%= render_principals_for_new_members(@project) %>
</div>
<p style="padding-top: 5px">
<%= l(:label_role_plural) %>:
<% roles.each do |role| %>
<label>
<%= check_box_tag 'membership[role_ids][]', role.id %>
<%= h role %>
</label>
<% end %>
</p>
<p>
<%= submit_tag l(:button_add), :id => 'member-add-submit', :style => 'display:block; width:80px; text-align:center; color:#fff; height:26px; padding-top:3px; margin-bottom:10px;' %>
</p>
<% end %>
<% end %>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
var collection=$("#principals_for_new_member").children("#principals").children("label");
collection.css("text-overflow","ellipsis");
collection.css("white-space","nowrap");
collection.css("width","200px");
collection.css("overflow","hidden");
for(i=0;i<collection.length;i++){ //增加悬浮显示
var label=collection[i];
var text=$(label).text();
$(label).attr("title",text);
}
});
<div class="project_r_h">
<h2 class="project_h2">邀请加入</h2>
</div>
<%= error_messages_for 'member' %>
<%
roles = Role.givable.all
if @project.project_type == Project::ProjectType_course
roles = roles[3..5]
else
roles = roles[0..2]
end
members = @project.member_principals.includes(:roles, :principal).all.sort
%>
<div style="margin-left: 30px" >
<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">邀请Trustie注册用户</h3>
<% if roles.any? %>
<%= form_for(@member, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
<div class="invi_search">
<%= label_tag "principal_search", l(:label_principal_search) %>
<%= text_field_tag 'principal_search', nil %>
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js') }')" %>
<div id="principals_for_new_member">
<%= render_principals_for_new_members(@project) %>
</div>
<p style="padding-top: 5px">
<%= l(:label_role_plural) %>:
<% roles.each do |role| %>
<label>
<%= check_box_tag 'membership[role_ids][]', role.id %>
<%= h role %>
</label>
<% end %>
</p>
<p>
<%= submit_tag l(:button_add), :id => 'member-add-submit', :style => 'display:block; width:80px; text-align:center; color:#fff; height:26px; padding-top:3px; margin-bottom:10px;' %>
</p>
<% end %>
<% end %>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
var collection=$("#principals_for_new_member").children("#principals").children("label");
collection.css("text-overflow","ellipsis");
collection.css("white-space","nowrap");
collection.css("width","200px");
collection.css("overflow","hidden");
for(i=0;i<collection.length;i++){ //增加悬浮显示
var label=collection[i];
var text=$(label).text();
$(label).attr("title",text);
}
});
</script>

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

@ -1,182 +1,182 @@
<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_activity) %></h2>
</div>
<%= javascript_include_tag "jquery.infinitescroll.js" %>
<script>
/* $(document).ready(function (){ //别忘了加这句除非你没学Jquery
$("#container").infinitescroll({
navSelector: "#paginator", //页面分页元素--成功后自动隐藏
nextSelector: "#paginator a[rel='next']", //下一页的按钮,但是貌似这个选不中
itemSelector: ".scroll " ,
path: function(current){ var page = parseInt(current)+1;
var project_id = <%= @project.id %>;
return "/projects/"+project_id+"?page="+page
}, //下一页的路径
animate: true,
maxPage: 500
});
});*/
</script>
<div id="container">
<div class="scroll">
<% unless @events_pages.empty? %>
<% @events_pages.each do |e| -%>
<% act = e.forge_act %>
<% if e.forge_act_type == "Issue" %>
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;width: 100%;word-wrap: break-word;word-break: break-all;margin-top: 10px;">
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
<%= image_tag(url_to_avatar(act.author), :class => "avatar") %>
</div>
<div class="activity-content" style="padding:5px 5px 5px 70px;">
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project_id %></strong>
<span class="activity-title font_lighter">
<%= link_to_user(act.author) %>
<%= l(:label_new_activity) %>
</span>
<%= link_to format_activity_title("#{act.source_from}##{act.project_issues_index} (#{act.status}): #{act.tracker.name} #{act.subject}"),
{:controller => 'issues',
:action => 'show',
:id => act.id} %>
<div class="activity_description info-break" style="font-size: 13px;width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textAreailizable act,:description %>
</div>
<div class="activity_status" style="position:relative; padding-top: 3px;">
<span class="font_lighter"> <%= l :label_activity_time %>
&nbsp; <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></span>
<div class="" style="display:inline-block;position:absolute; right:2%;">
<span> <%= link_to l(:label_find_all_comments), issue_path(act.id) %> </span><span class="font_lighter"><%= l(:label_comments_count, :count => act.journals.count) %></span>
</div>
</div>
</div>
</div>
<% elsif e.forge_act_type == "Journal" %>
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;width: 100%;word-wrap: break-word;word-break: break-all;">
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
</div>
<div class="activity-content" style="padding:5px 5px 5px 70px;">
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project_id %></strong>
<span class="activity-title font_lighter">
<%= link_to(h(e.user), user_path(e.user_id)) %>
<%= l(:label_new_activity) %>
</span>
<%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.id)) %>
<%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.project_issues_index}: #{act.issue.subject}"),
{:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %>
<div class="activity_description info-break" style="font-size: 13px;width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textAreailizable act,:notes %>
</div>
<div class="activity_status" style="position:relative; padding-top: 3px;">
<span class="font_lighter"> <%= l :label_activity_time %>
&nbsp; <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></span>
</div>
</div>
</div>
<% elsif e.forge_act_type == "Message" %>
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;width: 100%;word-wrap: break-word;word-break: break-all;">
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
</div>
<div class="activity-content" style="padding:5px 5px 5px 70px;">
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project_id %></strong>
<span class="activity-title font_lighter">
<%= link_to(h(e.user), user_path(e.user_id)) %>
<%= l(:label_new_activity) %>
</span>
<%= link_to format_activity_title("#{act.board.name}: #{act.subject}"),
{:controller => 'messages',
:action => 'show',
:board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %>
<div class="activity_description info-break" style="font-size: 13px;width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textAreailizable act,:content %>
</div>
<div class="activity_status" style="position:relative; padding-top: 3px;">
<span class="font_lighter"> <%= l :label_activity_time %>
&nbsp; <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></span>
</div>
</div>
</div>
<% elsif e.forge_act_type == "News" %>
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;width: 100%;word-wrap: break-word;word-break: break-all;">
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
</div>
<div class="activity-content" style="padding:5px 5px 5px 70px;">
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project_id %></strong>
<span class="activity-title font_lighter">
<%= link_to(h(e.user), user_path(e.user_id)) %>
<%= l(:label_new_activity) %>
</span>
<% unless act.nil? %>
<%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %>
<% end %>
<div class="activity_description info-break" style="font-size: 13px;width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textAreailizable act,:description %>
</div>
<div class="activity_status" style="position:relative; padding-top: 3px;">
<span class="font_lighter"> <%= l :label_activity_time %>
&nbsp; <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></span>
<div class="" style="display:inline-block;position:absolute; right:2%;">
<span>
<%= link_to l(:label_find_all_comments), {:controller => 'news', :action => 'show', :id => act.id} %>
</span>
<span class="font_lighter">
<%= l(:label_comments_count, :count => act.comments_count) %>
</span>
</div>
</div>
</div>
</div>
<% elsif e.forge_act_type == "Document" %>
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;width: 100%;word-wrap: break-word;word-break: break-all;">
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
</div>
<div class="activity-content" style="padding:5px 5px 5px 70px;">
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project_id %></strong>
<span class="activity-title font_lighter">
<%= link_to(h(e.user), user_path(e.user_id)) %>
<%= l(:label_new_activity) %>
</span>
<%= link_to format_activity_title("#{l(:label_document)}: #{act.title}"), {:controller => 'documents', :action => 'show', :id => act.id} %>
<div class="activity_description info-break" style="font-size: 13px;width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textAreailizable act,:description %>
</div>
<div class="activity_status" style="position:relative; padding-top: 3px;">
<span class="font_lighter"> <%= l :label_activity_time %>
&nbsp; <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></span>
</div>
</div>
</div>
<% elsif e.forge_act_type == "Attachment" %>
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;width: 100%;word-wrap: break-word;word-break: break-all;">
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
</div>
<div class="activity-content" style="padding:5px 5px 5px 70px;">
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project_id %></strong>
<span class="activity-title font_lighter">
<%= link_to(h(e.user), user_path(e.user_id)) %>
<%= l(:label_new_activity) %>
</span>
<%= link_to format_activity_title("#{l(:label_attachment)}: #{act.filename}"), {:controller => 'attachments', :action => 'show', :id => act.id} %>
<div class="activity_description info-break" style="font-size: 13px;width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textAreailizable act,:description %>
</div>
<div class="activity_status" style="position:relative; padding-top: 3px;">
<span class="font_lighter"> <%= l :label_activity_time %>
&nbsp; <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></span>
</div>
</div>
</div>
<% end %>
<% end %>
<% end %>
</div>
</div>
<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_activity) %></h2>
</div>
<%= javascript_include_tag "jquery.infinitescroll.js" %>
<script>
/* $(document).ready(function (){ //别忘了加这句除非你没学Jquery
$("#container").infinitescroll({
navSelector: "#paginator", //页面分页元素--成功后自动隐藏
nextSelector: "#paginator a[rel='next']", //下一页的按钮,但是貌似这个选不中
itemSelector: ".scroll " ,
path: function(current){ var page = parseInt(current)+1;
var project_id = <%= @project.id %>;
return "/projects/"+project_id+"?page="+page
}, //下一页的路径
animate: true,
maxPage: 500
});
});*/
</script>
<div id="container">
<div class="scroll">
<% unless @events_pages.empty? %>
<% @events_pages.each do |e| -%>
<% act = e.forge_act %>
<% if e.forge_act_type == "Issue" %>
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;width: 100%;word-wrap: break-word;word-break: break-all;margin-top: 10px;">
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
<%= image_tag(url_to_avatar(act.author), :class => "avatar") %>
</div>
<div class="activity-content" style="padding:5px 5px 5px 70px;">
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project_id %></strong>
<span class="activity-title font_lighter">
<%= link_to_user(act.author) %>
<%= l(:label_new_activity) %>
</span>
<%= link_to format_activity_title("#{act.source_from}##{act.project_issues_index} (#{act.status}): #{act.tracker.name} #{act.subject}"),
{:controller => 'issues',
:action => 'show',
:id => act.id} %>
<div class="activity_description info-break" style="font-size: 13px;width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textAreailizable act,:description %>
</div>
<div class="activity_status" style="position:relative; padding-top: 3px;">
<span class="font_lighter"> <%= l :label_activity_time %>
&nbsp; <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></span>
<div class="" style="display:inline-block;position:absolute; right:2%;">
<span> <%= link_to l(:label_find_all_comments), issue_path(act.id) %> </span><span class="font_lighter"><%= l(:label_comments_count, :count => act.journals.count) %></span>
</div>
</div>
</div>
</div>
<% elsif e.forge_act_type == "Journal" %>
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;width: 100%;word-wrap: break-word;word-break: break-all;">
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
</div>
<div class="activity-content" style="padding:5px 5px 5px 70px;">
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project_id %></strong>
<span class="activity-title font_lighter">
<%= link_to(h(e.user), user_path(e.user_id)) %>
<%= l(:label_new_activity) %>
</span>
<%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.id)) %>
<%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.project_issues_index}: #{act.issue.subject}"),
{:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %>
<div class="activity_description info-break" style="font-size: 13px;width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textAreailizable act,:notes %>
</div>
<div class="activity_status" style="position:relative; padding-top: 3px;">
<span class="font_lighter"> <%= l :label_activity_time %>
&nbsp; <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></span>
</div>
</div>
</div>
<% elsif e.forge_act_type == "Message" %>
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;width: 100%;word-wrap: break-word;word-break: break-all;">
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
</div>
<div class="activity-content" style="padding:5px 5px 5px 70px;">
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project_id %></strong>
<span class="activity-title font_lighter">
<%= link_to(h(e.user), user_path(e.user_id)) %>
<%= l(:label_new_activity) %>
</span>
<%= link_to format_activity_title("#{act.board.name}: #{act.subject}"),
{:controller => 'messages',
:action => 'show',
:board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %>
<div class="activity_description info-break" style="font-size: 13px;width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textAreailizable act,:content %>
</div>
<div class="activity_status" style="position:relative; padding-top: 3px;">
<span class="font_lighter"> <%= l :label_activity_time %>
&nbsp; <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></span>
</div>
</div>
</div>
<% elsif e.forge_act_type == "News" %>
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;width: 100%;word-wrap: break-word;word-break: break-all;">
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
</div>
<div class="activity-content" style="padding:5px 5px 5px 70px;">
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project_id %></strong>
<span class="activity-title font_lighter">
<%= link_to(h(e.user), user_path(e.user_id)) %>
<%= l(:label_new_activity) %>
</span>
<% unless act.nil? %>
<%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %>
<% end %>
<div class="activity_description info-break" style="font-size: 13px;width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textAreailizable act,:description %>
</div>
<div class="activity_status" style="position:relative; padding-top: 3px;">
<span class="font_lighter"> <%= l :label_activity_time %>
&nbsp; <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></span>
<div class="" style="display:inline-block;position:absolute; right:2%;">
<span>
<%= link_to l(:label_find_all_comments), {:controller => 'news', :action => 'show', :id => act.id} %>
</span>
<span class="font_lighter">
<%= l(:label_comments_count, :count => act.comments_count) %>
</span>
</div>
</div>
</div>
</div>
<% elsif e.forge_act_type == "Document" %>
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;width: 100%;word-wrap: break-word;word-break: break-all;">
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
</div>
<div class="activity-content" style="padding:5px 5px 5px 70px;">
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project_id %></strong>
<span class="activity-title font_lighter">
<%= link_to(h(e.user), user_path(e.user_id)) %>
<%= l(:label_new_activity) %>
</span>
<%= link_to format_activity_title("#{l(:label_document)}: #{act.title}"), {:controller => 'documents', :action => 'show', :id => act.id} %>
<div class="activity_description info-break" style="font-size: 13px;width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textAreailizable act,:description %>
</div>
<div class="activity_status" style="position:relative; padding-top: 3px;">
<span class="font_lighter"> <%= l :label_activity_time %>
&nbsp; <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></span>
</div>
</div>
</div>
<% elsif e.forge_act_type == "Attachment" %>
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;width: 100%;word-wrap: break-word;word-break: break-all;">
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
</div>
<div class="activity-content" style="padding:5px 5px 5px 70px;">
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project_id %></strong>
<span class="activity-title font_lighter">
<%= link_to(h(e.user), user_path(e.user_id)) %>
<%= l(:label_new_activity) %>
</span>
<%= link_to format_activity_title("#{l(:label_attachment)}: #{act.filename}"), {:controller => 'attachments', :action => 'show', :id => act.id} %>
<div class="activity_description info-break" style="font-size: 13px;width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textAreailizable act,:description %>
</div>
<div class="activity_status" style="position:relative; padding-top: 3px;">
<span class="font_lighter"> <%= l :label_activity_time %>
&nbsp; <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></span>
</div>
</div>
</div>
<% end %>
<% end %>
<% end %>
</div>
</div>
<%= paginate @events_pages %>

View File

@ -1,20 +1,20 @@
<div id="tags_show">
<%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
</div>
<% if User.current.logged? %>
<span> <%= toggle_link ("+ 添加标签"), 'put-tag-form', {:focus => 'tags_name'} %> </span>
<% end %>
<div id="put-tag-form" style="display: none;text-align: center">
<%= form_for "tag_for_save",:remote=>true,:url=>tag_path,
:update => "tags_show",
:complete => '$("#put-tag-form").slideUp();' do |f| %>
<%= f.text_field :name ,:id => "tags_name",:size=>"20",
:require=>true,
:maxlength => Setting.tags_max_length,
:minlength=>Setting.tags_min_length %>
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
<a href="#" onclick='$("#tags_name").parent().submit();' type="button" class="submit f_l" style="margin-top: 10px;"></a>
<% end %>
</div>
<div id="tags_show">
<%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
</div>
<% if User.current.logged? %>
<span> <%= toggle_link ("+ 添加标签"), 'put-tag-form', {:focus => 'tags_name'} %> </span>
<% end %>
<div id="put-tag-form" style="display: none;text-align: center">
<%= form_for "tag_for_save",:remote=>true,:url=>tag_path,
:update => "tags_show",
:complete => '$("#put-tag-form").slideUp();' do |f| %>
<%= f.text_field :name ,:id => "tags_name",:size=>"20",
:require=>true,
:maxlength => Setting.tags_max_length,
:minlength=>Setting.tags_min_length %>
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
<a href="#" onclick='$("#tags_name").parent().submit();' type="button" class="submit f_l" style="margin-top: 10px;"></a>
<% end %>
</div>

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

@ -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;}