memcached_alan
sw 10 years ago
commit cfe0635804

@ -243,8 +243,10 @@ class ProjectsController < ApplicationController
# Author lizanle
# Description 项目动态展示方法,删除了不必要的代码
def show
# 试图跳转到请求的按钮
# params[:login]为邮箱邀请用户加入,主要功能:
# 1、自动注册
# 2、加入项目、创建角色
# 3、用户得分
if params[:login]
login = params[:login]
login = login.sub(/%40/,'@')
@ -252,6 +254,7 @@ class ProjectsController < ApplicationController
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?

@ -633,7 +633,7 @@ module ApplicationHelper
def principals_check_box_tags_li(name, principals)
s = ''
principals.each do |principal|
s << "<li>#{ check_box_tag name, principal.id, false, :id => nil } #{h link_to principal.userInfo, user_path( principal.id), :class => "c_blue" }</li>\n"
s << "<li>#{ check_box_tag name, principal.id, false, :id => nil } #{h link_to principal.userInfo, user_path( principal.id) }</li>\n"
end
s.html_safe
end

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

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

@ -64,7 +64,7 @@
<% images = attachments.select(&:thumbnailable?) %>
<% if images.any? %>
<% 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 %>

@ -47,7 +47,6 @@
<a href="javascript:void(0);" class="btn_addPic" style="text-decoration:none;">
<span><%= l(:button_upload_photo) %></span>
</a>
<span class="c_orange ml25 f12">(个人头像建议90*90大小课程和项目logo建议60*60大小或者等比图像)</span>
<!-- :accept => 'image/png,image/gif,image/jpeg', -->
<span class="add_avatar" style="margin-left: -55px;width: 70px">
<%= file_field_tag 'avatar[image]',
@ -69,6 +68,8 @@
:source_id => source.id.to_s
} %>
</span>
<span class="c_orange ml25 f12">(个人头像建议90*90大小或者等比图像)</span>
</div>
<% content_for :header_tags do %>
<%= javascript_include_tag 'avatars' %>

@ -3,10 +3,9 @@
</a>
<%#= link_to l(:button_delete_file),{:controller => :avatar,:action => :delete_image,:remote=>true,:source_type=> source.class,:source_id=>source.id},:confirm => l(:text_are_you_sure), :method => :post, :class => "upbtn fl" %>
<a href="javascript:void(0)" class="upbtn fl"><%= l(:button_upload_photo) %></a>
<span class="c_orange ml25 mt43 f12 fl ">(个人头像建议90*90大小课程和项目logo建议60*60大小或者等比图像)</span>
<%= file_field_tag 'avatar[image]',
:id => nil,
:class => 'upload_file ',
:class => 'upload_avatar ',
:size => "1",
:multiple => false,
:onchange => 'addInputAvatar(this);',
@ -22,6 +21,7 @@
:source_id => source.id.to_s
} %>
<!--</span>-->
<span class="c_orange ml25 mt43 f12 fl ">(课程和项目logo建议60*60大小或者等比图像)</span>
<% content_for :header_tags do %>
<%= javascript_include_tag 'avatars' %>
<% end %>

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

@ -5,12 +5,14 @@
<% if @edit_allowed || !@allowed_statuses.empty? %>
<div id="all_attributes" style="display:none;">
<%= 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();">-->
<!--<%#= l(:button_submit) %>-->
<!--</a>-->
</div>
<% end %><!--end-->
<div class="ping_C mb10"></div>
<!--<fieldset><legend><%#= l(:field_notes) %></legend>-->
<!--回复框-->
<% if @journals.present? %>

@ -228,9 +228,9 @@
<div class=" mt10">
<h3 class="mb10 c_blue">请选择项目类型:</h3>
<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 == 2 ? 'checked' : ''%> id="research_group"/><label >&nbsp;&nbsp;研讨模式</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 == 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 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 class="f14">&nbsp;&nbsp;圈子模式<span class="f12 ml5 c_grey">为朋友圈提供简洁的交流和分享工具。</span></label></li>
</ul>
<a href="javascript:void(0)" class="orange_btn" onclick="click_ok('<%= change_project_type_project_path @project%>');" >确定</a>

@ -12,19 +12,19 @@
<div class="members_left">
<% if members.any? %>
<ul style=" border-bottom:none;">
<li><span class="w90 f_b" ><%= l(:label_user) %></span><span class="w210 f_b"><%= l(:label_role_plural) %></span><span></span></li>
<li><span class="w140_h f_b" ><%= l(:label_user) %></span><span class="w180_h f_b"><%= l(:label_role_plural) %></span><span></span></li>
<%= call_hook(:view_projects_settings_members_table_header, :project => @project) %>
<% members.each do |member| %>
<li >
<%= link_to_user_header member.principal,false,:class => "w90 c_orange fl" %>
<span class="w210 fl">
<%= link_to_user_header member.principal,false,:class => "w140_h c_orange fl" %>
<span class="w180_h fl">
<%= h member.roles.sort.collect(&:to_s).join(', ') %>
<%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),
:method => :put,
:html => {:id => "member-#{member.id}-roles-form", :class => 'hol'}}
) do |f| %>
<% roles.each do |role| %>
<ul class="ml80" style="text-align: left;" >
<ul style="text-align: left;" >
<%= check_box_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
:disabled => member.member_roles.detect { |mr| mr.role_id == role.id && !mr.inherited_from.nil? } %>
<label ><%= h role %></label>
@ -32,7 +32,7 @@
<!--<br/>-->
<% end %>
<%= hidden_field_tag 'membership[role_ids][]', '' %>
<div class="ml80">
<div>
<a href="javascript:void(0)" class="member_btn" onclick="$('#member-<%= member.id%>-roles-form').submit();" style="margin-right: 10px;">
<%= l(:button_change)%>
</a>
@ -46,7 +46,7 @@
<a href="javascript:void(0) " class="c_dblue ml15 fl" onclick="$('#member-<%= member.id%>-roles-form').show();$(this).parent().height(110);">编辑</a>
<%= delete_link membership_path(member),
:remote => true,
:class => "c_dblue ml30 fl",
:class => "c_dblue ml15 fl",
:data => (!User.current.admin? && member.include?(User.current) ? {:confirm => l(:text_own_membership_for_project_confirmation)} : {confirm: l(:label_delete_confirm)}) if member.deletable? %>
<% end%>
</li>

@ -19,13 +19,13 @@
<td class="w150"> </td>
</tr>
<% @project.repositories.sort.each do |repository| %>
<tr class="pro_table_on">
<tr class="<%= cycle 'pro_table_on', '' %>">
<td><a href="javascript:viod(0)" title="<%= repository.identifier %>">
<%= link_to truncate(repository.identifier), ({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => repository.identifier_param} if repository.identifier.present?), :class =>"c_blue" %></a></td>
<td> <%= checked_image repository.is_default? %></td>
<td><%=h repository.scm_name %></td>
<%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-->
<%else %>
<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" >
<% if repository.scm_name=="Git"%>
<%if User.current.allowed_to?(:manage_repository, @project) %>
<%= link_to(l(:label_user_plural), committers_repository_path(repository),
:class => 'c_blue') %>
<%= link_to(l(:label_user_plural), committers_repository_path(repository)
) %>
<% end %>
<% end %>
</a></td>

@ -18,15 +18,15 @@
<td class="w150"></td>
</tr>
<% for version in @project.shared_versions.sort %>
<tr class="pro_table_on">
<td >
<tr class="<%= cycle 'pro_table_on', '' %>">
<td class="tl">
<a class="c_blue02"><%= 'shared' if version.project != @project %> <%= link_to_version version %></a>
</td>
<td class="description"><%= format_date(version.effective_date) %></td>
<td class="description" style="word-break:break-all;"><%=h version.description %></td>
<td class="description tl" style="word-break:break-all;"><%=h version.description %></td>
<td class="status"><%= l("version_status_#{version.status}") %></td>
<td class="sharing"><%=h format_version_sharing(version.sharing) %></td>
<td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" title="">
<td class="tl" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" title="">
<%= link_to_if_authorized(h(truncate(version.wiki_page_title,:length=>20)), {:controller => 'wiki',
:action => 'show',
:project_id => version.project,

@ -42,9 +42,9 @@
</td>
<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',
:action => 'show',
: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? %>
:action => 'show',
: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? %>
</td>
<td class="buttons">
<% if version.project == @project && User.current.allowed_to?(:manage_versions, @project) %>

@ -3152,6 +3152,18 @@ input[class~='m3p10'], .m3p10 {
.break_word{word-break: break-all;word-wrap: break-word;}
.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 日誌搜索結果樣式*/
.search_results {

@ -331,6 +331,7 @@ a:hover.st_add{ color:#ff8e15;}
.upbtn{ margin:40px 0 0 15px; display:block; padding:2px 5px; border:1px solid #eaeaea;}
.upbtn:hover{border:1px solid #64bdd9; color:#64bdd9;cursor: pointer;}
.upload_file{margin-left: -60px;margin-top: 40px;width: 50px;position: absolute;height: 24px;opacity: 0;cursor: pointer}
.upload_avatar{margin-left: -350px;margin-top: 40px;width: 60px;position: absolute;height: 24px;opacity: 0;cursor: pointer}
/* 功能倒计时*/
.w_img{ float:left; margin:10px 10px 15px 0px;}
.w_p{ float:left; color:#15bccf; font-size:16px; font-weight:bold; margin-top:70px; }

@ -55,6 +55,9 @@ a:hover.btn_free{ background:#d63502;}
a.invi_search_btn{ background:#15bccf; color:#fff; text-align: center; width:40px; height:22px;border:1px solid #15bccf; padding-top:2px; cursor:pointer;}
a:hover.invi_search_btn{ background:#0da1b2; border:1px solid #0da1b2;}
.rolebox{ margin:10px 0;}
.w180_h{ width:180px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis; text-align:left;}
.w140_h{ width:135px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;text-align:left; padding-left:5px;}
/*问题跟踪*/
.problem_top{ margin:10px 0 ;}
.problem_search_input{ border:1px solid #64bdd9; width:180px; height:24px; color:#9b9b9b; padding-left:5px; margin-bottom:5px;}
@ -368,6 +371,7 @@ blockquote {
}
/*上传项目图片*/
.upload_file{margin-left: -60px;margin-top: 40px;width: 50px;position: absolute;height: 24px;opacity: 0;cursor: pointer}
.upload_avatar{margin-left: -350px;margin-top: 40px;width: 60px;position: absolute;height: 24px;opacity: 0;cursor: pointer}
/*配置*/
.pro_st_ttl{ height:24px;}
.pro_st_ctt{height:auto; clear:both;}
@ -391,8 +395,8 @@ blockquote {
.members_left{ float:left; width:410px; margin-right:20px; text-align:center;}
.members_left{}
.members_left ul li{ height:30px; border-bottom:1px solid #E4E4E4; width:410px; padding-top:10px; }
.members_left ul li a{ float:left; text-align:center;}
.members_left ul li span{ float:left; text-align:center; color:#484747;}
.members_left ul li a{ float:left; text-align:left;}
.members_left ul li span{ float:left; text-align:center; color:#484747;text-align:left;}
.w150{ text-align:center; width:150px;}
.f_b{ font-weight: bold;}
.members_right{ float:left; width:240px;}

@ -131,6 +131,7 @@ a.c_green{ color:#28be6c;}
.c_blue{ color:#15bccf;}
.c_red{ color:#F00;}
.c_green{ color:#28be6c;}
.c_grey{color:#999;}
.c_dblue{ color:#09658c;}
.b_blue{background:#64bdd9;}
.b_green{background:#28be6c;}
@ -406,8 +407,10 @@ 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);}
.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;}
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;}
/*文本左对齐*/
.tl{text-align: left;}

Loading…
Cancel
Save