Merge remote-tracking branch 'origin/szzh' into szzh
This commit is contained in:
commit
f89a317a96
|
@ -248,16 +248,9 @@ class ProjectsController < ApplicationController
|
||||||
# 2、加入项目、创建角色
|
# 2、加入项目、创建角色
|
||||||
# 3、用户得分
|
# 3、用户得分
|
||||||
if params[:login]
|
if params[:login]
|
||||||
login = params[:login]
|
# 自动激活用户
|
||||||
login = login.sub(/%40/,'@')
|
user.status = 1
|
||||||
mail = params[:login]
|
user.save
|
||||||
password = params[:password]
|
|
||||||
us = UsersService.new
|
|
||||||
user = us.register_auto(login,mail, password)
|
|
||||||
|
|
||||||
Member.create(:role_ids => [4], :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?
|
|
||||||
end
|
end
|
||||||
if params[:jump] && redirect_to_project_menu_item(@project, params[:jump])
|
if params[:jump] && redirect_to_project_menu_item(@project, params[:jump])
|
||||||
return
|
return
|
||||||
|
|
|
@ -329,11 +329,12 @@ module ApplicationHelper
|
||||||
imagesize = attachment.thumbnail(:size => "200*200")
|
imagesize = attachment.thumbnail(:size => "200*200")
|
||||||
imagepath = named_attachment_path(attachment, attachment.filename)
|
imagepath = named_attachment_path(attachment, attachment.filename)
|
||||||
if imagesize
|
if imagesize
|
||||||
link_to image_tag(thumbnail_path(attachment), height: '73', width: '100'),
|
link_to image_tag(thumbnail_path(attachment), height: '73', width: '100', name: 'issue_attachment_picture'),
|
||||||
imagepath,
|
imagepath,
|
||||||
:title => attachment.filename
|
:title => attachment.filename
|
||||||
|
|
||||||
else
|
else
|
||||||
link_to image_tag(imagepath , height: '73', width: '100'),
|
link_to image_tag(imagepath , height: '73', width: '100', name: 'issue_attachment_picture'),
|
||||||
imagepath,
|
imagepath,
|
||||||
:title => attachment.filename
|
:title => attachment.filename
|
||||||
end
|
end
|
||||||
|
|
|
@ -33,7 +33,7 @@ class Mailer < ActionMailer::Base
|
||||||
@target = cls
|
@target = cls
|
||||||
end
|
end
|
||||||
def method_missing(name, *args, &block)
|
def method_missing(name, *args, &block)
|
||||||
if Setting.delayjob_enabled && Object.const_defined?('Delayed')
|
if Setting.delayjob_enabled? && Object.const_defined?('Delayed')
|
||||||
@target.delay.send(name, *args, &block)
|
@target.delay.send(name, *args, &block)
|
||||||
else
|
else
|
||||||
@target.send(name, *args, &block).deliver
|
@target.send(name, *args, &block).deliver
|
||||||
|
@ -52,9 +52,20 @@ class Mailer < ActionMailer::Base
|
||||||
@email = email
|
@email = email
|
||||||
@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,
|
|
||||||
:password => @password,
|
login = email
|
||||||
:login => email)
|
login = login.sub(/%40/,'@')
|
||||||
|
us = UsersService.new
|
||||||
|
# 自动激活用户
|
||||||
|
user = us.register_auto(login, @email, @password)
|
||||||
|
|
||||||
|
Member.create(:role_ids => [4], :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 = user
|
||||||
|
@token = Token.get_token_from_user(user, 'autologin')
|
||||||
|
@project_url = url_for(:controller => 'projects', :action => 'show', :id => project.id,:user => user, :token => @token.value
|
||||||
|
)
|
||||||
mail :to => email, :subject => @subject
|
mail :to => email, :subject => @subject
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ class Principal < ActiveRecord::Base
|
||||||
self.table_name = "#{table_name_prefix}users#{table_name_suffix}"
|
self.table_name = "#{table_name_prefix}users#{table_name_suffix}"
|
||||||
|
|
||||||
# Account statuses
|
# Account statuses
|
||||||
|
# 0 全部;1 活动的; 2 已注册; 3 锁定
|
||||||
STATUS_ANONYMOUS = 0
|
STATUS_ANONYMOUS = 0
|
||||||
STATUS_ACTIVE = 1
|
STATUS_ACTIVE = 1
|
||||||
STATUS_REGISTERED = 2
|
STATUS_REGISTERED = 2
|
||||||
|
|
|
@ -1,3 +1,35 @@
|
||||||
|
<script type="text/javascript">
|
||||||
|
document.addEventListener('DOMContentLoaded',function(){
|
||||||
|
var img = document.getElementsByName('issue_attachment_picture');
|
||||||
|
function getImgNaturalStyle(img,callback) {
|
||||||
|
var nWidth, nHeight
|
||||||
|
if (typeof img.naturalWidth == "undefined"|| img.naturalWidth == 0) { // 现代浏览器
|
||||||
|
var image = new Image();
|
||||||
|
image.src = img.src;
|
||||||
|
nWidth = image.width;
|
||||||
|
nHeight = image.height;
|
||||||
|
} else {
|
||||||
|
nWidth = img.naturalWidth;
|
||||||
|
nHeight = img.naturalHeight;
|
||||||
|
}
|
||||||
|
return [nWidth, nHeight]
|
||||||
|
}
|
||||||
|
|
||||||
|
for(i=0;i<img.length;i++)
|
||||||
|
{
|
||||||
|
imgNatural = getImgNaturalStyle(img[i]);
|
||||||
|
var width = imgNatural[0];
|
||||||
|
var height = imgNatural[1];
|
||||||
|
if (width<100)
|
||||||
|
{
|
||||||
|
img[i].width = width;
|
||||||
|
}
|
||||||
|
if (height<73) {
|
||||||
|
img[i].height = height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
<div class="attachments" style="font-weight:normal;">
|
<div class="attachments" style="font-weight:normal;">
|
||||||
<% is_float ||= false %>
|
<% is_float ||= false %>
|
||||||
<% for attachment in attachments %>
|
<% for attachment in attachments %>
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show_project',:locals => {:project => project}) %>');
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show_project',:locals => {:project => project}) %>');
|
||||||
showModal('ajax-modal', '513px');
|
showModal('ajax-modal', '513px');
|
||||||
$('#ajax-modal').siblings().remove();
|
$('#ajax-modal').siblings().remove();
|
||||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'><a href='javascript:void(0)' onclick='closeModal()'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>")
|
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'><a href='javascript:void(0)' onclick='closeModal()'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||||
$('#ajax-modal').parent().css("top","40%").css("left","30%");
|
$('#ajax-modal').parent().css("top","40%").css("left","36%");
|
||||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,12 +12,12 @@
|
||||||
<%= link_to "<span class='pr_setting'></span>#{l(:button_configure)}".html_safe, settings_project_path(@project), :class => "pr_join_a" %>
|
<%= link_to "<span class='pr_setting'></span>#{l(:button_configure)}".html_safe, settings_project_path(@project), :class => "pr_join_a" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<!--项目类型-->
|
<!--项目类型-->
|
||||||
<% if (User.current.login? && User.current.member_of?(@project) && Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.first.to_s.include?("Manager")) || User.current.admin? %>
|
<% if (User.current.login? && User.current.member_of?(@project) && Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager")) || User.current.admin? %>
|
||||||
<%= link_to "<span class='#{typeclass}'></span>#{text}".html_safe,"javascript:void(0)" ,:onClick => "show_window();", :class => "pr_join_a",:id => "setting_project_type"%>
|
<%= link_to "<span class='#{typeclass}'></span>#{text}".html_safe,"javascript:void(0)" ,:onClick => "show_window();", :class => "pr_join_a",:id => "setting_project_type"%>
|
||||||
<% end %>
|
<% end %>
|
||||||
<!--退出项目-->
|
<!--退出项目-->
|
||||||
<% if (User.current.member_of? @project) && User.current.login? && !User.current.admin &&
|
<% if (User.current.member_of? @project) && User.current.login? && !User.current.admin &&
|
||||||
!Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.first.to_s.include?("Manager") %>
|
!Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager") %>
|
||||||
<%= exit_project_link(@project) %>
|
<%= exit_project_link(@project) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ a.pro_mes_w{ height:20px; float:left;display:block; color:#999999;}
|
||||||
.pro_page_top{ font-size:14px; border-bottom:2px solid #64bdd9; margin-bottom:10px; padding-bottom:5px;}
|
.pro_page_top{ font-size:14px; border-bottom:2px solid #64bdd9; margin-bottom:10px; padding-bottom:5px;}
|
||||||
.pro_page_tit{color:#3e4040; font-weight:bold;width:480px; float:left; font-size:14px; margin-bottom:5px;}
|
.pro_page_tit{color:#3e4040; font-weight:bold;width:480px; float:left; font-size:14px; margin-bottom:5px;}
|
||||||
.pro_pic_box{ margin-left:60px; }
|
.pro_pic_box{ margin-left:60px; }
|
||||||
.pro_pic{ width:100px; border:2px solid #CCC; margin:10px 0;}
|
.pro_pic{ width:100px; height:73px;line-height:73px;border:2px solid #CCC; margin:10px 0;}
|
||||||
.pro_info_box{ margin-left:60px; background:#f0fbff; height:80px; padding:10px 0;}
|
.pro_info_box{ margin-left:60px; background:#f0fbff; height:80px; padding:10px 0;}
|
||||||
.pro_info_box ul{}
|
.pro_info_box ul{}
|
||||||
.pro_info_box ul li{ margin-bottom:10px;}
|
.pro_info_box ul li{ margin-bottom:10px;}
|
||||||
|
@ -222,7 +222,7 @@ a:hover.ping_sub{ background:#14a8b9;}
|
||||||
/*.ping_distop span a{ float:right; width:20px; height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;}*/
|
/*.ping_distop span a{ float:right; width:20px; height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;}*/
|
||||||
|
|
||||||
/*上传资源弹出框样式*/
|
/*上传资源弹出框样式*/
|
||||||
/*#popbox_polls{width:300px;height:100px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-100px 0 0 -150px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}*/
|
.popbox_polls{position:fixed !important;}
|
||||||
.upload_con h2{ display:block; background:#eaeaea; font-size:14px; color:#343333; height:31px; width: auto; margin-top:25px; padding-left:20px; padding-top:5px;}
|
.upload_con h2{ display:block; background:#eaeaea; font-size:14px; color:#343333; height:31px; width: auto; margin-top:25px; padding-left:20px; padding-top:5px;}
|
||||||
.upload_box{ width:430px; margin:15px auto;}
|
.upload_box{ width:430px; margin:15px auto;}
|
||||||
|
|
||||||
|
@ -338,7 +338,7 @@ a:hover.st_add{ color:#ff8e15;}
|
||||||
.newpro_box input{ height:26px; float:left; margin-bottom:10px;}
|
.newpro_box input{ height:26px; float:left; margin-bottom:10px;}
|
||||||
.newpro_box textarea{ height:150px; float:left; margin-bottom:10px;}
|
.newpro_box textarea{ height:150px; float:left; margin-bottom:10px;}
|
||||||
.newpro_box select{ height:29px; float:left; margin-bottom:10px;}
|
.newpro_box select{ height:29px; float:left; margin-bottom:10px;}
|
||||||
.label{ width:80px; text-align:right; font-size:14 background-image: url(../images/true.png); }
|
.label{ width:80px; text-align:right; font-size:14px; background-image: url(../images/true.png); }
|
||||||
.icon-reload { background-image: url(../images/reload.png); }
|
.icon-reload { background-image: url(../images/reload.png); }
|
||||||
.icon {
|
.icon {
|
||||||
background-position: 0% 50%;
|
background-position: 0% 50%;
|
||||||
|
@ -433,7 +433,7 @@ span.add_attachment a {padding-left:16px; background: url(../images/bullet_add.p
|
||||||
/*日历选择图*/
|
/*日历选择图*/
|
||||||
img.ui-datepicker-trigger {
|
img.ui-datepicker-trigger {
|
||||||
display:block;
|
display:block;
|
||||||
background:url(/images/public_icon.png) -31px 0 no-repeat;
|
background:url(../images/public_icon.png) -31px 0 no-repeat;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
|
|
Loading…
Reference in New Issue