Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/doorkeeper/applications/index.html.haml')
-rw-r--r--app/views/doorkeeper/applications/index.html.haml89
1 files changed, 6 insertions, 83 deletions
diff --git a/app/views/doorkeeper/applications/index.html.haml b/app/views/doorkeeper/applications/index.html.haml
index 827a839234f..e17448fbeaf 100644
--- a/app/views/doorkeeper/applications/index.html.haml
+++ b/app/views/doorkeeper/applications/index.html.haml
@@ -1,85 +1,8 @@
- page_title _("Applications")
-- @content_class = "limit-container-width" unless fluid_layout
-.row.gl-mt-3
- .col-lg-4.profile-settings-sidebar
- %h4.gl-mt-0
- = page_title
- %p
- - if user_oauth_applications?
- = _("Manage applications that can use GitLab as an OAuth provider, and applications that you've authorized to use your account.")
- - else
- = _("Manage applications that you've authorized to use your account.")
- .col-lg-8
- - if user_oauth_applications?
- %h5.gl-mt-0
- = _('Add new application')
- = render 'form', application: @application
- %hr
- - else
- .bs-callout.bs-callout-disabled
- = _('Adding new applications is disabled in your GitLab instance. Please contact your GitLab administrator to get the permission')
- - if user_oauth_applications?
- .oauth-applications
- %h5
- = _("Your applications (%{size})") % { size: @applications.size }
- - if @applications.any?
- .table-responsive
- %table.table
- %thead
- %tr
- %th= _('Name')
- %th= _('Callback URL')
- %th= _('Clients')
- %th.last-heading
- %tbody
- - @applications.each do |application|
- %tr{ id: "application_#{application.id}" }
- %td= link_to application.name, oauth_application_path(application)
- %td
- - application.redirect_uri.split.each do |uri|
- %div= uri
- %td= application.access_tokens.count
- %td.gl-display-flex
- = link_to edit_oauth_application_path(application), class: "gl-button btn btn-default gl-mr-2" do
- %span.sr-only
- = _('Edit')
- = sprite_icon('pencil')
- = render 'delete_form', application: application, small: true
- - else
- .settings-message.text-center
- = _("You don't have any applications")
- .oauth-authorized-applications.prepend-top-20.gl-mb-3
- - if user_oauth_applications?
- %h5
- = _("Authorized applications (%{size})") % { size: @authorized_apps.size + @authorized_anonymous_tokens.size }
-
- - if @authorized_tokens.any?
- .table-responsive
- %table.table.table-striped
- %thead
- %tr
- %th= _('Name')
- %th= _('Authorized At')
- %th= _('Scope')
- %th
- %tbody
- - @authorized_apps.each do |app|
- - token = app.authorized_tokens.order('created_at desc').first # rubocop: disable CodeReuse/ActiveRecord
- %tr{ id: "application_#{app.id}" }
- %td= app.name
- %td= token.created_at
- %td= token.scopes
- %td= render 'doorkeeper/authorized_applications/delete_form', application: app
- - @authorized_anonymous_tokens.each do |token|
- %tr
- %td
- = _('Anonymous')
- .form-text.text-muted
- %em= _("Authorization was granted by entering your username and password in the application.")
- %td= token.created_at
- %td= token.scopes
- %td= render 'doorkeeper/authorized_applications/delete_form', token: token
- - else
- .settings-message.text-center
- = _("You don't have any authorized applications")
+= render 'shared/doorkeeper/applications/index',
+ oauth_applications_enabled: user_oauth_applications?,
+ oauth_authorized_applications_enabled: true,
+ form_url: doorkeeper_submit_path(@application),
+ application_url: ->(application) { oauth_application_path(application) },
+ edit_application_url: ->(application) { edit_oauth_application_path(application) }