From 6a028417f56cb061ec39a1d4141ba452f778a2fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=9A=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BB=D0=B5=D0=BD=D0=BE=D0=BA?= <dmitry.kovalenok@twinslash.com> Date: Tue, 23 Oct 2012 19:32:44 +0300 Subject: [PATCH] adding view account login user hook --- .../_view_account_login_bottom.html.erb | 1 + init.rb | 11 +++++++---- .../hooks/view_account_login_bottom_hook.rb | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 app/views/hooks/redmine_omniauth_google/_view_account_login_bottom.html.erb create mode 100644 lib/redmine_omniauth_google/hooks/view_account_login_bottom_hook.rb diff --git a/app/views/hooks/redmine_omniauth_google/_view_account_login_bottom.html.erb b/app/views/hooks/redmine_omniauth_google/_view_account_login_bottom.html.erb new file mode 100644 index 0000000..eede9e0 --- /dev/null +++ b/app/views/hooks/redmine_omniauth_google/_view_account_login_bottom.html.erb @@ -0,0 +1 @@ +<p><%= "render with google" %></p> \ No newline at end of file diff --git a/init.rb b/init.rb index 23c537b..470481f 100644 --- a/init.rb +++ b/init.rb @@ -1,8 +1,11 @@ +require 'redmine' +require_dependency 'redmine_omniauth_google/hooks/view_account_login_bottom_hook' + Redmine::Plugin.register :redmine_omniauth_google do name 'Redmine Omniauth Google plugin' - author 'Author name' - description 'This is a plugin for Redmine' + author 'Dmitry Kovalenok' + description 'This is a plugin for Redmine registration through google' version '0.0.1' - url 'http://example.com/path/to/plugin' - author_url 'http://example.com/about' + url 'http://gitlab.tsdv.net/redmine_omniauth_google' + author_url 'https://tsdv.net/redmine/users/105' end diff --git a/lib/redmine_omniauth_google/hooks/view_account_login_bottom_hook.rb b/lib/redmine_omniauth_google/hooks/view_account_login_bottom_hook.rb new file mode 100644 index 0000000..975f808 --- /dev/null +++ b/lib/redmine_omniauth_google/hooks/view_account_login_bottom_hook.rb @@ -0,0 +1,14 @@ +module RedmineOmniauthGoogle + module Hooks + class ViewAccountLoginBottomHook < Redmine::Hook::ViewListener + # def view_account_login_bottom context = {} + # context[:controller].send(:render_to_string, { + # partial: "hooks/redmine_omniauth_google/view_account_login_bottom", + # locals: context + # }) + # end + render_on :view_account_login_bottom, + partial: "hooks/redmine_omniauth_google/view_account_login_bottom" + end + end +end \ No newline at end of file -- GitLab