forked from pelle/oauth-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add suport for slim templates in consumer
- Loading branch information
Showing
9 changed files
with
75 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
h1 Services | ||
|
||
-if @consumer_tokens.empty? | ||
p You are currently not connected to any external services. | ||
-else | ||
p You are connected to the following services: | ||
ul | ||
-@consumer_tokens.each do |token| | ||
li = link_to token.class.service_name.to_s.humanize, oauth_consumer_path(token.class.service_name) | ||
|
||
-unless @services.empty? | ||
h3 You can connect to the following services: | ||
ul | ||
-@services.each do |service| | ||
li = link_to service.to_s.humanize,oauth_consumer_path(service) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
h1 | ||
| You are already Connected to | ||
= params[:id].humanize | ||
- form_tag oauth_consumer_path(params[:id]),:method=>:delete do | ||
= submit_tag "Disconnect" | ||
| or | ||
= submit_tag "Reconnect" | ||
|if you experienced a problem. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require 'rails/generators/erb/controller/controller_generator' | ||
|
||
module Slim | ||
module Generators | ||
class OauthConsumerGenerator < Erb::Generators::Base | ||
source_root File.expand_path('../oauth_consumer_templates', __FILE__) | ||
|
||
argument :name, :type => :string, :default => 'Oauth' | ||
|
||
def copy_view_files | ||
template 'index.html.slim', File.join('app/views', class_path, 'oauth_consumers', 'index.html.slim') | ||
template 'show.html.slim', File.join('app/views', class_path, 'oauth_consumers', 'show.html.slim') | ||
end | ||
|
||
protected | ||
def handler | ||
:slim | ||
end | ||
end | ||
end | ||
end |
15 changes: 15 additions & 0 deletions
15
lib/generators/slim/oauth_consumer_templates/index.html.slim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
h1 Services | ||
|
||
-if @consumer_tokens.empty? | ||
p You are currently not connected to any external services. | ||
-else | ||
p You are connected to the following services: | ||
ul | ||
-@consumer_tokens.each do |token| | ||
li = link_to token.class.service_name.to_s.humanize, oauth_consumer_path(token.class.service_name) | ||
|
||
-unless @services.empty? | ||
h3 You can connect to the following services: | ||
ul | ||
-@services.each do |service| | ||
li = link_to service.to_s.humanize,oauth_consumer_path(service) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
h1 | ||
| You are already Connected to | ||
= params[:id].humanize | ||
- form_tag oauth_consumer_path(params[:id]),:method=>:delete do | ||
= submit_tag "Disconnect" | ||
| or | ||
= submit_tag "Reconnect" | ||
|if you experienced a problem. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module Oauth | ||
module Plugin | ||
VERSION = "0.5.0" | ||
VERSION = "0.5.1" | ||
end | ||
end |