Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
33ba32e6
Commit
33ba32e6
authored
Feb 29, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Applications tab on profile settings
Closes #13855
parent
f8c4dc97
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
119 additions
and
86 deletions
+119
-86
app/assets/stylesheets/pages/profile.scss
app/assets/stylesheets/pages/profile.scss
+14
-0
app/controllers/oauth/applications_controller.rb
app/controllers/oauth/applications_controller.rb
+5
-1
app/controllers/profiles_controller.rb
app/controllers/profiles_controller.rb
+1
-0
app/views/doorkeeper/applications/_delete_form.html.haml
app/views/doorkeeper/applications/_delete_form.html.haml
+7
-1
app/views/doorkeeper/applications/_form.html.haml
app/views/doorkeeper/applications/_form.html.haml
+13
-18
app/views/profiles/applications.html.haml
app/views/profiles/applications.html.haml
+79
-66
No files found.
app/assets/stylesheets/pages/profile.scss
View file @
33ba32e6
...
@@ -175,3 +175,17 @@
...
@@ -175,3 +175,17 @@
color
:
$profile-settings-link-color
;
color
:
$profile-settings-link-color
;
}
}
}
}
.profile-settings-message
{
line-height
:
32px
;
color
:
#9E8E60
;
background-color
:
#FBF2D9
;
border
:
1px
solid
#F0E2BB
;
border-radius
:
3px
;
}
.oauth-applications
{
form
{
display
:
inline-block
;
}
}
app/controllers/oauth/applications_controller.rb
View file @
33ba32e6
...
@@ -11,6 +11,10 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
...
@@ -11,6 +11,10 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
head
:forbidden
and
return
head
:forbidden
and
return
end
end
def
new
redirect_to
applications_profile_url
end
def
create
def
create
@application
=
Doorkeeper
::
Application
.
new
(
application_params
)
@application
=
Doorkeeper
::
Application
.
new
(
application_params
)
...
@@ -20,7 +24,7 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
...
@@ -20,7 +24,7 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
flash
[
:notice
]
=
I18n
.
t
(
:notice
,
scope:
[
:doorkeeper
,
:flash
,
:applications
,
:create
])
flash
[
:notice
]
=
I18n
.
t
(
:notice
,
scope:
[
:doorkeeper
,
:flash
,
:applications
,
:create
])
redirect_to
oauth_application_url
(
@application
)
redirect_to
oauth_application_url
(
@application
)
else
else
re
nder
:new
re
direct_to
applications_profile_url
,
flash:
{
application:
@application
}
end
end
end
end
...
...
app/controllers/profiles_controller.rb
View file @
33ba32e6
...
@@ -13,6 +13,7 @@ class ProfilesController < Profiles::ApplicationController
...
@@ -13,6 +13,7 @@ class ProfilesController < Profiles::ApplicationController
@authorized_tokens
=
current_user
.
oauth_authorized_tokens
@authorized_tokens
=
current_user
.
oauth_authorized_tokens
@authorized_anonymous_tokens
=
@authorized_tokens
.
reject
(
&
:application
)
@authorized_anonymous_tokens
=
@authorized_tokens
.
reject
(
&
:application
)
@authorized_apps
=
@authorized_tokens
.
map
(
&
:application
).
uniq
-
[
nil
]
@authorized_apps
=
@authorized_tokens
.
map
(
&
:application
).
uniq
-
[
nil
]
@application
=
flash
[
:application
]
||
Doorkeeper
::
Application
.
new
end
end
def
update
def
update
...
...
app/views/doorkeeper/applications/_delete_form.html.haml
View file @
33ba32e6
-
submit_btn_css
||=
'btn btn-link btn-remove btn-sm'
-
submit_btn_css
||=
'btn btn-link btn-remove btn-sm'
=
form_tag
oauth_application_path
(
application
)
do
=
form_tag
oauth_application_path
(
application
)
do
%input
{
:name
=>
"_method"
,
:type
=>
"hidden"
,
:value
=>
"delete"
}
/
%input
{
:name
=>
"_method"
,
:type
=>
"hidden"
,
:value
=>
"delete"
}
/
=
submit_tag
'Destroy'
,
onclick:
"return confirm('Are you sure?')"
,
class:
submit_btn_css
-
if
defined?
small
\ No newline at end of file
=
button_tag
type:
"submit"
,
class:
"btn btn-transparent"
,
data:
{
confirm:
"Are you sure?"
}
do
%span
.sr-only
Destroy
=
icon
(
'trash'
)
-
else
=
submit_tag
'Destroy'
,
data:
{
confirm:
"Are you sure?"
},
class:
submit_btn_css
app/views/doorkeeper/applications/_form.html.haml
View file @
33ba32e6
=
form_for
application
,
url:
doorkeeper_submit_path
(
application
),
html:
{
class:
'form-horizontal'
,
role:
'form'
}
do
|
f
|
=
form_for
application
,
url:
doorkeeper_submit_path
(
application
),
html:
{
role:
'form'
}
do
|
f
|
-
if
application
.
errors
.
any?
-
if
application
.
errors
.
any?
.alert.alert-danger
.alert.alert-danger
%ul
%ul
...
@@ -6,15 +6,11 @@
...
@@ -6,15 +6,11 @@
%li
=
msg
%li
=
msg
.form-group
.form-group
=
f
.
label
:name
,
class:
'control-label'
=
f
.
label
:name
,
class:
'label-light'
.col-sm-10
=
f
.
text_field
:name
,
class:
'form-control'
,
required:
true
=
f
.
text_field
:name
,
class:
'form-control'
,
required:
true
.form-group
.form-group
=
f
.
label
:redirect_uri
,
class:
'control-label'
=
f
.
label
:redirect_uri
,
class:
'label-light'
.col-sm-10
=
f
.
text_area
:redirect_uri
,
class:
'form-control'
,
required:
true
=
f
.
text_area
:redirect_uri
,
class:
'form-control'
,
required:
true
%span
.help-block
%span
.help-block
...
@@ -25,6 +21,5 @@
...
@@ -25,6 +21,5 @@
%code
=
Doorkeeper
.
configuration
.
native_redirect_uri
%code
=
Doorkeeper
.
configuration
.
native_redirect_uri
for local tests
for local tests
.form-actions
.prepend-top-default
=
f
.
submit
'Submit'
,
class:
"btn btn-create"
=
f
.
submit
'Add application'
,
class:
"btn btn-create"
=
link_to
"Cancel"
,
applications_profile_path
,
class:
"btn btn-cancel"
app/views/profiles/applications.html.haml
View file @
33ba32e6
-
page_title
"Applications"
-
page_title
"Applications"
-
header_title
page_title
,
applications_profile_path
-
header_title
page_title
,
applications_profile_path
.alert.alert-help.prepend-top-default
.row.prepend-top-default
.col-lg-3.profile-settings-sidebar
%h4
.prepend-top-0
=
page_title
%p
-
if
user_oauth_applications?
-
if
user_oauth_applications?
Manage applications that can use GitLab as an OAuth provider,
Manage applications that can use GitLab as an OAuth provider,
and applications that you've authorized to use your account.
and applications that you've authorized to use your account.
-
else
-
else
Manage applications that you've authorized to use your account.
Manage applications that you've authorized to use your account.
.col-lg-9
-
if
user_oauth_applications?
-
if
user_oauth_applications?
%h5
Add new application
=
render
'doorkeeper/applications/form'
,
application:
@application
%hr
-
if
user_oauth_applications?
.oauth-applications
.oauth-applications
%h3
%h5
Your applications
Your applications (
#{
@applications
.
size
}
)
.pull-right
=
link_to
'New Application'
,
new_oauth_application_path
,
class:
'btn btn-success'
-
if
@applications
.
any?
-
if
@applications
.
any?
.table-holder
.table-responsive
%table
.table.table-striped
%table
.table.table-striped
%thead
%thead
%tr
%tr
%th
Name
%th
Name
%th
Callback URL
%th
Callback URL
%th
Clients
%th
Clients
%th
%th
{
width:
105
}
%th
%tbody
%tbody
-
@applications
.
each
do
|
application
|
-
@applications
.
each
do
|
application
|
%tr
{
:id
=>
"application_#{application.id}"
}
%tr
{
:id
=>
"application_#{application.id}"
}
...
@@ -32,16 +38,22 @@
...
@@ -32,16 +38,22 @@
-
application
.
redirect_uri
.
split
.
each
do
|
uri
|
-
application
.
redirect_uri
.
split
.
each
do
|
uri
|
%div
=
uri
%div
=
uri
%td
=
application
.
access_tokens
.
count
%td
=
application
.
access_tokens
.
count
%td
=
link_to
'Edit'
,
edit_oauth_application_path
(
application
),
class:
'btn btn-link btn-sm'
%td
%td
=
render
'doorkeeper/applications/delete_form'
,
application:
application
=
link_to
edit_oauth_application_path
(
application
),
class:
"btn btn-transparent append-right-5"
do
%span
.sr-only
.oauth-authorized-applications.prepend-top-20
Edit
=
icon
(
'pencil'
)
=
render
'doorkeeper/applications/delete_form'
,
application:
application
,
small:
true
-
else
.profile-settings-message.text-center
You don't have any applications
.oauth-authorized-applications.prepend-top-20
-
if
user_oauth_applications?
-
if
user_oauth_applications?
%h3
%h5
Authorized applications
Authorized applications (
#{
@authorized_tokens
.
size
}
)
-
if
@authorized_tokens
.
any?
-
if
@authorized_tokens
.
any?
.table-holder
.table-responsive
%table
.table.table-striped
%table
.table.table-striped
%thead
%thead
%tr
%tr
...
@@ -67,4 +79,5 @@
...
@@ -67,4 +79,5 @@
%td
=
token
.
scopes
%td
=
token
.
scopes
%td
=
render
'doorkeeper/authorized_applications/delete_form'
,
token:
token
%td
=
render
'doorkeeper/authorized_applications/delete_form'
,
token:
token
-
else
-
else
%p
.light
You don't have any authorized applications
.profile-settings-message.text-center
You don't have any authorized applications
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment