This commit is contained in:
whimlex 2015-04-23 10:20:01 +08:00
commit 2070d69d44
11 changed files with 39 additions and 19 deletions

View File

@ -243,8 +243,10 @@ class ProjectsController < ApplicationController
# Author lizanle # Author lizanle
# Description 项目动态展示方法,删除了不必要的代码 # Description 项目动态展示方法,删除了不必要的代码
def show def show
# params[:login]为邮箱邀请用户加入,主要功能:
# 试图跳转到请求的按钮 # 1、自动注册
# 2、加入项目、创建角色
# 3、用户得分
if params[:login] if params[:login]
login = params[:login] login = params[:login]
login = login.sub(/%40/,'@') login = login.sub(/%40/,'@')
@ -252,6 +254,7 @@ class ProjectsController < ApplicationController
password = params[:password] password = params[:password]
us = UsersService.new us = UsersService.new
user = us.register_auto(login,mail, password) user = us.register_auto(login,mail, password)
Member.create(:role_ids => [4], :user_id => user.id,:project_id => @project.id) Member.create(:role_ids => [4], :user_id => user.id,:project_id => @project.id)
UserGrade.create(:user_id => user.id, :project_id => @project.id) UserGrade.create(:user_id => user.id, :project_id => @project.id)
User.current = user unless User.current.nil? User.current = user unless User.current.nil?

View File

@ -53,7 +53,8 @@ class Mailer < ActionMailer::Base
@subject = "#{invitor.name} #{l(:label_invite_project)} #{project.name} " @subject = "#{invitor.name} #{l(:label_invite_project)} #{project.name} "
@password = newpass(6) @password = newpass(6)
@project_url = url_for(:controller => 'projects', :action => 'show', :id => project.id, @project_url = url_for(:controller => 'projects', :action => 'show', :id => project.id,
:password => @password, :login => email) :password => @password,
:login => email)
mail :to => email, :subject => @subject mail :to => email, :subject => @subject
end end

View File

@ -44,12 +44,14 @@ class UsersService
#location = get_user_location @user #location = get_user_location @user
#{:id => @user.id, :img_url => img_url, :nickname => @user.login, :gender => gender, :work_unit => work_unit, :mail => @user.mail, :location => location, :brief_introduction => @user.user_extensions.brief_introduction} #{:id => @user.id, :img_url => img_url, :nickname => @user.login, :gender => gender, :work_unit => work_unit, :mail => @user.mail, :location => location, :brief_introduction => @user.user_extensions.brief_introduction}
end end
# 自动注册功能 FOR邮件邀请
def register_auto(login,mail,password) def register_auto(login,mail,password)
@user = User.new @user = User.new
@user.admin = false @user.admin = false
@user.register @user.register
@user.login = login @user.login = login
@user.mail =mail @user.mail = mail
password_confirmation = password password_confirmation = password
should_confirmation_password = true should_confirmation_password = true
if !password.blank? && !password_confirmation.blank? && should_confirmation_password if !password.blank? && !password_confirmation.blank? && should_confirmation_password
@ -59,9 +61,7 @@ class UsersService
else else
@user.password = "" @user.password = ""
end end
@user = automatically_register(@user) @user = automatically_register(@user)
if @user.id != nil if @user.id != nil
ue = @user.user_extensions ||= UserExtensions.new ue = @user.user_extensions ||= UserExtensions.new
ue.user_id = @user.id ue.user_id = @user.id
@ -69,6 +69,7 @@ class UsersService
end end
@user @user
end end
#显示用户 #显示用户
#id用户id #id用户id
def show_user(params) def show_user(params)

View File

@ -64,7 +64,7 @@
<% images = attachments.select(&:thumbnailable?) %> <% images = attachments.select(&:thumbnailable?) %>
<% if images.any? %> <% if images.any? %>
<% images.each do |attachment| %> <% images.each do |attachment| %>
<div class="pro_pic fl "><%= thumbnail_issue_tag(attachment) %></div> <div class="pro_pic fl " width="100" height="73"><%= thumbnail_issue_tag(attachment) %></div>
<% end %> <% end %>
<% end %> <% end %>
<% end %> <% end %>

View File

@ -67,7 +67,7 @@
<%= f.text_field :deadline, <%= f.text_field :deadline,
:required => true, :required => true,
:size => 60, :size => 60,
:style => "width:150px;", :style => "width:150px;float:left;",
:readonly => true, :readonly => true,
:placeholder => "#{l(:label_deadline)}" :placeholder => "#{l(:label_deadline)}"
%> %>

View File

@ -5,12 +5,14 @@
<% if @edit_allowed || !@allowed_statuses.empty? %> <% if @edit_allowed || !@allowed_statuses.empty? %>
<div id="all_attributes" style="display:none;"> <div id="all_attributes" style="display:none;">
<%= render :partial => 'form', :locals => {:f => f} %> <%= render :partial => 'form', :locals => {:f => f} %>
<div class="ping_C mb10"></div>
<!--<a remote="true" href="javascript:void(0)" class="blue_btn fl" style="margin-left: 80px;margin-bottom: 10px;margin-top: -10px;" onclick="$('#issue-form').submit();">--> <!--<a remote="true" href="javascript:void(0)" class="blue_btn fl" style="margin-left: 80px;margin-bottom: 10px;margin-top: -10px;" onclick="$('#issue-form').submit();">-->
<!--<%#= l(:button_submit) %>--> <!--<%#= l(:button_submit) %>-->
<!--</a>--> <!--</a>-->
</div> </div>
<% end %><!--end--> <% end %><!--end-->
<div class="ping_C mb10"></div>
<!--<fieldset><legend><%#= l(:field_notes) %></legend>--> <!--<fieldset><legend><%#= l(:field_notes) %></legend>-->
<!--回复框--> <!--回复框-->
<% if @journals.present? %> <% if @journals.present? %>

View File

@ -228,9 +228,9 @@
<div class=" mt10"> <div class=" mt10">
<h3 class="mb10 c_blue">请选择项目类型:</h3> <h3 class="mb10 c_blue">请选择项目类型:</h3>
<ul class="mb10" id="project_type"> <ul class="mb10" id="project_type">
<li><input type="radio" name="project_type" <%= @project.project_new_type == 1 ? 'checked' : ''%> id="development_group"/><label >&nbsp;&nbsp;开发模式</label></li> <li><input type="radio" name="project_type" <%= @project.project_new_type == 1 ? 'checked' : ''%> id="development_group"/><label class="f14">&nbsp;&nbsp;开发模式<span class="f12 ml5 c_grey">为团队开发提供一系列在线协同工具。</span></label></li>
<li><input type="radio" name="project_type" <%= @project.project_new_type == 2 ? 'checked' : ''%> id="research_group"/><label >&nbsp;&nbsp;研讨模式</label></li> <li><input type="radio" name="project_type" <%= @project.project_new_type == 2 ? 'checked' : ''%> id="research_group"/><label class="f14">&nbsp;&nbsp;研讨模式<span class="f12 ml5 c_grey">为小组研究提供阶段汇报和交流工具。</span></label></li>
<li><input type="radio" name="project_type" <%= @project.project_new_type == 3 ? 'checked' : ''%> id="friend_organization"/><label >&nbsp;&nbsp;圈子模式</label></li> <li><input type="radio" name="project_type" <%= @project.project_new_type == 3 ? 'checked' : ''%> id="friend_organization"/><label class="f14">&nbsp;&nbsp;圈子模式<span class="f12 ml5 c_grey">为朋友圈提供简洁的交流和分享工具。</span></label></li>
</ul> </ul>
<a href="javascript:void(0)" class="orange_btn" onclick="click_ok('<%= change_project_type_project_path @project%>');" >确定</a> <a href="javascript:void(0)" class="orange_btn" onclick="click_ok('<%= change_project_type_project_path @project%>');" >确定</a>

View File

@ -25,7 +25,7 @@
<td> <%= checked_image repository.is_default? %></td> <td> <%= checked_image repository.is_default? %></td>
<td><%=h repository.scm_name %></td> <td><%=h repository.scm_name %></td>
<%if repository.scm_name=="Git"%> <%if repository.scm_name=="Git"%>
<td style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" class="c_blue" title="http://<%= repository.login.to_s %>_<%= repository.identifier.to_s%>@<%= ip %> <td style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" title="http://<%= repository.login.to_s %>_<%= repository.identifier.to_s%>@<%= ip %>
<%=h repository.url.slice(project_path_cut, repository.url.length) %>"> <%=truncate( 'http://' << repository.login.to_s << '_'<< repository.identifier.to_s << '@'<< ip.to_s << h( repository.url.slice(project_path_cut, repository.url.length)),:length=>20)%></td><!--Modified by tanxianbo--> <%=h repository.url.slice(project_path_cut, repository.url.length) %>"> <%=truncate( 'http://' << repository.login.to_s << '_'<< repository.identifier.to_s << '@'<< ip.to_s << h( repository.url.slice(project_path_cut, repository.url.length)),:length=>20)%></td><!--Modified by tanxianbo-->
<%else %> <%else %>
<td style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" ><%=h truncate(repository.url,:length=>10) %></td> <td style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" ><%=h truncate(repository.url,:length=>10) %></td>
@ -33,8 +33,8 @@
<td><a href="javascript:viod(0)" class="c_blue" > <td><a href="javascript:viod(0)" class="c_blue" >
<% if repository.scm_name=="Git"%> <% if repository.scm_name=="Git"%>
<%if User.current.allowed_to?(:manage_repository, @project) %> <%if User.current.allowed_to?(:manage_repository, @project) %>
<%= link_to(l(:label_user_plural), committers_repository_path(repository), <%= link_to(l(:label_user_plural), committers_repository_path(repository)
:class => 'c_blue') %> ) %>
<% end %> <% end %>
<% end %> <% end %>
</a></td> </a></td>

View File

@ -42,9 +42,9 @@
</td> </td>
<td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" title="<%= h(version.wiki_page_title)%>"> <td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" title="<%= h(version.wiki_page_title)%>">
<%= link_to_if_authorized(h(version.wiki_page_title), {:controller => 'wiki', <%= link_to_if_authorized(h(version.wiki_page_title), {:controller => 'wiki',
:action => 'show', :action => 'show',
:project_id => version.project, :project_id => version.project,
:id => Wiki.titleize(version.wiki_page_title)}) || h(version.wiki_page_title) unless version.wiki_page_title.blank? || version.project.wiki.nil? %> :id => Wiki.titleize(version.wiki_page_title)}) || h(version.wiki_page_title) unless version.wiki_page_title.blank? || version.project.wiki.nil? %>
</td> </td>
<td class="buttons"> <td class="buttons">
<% if version.project == @project && User.current.allowed_to?(:manage_versions, @project) %> <% if version.project == @project && User.current.allowed_to?(:manage_versions, @project) %>

View File

@ -3152,6 +3152,18 @@ input[class~='m3p10'], .m3p10 {
.break_word{word-break: break-all;word-wrap: break-word;} .break_word{word-break: break-all;word-wrap: break-word;}
.break_word_firefox{white-space: pre-wrap;word-break: break-all;} .break_word_firefox{white-space: pre-wrap;word-break: break-all;}
/*日历选择图*/
img.ui-datepicker-trigger {
display:block;
background:url(/images/public_icon.png) -31px 0 no-repeat;
cursor: pointer;
vertical-align: middle;
margin-left: 5px;
margin-top: 5px;
width:16px;
height:15px;
float:left;
}
/*lizanle 日誌搜索結果樣式*/ /*lizanle 日誌搜索結果樣式*/
.search_results { .search_results {

View File

@ -131,6 +131,7 @@ a.c_green{ color:#28be6c;}
.c_blue{ color:#15bccf;} .c_blue{ color:#15bccf;}
.c_red{ color:#F00;} .c_red{ color:#F00;}
.c_green{ color:#28be6c;} .c_green{ color:#28be6c;}
.c_grey{color:#999;}
.c_dblue{ color:#09658c;} .c_dblue{ color:#09658c;}
.b_blue{background:#64bdd9;} .b_blue{background:#64bdd9;}
.b_green{background:#28be6c;} .b_green{background:#28be6c;}
@ -404,7 +405,7 @@ div.flash.warning, .conflict {
/*弹出框*/ /*弹出框*/
.black_overlay{display:none;position:fixed;top:0px;left:0px;width:100%;height:100%;background-color:black;z-index:1001;-moz-opacity:0.8;opacity:.80;filter:alpha(opacity=80);} .black_overlay{display:none;position:fixed;top:0px;left:0px;width:100%;height:100%;background-color:black;z-index:1001;-moz-opacity:0.8;opacity:.80;filter:alpha(opacity=80);}
.white_content{display:none;position:fixed;top:15%;left:30%;width:420px;height: auto; margin-bottom:20px;padding:16px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;} .white_content{display:none;position:fixed;top:15%;left:30%;width:420px;height: auto; margin-bottom:20px;padding:16px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;}
.white_content02{display:none;position:fixed;top:15%;left:30%;width:200px;height: auto; margin-bottom:20px;padding:10px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;} .white_content02{display:none;position:fixed;top:15%;left:30%;width:310px;height: auto; margin-bottom:20px;padding:10px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;}
.floatbox{ width:420px; border:3px solid #15bccf; background:#fff; padding:5px;} .floatbox{ width:420px; border:3px solid #15bccf; background:#fff; padding:5px;}
a.box_close{ display:block; float:right; width:16px; height:16px; background:url(../images/img_floatbox.png) 0 0 no-repeat;} a.box_close{ display:block; float:right; width:16px; height:16px; background:url(../images/img_floatbox.png) 0 0 no-repeat;}
a.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;} a.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;}