From d390c84de0831414b187820d6c14d6b2312e4308 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Fri, 6 Mar 2015 15:29:05 +0800 Subject: [PATCH 1/3] Signed-off-by: alan <547533434@qq.com> --- db/schema.rb | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index 4a3b14edc..b863dbaed 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150302091345) do +ActiveRecord::Schema.define(:version => 20150305011359) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -631,16 +631,6 @@ ActiveRecord::Schema.define(:version => 20150302091345) do add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" - create_table "journal_details_copy", :force => true do |t| - t.integer "journal_id", :default => 0, :null => false - t.string "property", :limit => 30, :default => "", :null => false - t.string "prop_key", :limit => 30, :default => "", :null => false - t.text "old_value" - t.text "value" - end - - add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id" - create_table "journal_replies", :id => false, :force => true do |t| t.integer "journal_id" t.integer "user_id" @@ -825,6 +815,13 @@ ActiveRecord::Schema.define(:version => 20150302091345) do t.integer "project_id" end + 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 + end + create_table "poll_answers", :force => true do |t| t.integer "poll_question_id" t.text "answer_text" @@ -949,6 +946,7 @@ ActiveRecord::Schema.define(:version => 20150302091345) do t.integer "user_id" t.integer "dts_test", :default => 0 t.string "enterprise_name" + t.integer "organization_id" end add_index "projects", ["lft"], :name => "index_projects_on_lft" @@ -1036,12 +1034,12 @@ ActiveRecord::Schema.define(:version => 20150302091345) do end create_table "roles", :force => true do |t| - t.string "name", :limit => 90 - t.integer "position" - t.boolean "assignable" - t.integer "builtin" + t.string "name", :limit => 30, :default => "", :null => false + t.integer "position", :default => 1 + t.boolean "assignable", :default => true + t.integer "builtin", :default => 0, :null => false t.text "permissions" - t.string "issues_visibility", :limit => 90 + t.string "issues_visibility", :limit => 30, :default => "default", :null => false end create_table "schools", :force => true do |t| From f50ea0f78046d53107d3607427f4bdbd3f739e29 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Fri, 6 Mar 2015 16:36:12 +0800 Subject: [PATCH 2/3] Signed-off-by: alan <547533434@qq.com> --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 3f07ad408..299af4509 100644 --- a/Gemfile +++ b/Gemfile @@ -22,7 +22,7 @@ gem 'spreadsheet' gem 'ruby-ole' #gem 'email_verifier', path: 'lib/email_verifier' gem 'rufus-scheduler' -gem 'dalli', path: 'lib/dalli-2.7.2' +#gem 'dalli', path: 'lib/dalli-2.7.2' group :development do gem 'grape-swagger' gem 'grape-swagger-ui', git: 'https://github.com/guange2015/grape-swagger-ui.git' From 5ff43fdea762d99ddaab16f359abdb98599f988f Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Sat, 7 Mar 2015 10:52:20 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=96=B0=E7=94=A8=E6=88=B7=E9=82=AE=E4=BB=B6=E5=8F=91=E9=80=81?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=20Signed-off-by:=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 12 +- app/views/layouts/base_projects.html.erb | 2 +- .../projects/_invite_members_by_mail.html.erb | 21 + app/views/projects/invite_members.html.erb | 132 +++---- .../projects/invite_members_by_mail.html.erb | 2 + .../projects/invite_members_by_mail.js.erb | 10 + app/views/projects/show.html.erb | 362 +++++++++--------- app/views/tags/_project_tag.html.erb | 40 +- config/routes.rb | 2 + db/schema.rb | 19 +- public/stylesheets/project.css | 182 +++++++++ 11 files changed, 502 insertions(+), 282 deletions(-) create mode 100644 app/views/projects/_invite_members_by_mail.html.erb create mode 100644 app/views/projects/invite_members_by_mail.html.erb create mode 100644 app/views/projects/invite_members_by_mail.js.erb create mode 100644 public/stylesheets/project.css diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 7e549509b..1428b4997 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -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注册用户 diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index 40f13a2f8..de85e7257 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -129,7 +129,7 @@