summaryrefslogtreecommitdiff
path: root/app/views/doorkeeper/applications/index.html.haml
blob: aa271150b07f082d85d0906f3f7d8eeacd6af9f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
- page_title "Applications"

.row.prepend-top-default
  .col-lg-3.profile-settings-sidebar
    %h4.prepend-top-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-9
    - if user_oauth_applications?
      %h5.prepend-top-0
        Add new application
      = render 'form', application: @application
      %hr
    - if user_oauth_applications?
      .oauth-applications
        %h5
          Your applications (#{@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
                      = link_to edit_oauth_application_path(application), class: "btn btn-transparent append-right-5" do
                        %span.sr-only
                          Edit
                        = 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.append-bottom-default
      - if user_oauth_applications?
        %h5
          Authorized applications (#{@authorized_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
                %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
                    .help-block
                      %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