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
|
||||
@requested_scopes = params["scope"].split(',')
|
||||
@client = oauth2_authorization_request.client
|
||||
render :layout => "popup" if params[:popup]
|
||||
#render :layout => "popup" if params[:popup]
|
||||
end
|
||||
|
||||
def create
|
||||
|
|
|
|||
|
|
@ -8,24 +8,20 @@
|
|||
= render 'shared/settings_nav'
|
||||
|
||||
.span-19.prepend-5.last
|
||||
%h2
|
||||
= t('_applications')
|
||||
#applications_stream.stream
|
||||
- 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
|
||||
- for app in @applications
|
||||
|
||||
.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
|
||||
|
||||
- else
|
||||
You haven't registered any applications yet.
|
||||
|
|
|
|||
|
|
@ -1,45 +1,43 @@
|
|||
#popup-contents
|
||||
%h4
|
||||
= "#{@client.name} is requesting access to your account"
|
||||
|
||||
#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')
|
||||
#authorize
|
||||
#application-description
|
||||
= image_tag(@client.homepage_url + @client.icon_url, :id => 'client-application-image')
|
||||
%br
|
||||
%strong
|
||||
= @client.name
|
||||
.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)}"}
|
||||
%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
|
||||
|
||||
= yield
|
||||
|
|
|
|||
|
|
@ -11,8 +11,5 @@
|
|||
= render 'shared/settings_nav'
|
||||
|
||||
.span-19.prepend-5.last
|
||||
%h2
|
||||
= t('_services')
|
||||
|
||||
= render 'shared/add_remove_services'
|
||||
|
||||
|
|
|
|||
|
|
@ -4,12 +4,15 @@
|
|||
|
||||
|
||||
%ul.stream#service_stream
|
||||
- for service in @services
|
||||
%h3
|
||||
%b= service.provider
|
||||
= t('services.index.logged_in_as')
|
||||
%b= service.nickname
|
||||
= link_to t('services.index.disconnect'), service_path(service), :confirm => t('services.index.really_disconnect', :service => service.provider), :method => :delete
|
||||
- if @services.count > 0
|
||||
- for service in @services
|
||||
%h3
|
||||
%b= service.provider
|
||||
= t('services.index.logged_in_as')
|
||||
%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'}
|
||||
%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
|
||||
%li=link_to t('profile'), edit_profile_path
|
||||
%li=link_to t('account'), edit_user_path
|
||||
%li=link_to t('_services'), services_path
|
||||
%li= link_to_unless_current t('profile'), edit_profile_path
|
||||
%li= link_to_unless_current t('account'), edit_user_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'
|
||||
|
||||
.span-12.prepend-5.last
|
||||
%h2
|
||||
= t('account')
|
||||
|
||||
.span-5.append-1
|
||||
%h3
|
||||
= t('.your_handle')
|
||||
|
|
|
|||
|
|
@ -684,6 +684,10 @@ en:
|
|||
generate_a_token: "Generate a token"
|
||||
via: "(via %{link})"
|
||||
|
||||
authorizations:
|
||||
index:
|
||||
revoke_access: "Revoke Access"
|
||||
|
||||
users:
|
||||
edit:
|
||||
export_data: "Export Data"
|
||||
|
|
|
|||
|
|
@ -1385,8 +1385,14 @@ ul#settings_nav
|
|||
:display inline
|
||||
:margin
|
||||
:right 1em
|
||||
:font
|
||||
:weight 700
|
||||
|
||||
a
|
||||
:padding 2px
|
||||
:font
|
||||
:weight normal
|
||||
|
||||
|
||||
.settings_pane
|
||||
:display none
|
||||
|
|
@ -2929,3 +2935,28 @@ h1.tag
|
|||
|
||||
#client-application-image
|
||||
: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";
|
||||
|
||||
body, html{
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
body, html, header, footer, ul{
|
||||
padding: 0;
|
||||
|
|
@ -13,18 +16,35 @@ body, html, header, footer, ul{
|
|||
header,
|
||||
footer{
|
||||
width: 100%;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
header{
|
||||
top: 0;
|
||||
}
|
||||
|
||||
footer{
|
||||
bottom: 0;
|
||||
padding: 5px 0;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
header{
|
||||
position: relative;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
padding-top: 8px;
|
||||
padding-bottom: 0px;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
vertical-align: top;
|
||||
margin-bottom: 20px;
|
||||
|
||||
#asterisk{
|
||||
position: relative;
|
||||
margin-right: 3px;
|
||||
top: -2px;
|
||||
left: 10px;
|
||||
margin-right: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue