Commit 7b92b4e3cdb8f98f84587895fca46df77e950f05

Authored by Victor Costa
1 parent 23837332

oauth_provider: use noosfero layout in doorkeeper views

plugins/oauth_client/lib/omniauth/strategies/noosfero_oauth2.rb
... ... @@ -4,6 +4,10 @@ module OmniAuth
4 4 module Strategies
5 5 class NoosferoOauth2 < OmniAuth::Strategies::OAuth2
6 6 option :name, :noosfero_oauth2
  7 + option :client_options, {
  8 + :authorize_url => '/oauth_provider/oauth/authorize',
  9 + :token_url => '/oauth_provider/oauth/token'
  10 + }
7 11  
8 12 uid { raw_info["id"] }
9 13  
... ...
plugins/oauth_provider/controllers/doorkeeper/application_controller.rb 0 → 100644
... ... @@ -0,0 +1,8 @@
  1 +module Doorkeeper
  2 + class ApplicationController < ApplicationController
  3 +
  4 + include Helpers::Controller
  5 + helper 'doorkeeper/form_errors'
  6 +
  7 + end
  8 +end
... ...
plugins/oauth_provider/controllers/oauth_provider_applications_controller.rb 0 → 100644
... ... @@ -0,0 +1,9 @@
  1 +class OauthProviderApplicationsController < Doorkeeper::ApplicationsController
  2 +
  3 + no_design_blocks
  4 + layout :get_layout
  5 +
  6 + def show
  7 + end
  8 +
  9 +end
... ...
plugins/oauth_provider/controllers/oauth_provider_authorized_applications_controller.rb 0 → 100644
... ... @@ -0,0 +1,6 @@
  1 +class OauthProviderAuthorizedApplicationsController < Doorkeeper::AuthorizedApplicationsController
  2 +
  3 + no_design_blocks
  4 + layout :get_layout
  5 +
  6 +end
... ...
plugins/oauth_provider/controllers/oauth_provider_plugin_admin_controller.rb 0 → 100644
... ... @@ -0,0 +1,6 @@
  1 +class OauthProviderPluginAdminController < AdminController
  2 +
  3 + def index
  4 + end
  5 +
  6 +end
... ...
plugins/oauth_provider/lib/oauth_provider_plugin.rb
... ... @@ -104,8 +104,17 @@ class OauthProviderPlugin &lt; Noosfero::Plugin
104 104 # wildcard_redirect_uri false
105 105 end
106 106  
107   - Rails.application.routes.prepend do
108   - use_doorkeeper
  107 + Rails.configuration.to_prepare do
  108 + Rails.application.routes.prepend do
  109 + scope 'oauth_provider' do
  110 + use_doorkeeper do
  111 + controllers ({
  112 + :applications => 'oauth_provider_applications',
  113 + :authorized_applications => 'oauth_provider_authorized_applications'
  114 + })
  115 + end
  116 + end
  117 + end
109 118 end
110 119  
111 120 end
... ...
plugins/oauth_provider/views/oauth_provider_plugin_admin/index.html.erb 0 → 100644
... ... @@ -0,0 +1,11 @@
  1 +<div class="oauth-provider">
  2 + <h3><%= _('Oauh Provider') %></h3>
  3 +
  4 + <div class="applications">
  5 + <%= link_to _('Applications'), oauth_applications_path %>
  6 + </div>
  7 + <div class="authorized-applications">
  8 + <%= link_to _('Authorized Applications'), oauth_authorized_applications_path %>
  9 + </div>
  10 +
  11 +</div>
... ...