nicer auth prompt. wip.
This commit is contained in:
parent
13810336d3
commit
a9b7cd1254
11 changed files with 125 additions and 78 deletions
|
|
@ -11,7 +11,7 @@ class AuthorizationsController < ApplicationController
|
||||||
def new
|
def new
|
||||||
@requested_scopes = params["scope"].split(',')
|
@requested_scopes = params["scope"].split(',')
|
||||||
@client = oauth2_authorization_request.client
|
@client = oauth2_authorization_request.client
|
||||||
render :layout => "popup" if params[:popup]
|
#render :layout => "popup" if params[:popup]
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|
|
||||||
|
|
@ -8,24 +8,20 @@
|
||||||
= render 'shared/settings_nav'
|
= render 'shared/settings_nav'
|
||||||
|
|
||||||
.span-19.prepend-5.last
|
.span-19.prepend-5.last
|
||||||
%h2
|
#applications_stream.stream
|
||||||
= t('_applications')
|
- if @applications.count > 0
|
||||||
|
- for app in @applications
|
||||||
|
.stream_element{:id => app.id}
|
||||||
|
.right
|
||||||
|
= link_to t('.revoke_access'), authorization_path(:id => app.id), :method => :delete, :confirm => 'are you sure?', :class => "button"
|
||||||
|
|
||||||
|
- if app.icon_url
|
||||||
|
= image_tag app.icon_url, :class => "avatar"
|
||||||
|
|
||||||
|
.content
|
||||||
|
%div.from
|
||||||
|
= link_to app.name, app.homepage_url
|
||||||
|
= app.description
|
||||||
|
|
||||||
#applications_stream.stream
|
- else
|
||||||
- for app in @applications
|
You haven't registered any applications yet.
|
||||||
|
|
||||||
.stream_element{:id => app.id}
|
|
||||||
.right
|
|
||||||
= link_to t('delete'), authorization_path(:id => app.id), :method => :delete, :confirm => 'are you sure?'
|
|
||||||
|
|
||||||
- if app.icon_url
|
|
||||||
= image_tag app.icon_url
|
|
||||||
|
|
||||||
.content
|
|
||||||
%span.from
|
|
||||||
= link_to app.name, app.homepage_url
|
|
||||||
|
|
||||||
.info
|
|
||||||
= app.description
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,45 +1,43 @@
|
||||||
#popup-contents
|
#authorize
|
||||||
%h4
|
#application-description
|
||||||
= "#{@client.name} is requesting access to your account"
|
= image_tag(@client.homepage_url + @client.icon_url, :id => 'client-application-image')
|
||||||
|
|
||||||
#popup-content-left
|
|
||||||
%ul#requested-scopes
|
|
||||||
- @requested_scopes.each do |scope|
|
|
||||||
- if scope == "name"
|
|
||||||
%li
|
|
||||||
.scope-photo
|
|
||||||
= owner_image_tag
|
|
||||||
|
|
||||||
%strong
|
|
||||||
Basic Info
|
|
||||||
%br
|
|
||||||
Cubbies will be able to see your name, profile photo, and other basic profile information.
|
|
||||||
|
|
||||||
- elsif scope == "AS_photo:post"
|
|
||||||
%li
|
|
||||||
.scope-photo
|
|
||||||
= image_tag('/images/icons/photo.svg')
|
|
||||||
|
|
||||||
%strong
|
|
||||||
Your Photos
|
|
||||||
%br
|
|
||||||
Cubbies will be able to post photos on your behalf
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
= form_for :authorization,
|
|
||||||
:url => oauth_authorize_path(params.slice(:redirect_uri, :client_id, :client_secret)) do |form|
|
|
||||||
%br
|
|
||||||
%p
|
|
||||||
= form.submit "Fuck Yeah!", :value => "Authorize", :class => 'button'
|
|
||||||
= form.submit "Hell No.", :value => "No", :class => 'button'
|
|
||||||
|
|
||||||
|
|
||||||
#popup-content-right
|
|
||||||
= image_tag(@client.icon_url, :id => 'client-application-image')
|
|
||||||
%br
|
%br
|
||||||
%strong
|
%strong
|
||||||
= @client.name
|
= @client.name
|
||||||
.description
|
.description
|
||||||
= @client.description
|
= @client.description
|
||||||
|
|
||||||
|
%h2
|
||||||
|
= @client.permissions_overview
|
||||||
|
|
||||||
|
%ul#requested-scopes
|
||||||
|
- @requested_scopes.each do |scope|
|
||||||
|
- if scope == "profile"
|
||||||
|
%li
|
||||||
|
.scope-photo
|
||||||
|
= owner_image_tag
|
||||||
|
|
||||||
|
.scope-description
|
||||||
|
%strong
|
||||||
|
Basic Info
|
||||||
|
%br
|
||||||
|
Cubbies will be able to see your name, profile photo, and other basic profile information.
|
||||||
|
|
||||||
|
- elsif scope == "AS_photo:post"
|
||||||
|
%li
|
||||||
|
.scope-photo
|
||||||
|
= image_tag('/images/icons/photo.svg', :title => "Cubbies will be able to post photos on your behalf")
|
||||||
|
|
||||||
|
.scope-description
|
||||||
|
%strong
|
||||||
|
Your Photos
|
||||||
|
%br
|
||||||
|
Cubbies will be able to post photos on your behalf
|
||||||
|
|
||||||
|
= form_for :authorization,
|
||||||
|
:url => oauth_authorize_path(params.slice(:redirect_uri, :client_id, :client_secret)) do |form|
|
||||||
|
%br
|
||||||
|
%p
|
||||||
|
= form.submit "Fuck Yeah!", :value => "Authorize", :class => 'button'
|
||||||
|
= form.submit "Hell No.", :value => "No", :class => 'button'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@
|
||||||
|
|
||||||
%body{:class => "#{yield(:body_class)}"}
|
%body{:class => "#{yield(:body_class)}"}
|
||||||
%header
|
%header
|
||||||
= image_tag('asterisk_white.png', :height => 25, :width => 25, :id => 'asterisk')
|
= image_tag('asterisk_white.png', :height => 20, :width => 20, :id => 'asterisk')
|
||||||
Grant Account Access
|
Grant Account Access
|
||||||
|
|
||||||
= yield
|
= yield
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,5 @@
|
||||||
= render 'shared/settings_nav'
|
= render 'shared/settings_nav'
|
||||||
|
|
||||||
.span-19.prepend-5.last
|
.span-19.prepend-5.last
|
||||||
%h2
|
|
||||||
= t('_services')
|
|
||||||
|
|
||||||
= render 'shared/add_remove_services'
|
= render 'shared/add_remove_services'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,15 @@
|
||||||
|
|
||||||
|
|
||||||
%ul.stream#service_stream
|
%ul.stream#service_stream
|
||||||
- for service in @services
|
- if @services.count > 0
|
||||||
%h3
|
- for service in @services
|
||||||
%b= service.provider
|
%h3
|
||||||
= t('services.index.logged_in_as')
|
%b= service.provider
|
||||||
%b= service.nickname
|
= t('services.index.logged_in_as')
|
||||||
= link_to t('services.index.disconnect'), service_path(service), :confirm => t('services.index.really_disconnect', :service => service.provider), :method => :delete
|
%b= service.nickname
|
||||||
|
= link_to t('services.index.disconnect'), service_path(service), :confirm => t('services.index.really_disconnect', :service => service.provider), :method => :delete
|
||||||
|
- else
|
||||||
|
You haven't connected any services yet.
|
||||||
|
|
||||||
- unless @services.any?{|x| x.provider == 'twitter'}
|
- unless @services.any?{|x| x.provider == 'twitter'}
|
||||||
%h4= link_to t('services.index.connect_to_twitter'), "/auth/twitter" if SERVICES['twitter'] && SERVICES['twitter']['consumer_key']!= ""
|
%h4= link_to t('services.index.connect_to_twitter'), "/auth/twitter" if SERVICES['twitter'] && SERVICES['twitter']['consumer_key']!= ""
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
%ul#settings_nav
|
%ul#settings_nav
|
||||||
%li=link_to t('profile'), edit_profile_path
|
%li= link_to_unless_current t('profile'), edit_profile_path
|
||||||
%li=link_to t('account'), edit_user_path
|
%li= link_to_unless_current t('account'), edit_user_path
|
||||||
%li=link_to t('_services'), services_path
|
%li= link_to_unless_current t('_services'), services_path
|
||||||
|
%li= link_to_unless_current t('_applications'), authorizations_path
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,6 @@
|
||||||
= render 'shared/settings_nav'
|
= render 'shared/settings_nav'
|
||||||
|
|
||||||
.span-12.prepend-5.last
|
.span-12.prepend-5.last
|
||||||
%h2
|
|
||||||
= t('account')
|
|
||||||
|
|
||||||
.span-5.append-1
|
.span-5.append-1
|
||||||
%h3
|
%h3
|
||||||
= t('.your_handle')
|
= t('.your_handle')
|
||||||
|
|
|
||||||
|
|
@ -684,6 +684,10 @@ en:
|
||||||
generate_a_token: "Generate a token"
|
generate_a_token: "Generate a token"
|
||||||
via: "(via %{link})"
|
via: "(via %{link})"
|
||||||
|
|
||||||
|
authorizations:
|
||||||
|
index:
|
||||||
|
revoke_access: "Revoke Access"
|
||||||
|
|
||||||
users:
|
users:
|
||||||
edit:
|
edit:
|
||||||
export_data: "Export Data"
|
export_data: "Export Data"
|
||||||
|
|
|
||||||
|
|
@ -1385,8 +1385,14 @@ ul#settings_nav
|
||||||
:display inline
|
:display inline
|
||||||
:margin
|
:margin
|
||||||
:right 1em
|
:right 1em
|
||||||
|
:font
|
||||||
|
:weight 700
|
||||||
|
|
||||||
a
|
a
|
||||||
:padding 2px
|
:padding 2px
|
||||||
|
:font
|
||||||
|
:weight normal
|
||||||
|
|
||||||
|
|
||||||
.settings_pane
|
.settings_pane
|
||||||
:display none
|
:display none
|
||||||
|
|
@ -2929,3 +2935,28 @@ h1.tag
|
||||||
|
|
||||||
#client-application-image
|
#client-application-image
|
||||||
:max-width 100%
|
:max-width 100%
|
||||||
|
|
||||||
|
#service_stream
|
||||||
|
:margin 0
|
||||||
|
:padding 0
|
||||||
|
|
||||||
|
#authorize
|
||||||
|
:text-align center
|
||||||
|
|
||||||
|
#application-description
|
||||||
|
:display inline-block
|
||||||
|
:width 300px
|
||||||
|
:padding-bottom 20px
|
||||||
|
|
||||||
|
ul#requested-scopes
|
||||||
|
:vertical-align middle
|
||||||
|
li
|
||||||
|
:display inline-block
|
||||||
|
:padding 5px
|
||||||
|
|
||||||
|
img
|
||||||
|
:height 30px
|
||||||
|
:width 30px
|
||||||
|
|
||||||
|
.scope-description
|
||||||
|
:display none
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,9 @@
|
||||||
|
|
||||||
@import "mixins";
|
@import "mixins";
|
||||||
|
|
||||||
|
body, html{
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
body, html, header, footer, ul{
|
body, html, header, footer, ul{
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
@ -13,18 +16,35 @@ body, html, header, footer, ul{
|
||||||
header,
|
header,
|
||||||
footer{
|
footer{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
header{
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer{
|
||||||
|
bottom: 0;
|
||||||
|
padding: 5px 0;
|
||||||
|
color: #444;
|
||||||
}
|
}
|
||||||
|
|
||||||
header{
|
header{
|
||||||
position: relative;
|
position: relative;
|
||||||
font-size: 14px;
|
font-size: 12px;
|
||||||
font-weight: bold;
|
padding-top: 8px;
|
||||||
|
padding-bottom: 0px;
|
||||||
|
font-weight: 700;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
|
|
||||||
#asterisk{
|
#asterisk{
|
||||||
|
position: relative;
|
||||||
margin-right: 3px;
|
margin-right: 3px;
|
||||||
|
top: -2px;
|
||||||
|
left: 10px;
|
||||||
|
margin-right: 14px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue