From 76b4ae24dac2171c41e6e24de3d5c090b3dc81dd Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 30 Apr 2015 16:30:02 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=82=AE=E4=BB=B6?= =?UTF-8?q?=E9=82=80=E8=AF=B7--=E9=82=AE=E4=BB=B6=E5=90=8D=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=88=90=E7=94=A8=E6=88=B7=E7=82=B9=E5=87=BB=E5=90=8C?= =?UTF-8?q?=E6=84=8F=E6=8C=89=E9=92=AE=E5=90=8E=E6=89=8D=E8=83=BD=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 7 +++---- app/models/mailer.rb | 14 +++++++------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 2b58f1265..96807d2dc 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -247,10 +247,9 @@ class ProjectsController < ApplicationController # 1、自动注册 # 2、加入项目、创建角色 # 3、用户得分 - if params[:login] - # 自动激活用户 - user.status = 1 - user.save + if params[:email] + user = User.find_by_mail(params[:email].to_s) + Member.create(:role_ids => [4], :user_id => user.id,:project_id => @project.id) end if params[:jump] && redirect_to_project_menu_item(@project, params[:jump]) return diff --git a/app/models/mailer.rb b/app/models/mailer.rb index d35374fcf..e2ccb2230 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -71,14 +71,14 @@ class Mailer < ActionMailer::Base # 邀请已注册的用户加入项目 def request_member_to_project(email, project, invitor) + @subject = "#{invitor.name} #{l(:label_invite_project)}: #{project.name} " user = User.find_by_mail(email.to_s) - Member.create(:role_ids => [4], :user_id => user.id,:project_id => project.id) - @invitor_name = "#{invitor.name}" - @project_name = "#{project.name}" - @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, :invitor_name => "#{@invitor_name}", :project_name => "#{@project_name}" + @invitor_name = "#{invitor.name}" + @project_name = "#{project.name}" + @user = user + @token = Token.get_token_from_user(user, 'autologin') + @project_url = url_for(:controller => 'projects', :action => 'show', :id => project.id, :email => email, :token => @token.value) + mail :to => email, :subject => @subject end # author: alan From 88bbd70102a3eedc09fe7f2fd4f54d188cdc004e Mon Sep 17 00:00:00 2001 From: whimlex Date: Thu, 30 Apr 2015 17:24:30 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=AF=BC=E8=88=AA=EF=BC=9B=E9=97=AE=E9=A2=98=E8=B7=9F=E8=B8=AA?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=A1=B9=E7=9B=AE=E5=AF=BC=E8=88=AA=E5=88=B0?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=EF=BC=9B?= =?UTF-8?q?IE=E9=97=AE=E9=A2=98=E8=B7=9F=E8=B8=AA=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=BC=A9=E7=95=A5=E5=9B=BE=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 4 +- .../attachments/_project_file_links.html.erb | 70 +++++-------------- app/views/avatar/_avatar_preview.html.erb | 66 +++++++++++++++++ app/views/issues/show.html.erb | 2 +- app/views/layouts/base_projects.html.erb | 7 +- public/stylesheets/project.css | 3 +- 6 files changed, 91 insertions(+), 61 deletions(-) create mode 100644 app/views/avatar/_avatar_preview.html.erb diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 65ad32602..405dc72ed 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -329,12 +329,12 @@ module ApplicationHelper imagesize = attachment.thumbnail(:size => "200*200") imagepath = named_attachment_path(attachment, attachment.filename) if imagesize - link_to image_tag(thumbnail_path(attachment), height: '73', width: '100', name: 'issue_attachment_picture'), + link_to image_tag(thumbnail_path(attachment), height: '73', width: '100', class: 'issue_attachment_picture'), imagepath, :title => attachment.filename else - link_to image_tag(imagepath , height: '73', width: '100', name: 'issue_attachment_picture'), + link_to image_tag(imagepath , height: '73', width: '100', class: 'issue_attachment_picture'), imagepath, :title => attachment.filename end diff --git a/app/views/attachments/_project_file_links.html.erb b/app/views/attachments/_project_file_links.html.erb index a42593290..a18d819da 100644 --- a/app/views/attachments/_project_file_links.html.erb +++ b/app/views/attachments/_project_file_links.html.erb @@ -1,62 +1,28 @@
diff --git a/app/views/avatar/_avatar_preview.html.erb b/app/views/avatar/_avatar_preview.html.erb new file mode 100644 index 000000000..f7a014c64 --- /dev/null +++ b/app/views/avatar/_avatar_preview.html.erb @@ -0,0 +1,66 @@ + + +
+ +
+
+ diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index bed1e3d77..8fb63bd10 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -4,7 +4,7 @@ <% html_title "#{@issue.tracker.name} #{@issue.source_from}'#'#{@issue.project_index}: #{@issue.subject}" %>
- <%= @issue.project.name %> > + <%= link_to "#{@issue.project.name}"+">", project_issues_path(@issue.project) %> <%= "#" + @issue.project_index %>
diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index 096dadf8b..64a9111e0 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -89,7 +89,7 @@ <%=l(:label_project_hosting_platform) %> > - <%= link_to @project.name, nil %> + <%= link_to @project.name, project_path(@project.id) %>