1 <h1>{{options.provider.title}}
</h1>
3 <div af-api4-ctrl=
"theClients" af-api4=
"['OAuthClient', 'get', {where: [['provider','=',options.provider.name]]}]"></div>
5 <div ng-if=
"!theClients.loading">
6 <div class=
"panel panel-info" ng-init=
"selected = {tab: theClients.result.length > 0 ? 'client_' + theClients.result[0].id : 'new'}">
7 <ul class=
"panel-heading nav nav-tabs">
8 <li role=
"presentation" ng-repeat=
"theClient in theClients.result" ng-class=
"{active: selected.tab === 'client_' + theClient.id}"><a ng-click=
"selected.tab = 'client_' + theClient.id">{{ts('Client #%
1', {
1: theClient.id})}}
</a></li>
9 <li role=
"presentation" ng-class=
"{active: selected.tab === 'new'}"><a ng-click=
"selected.tab = 'new'">{{ts('Register Client')}}
</a></li>
10 <li role=
"presentation" ng-class=
"{active: selected.tab === 'details'}"><a ng-click=
"selected.tab = 'details'">{{ts('Details')}}
</a></li>
13 <div class=
"panel-body" ng-if=
"selected.tab === 'details'">
14 <pre>{{options.provider|json}}
</pre>
17 <div class=
"panel-body" ng-repeat=
"resultClient in theClients.result" ng-if=
"selected.tab === 'client_'+resultClient.id">
18 <div ng-form=
"editClientForm">
19 <h4>{{ts('Tokens')}}
</h4>
21 <oauth-client-tokens options=
"{clientId: resultClient.id}"></oauth-client-tokens>
23 <div class=
"btn-group" oauth-util-grant-ctrl=
"granter">
24 <a class=
"btn btn-primary" ng-click=
"granter.authCode(resultClient.id)">{{ts('Add (Auth Code)')}}
</a>
27 <h4>{{ts('Properties')}}
</h4>
29 <oauth-client-editor options=
"{client: resultClient}"></oauth-client-editor>
30 <div class=
"btn-group">
31 <a class=
"btn btn-primary"
32 af-api4-action=
"['OAuthClient', 'update', {where: [['id', '=', resultClient.id]], values:resultClient}]">{{ts('Save')}}
</a>
33 <a class=
"btn btn-danger"
34 af-api4-action=
"['OAuthClient', 'delete', {where: [['id', '=', resultClient.id]]}]"
35 af-api4-success=
"selected.tab = 'details'; theClients.refresh()"
42 <div class=
"panel-body" ng-if=
"selected.tab === 'new'" ng-form=
"newClientForm" ng-init=
"theNew = {provider: options.provider.name}">
43 <oauth-client-create-help options=
"{provider: options.provider}"></oauth-client-create-help>
44 <div crm-ui-debug=
"theNew"></div>
45 <oauth-client-creator options=
"{client: theNew}"></oauth-client-creator>
46 <div class=
"btn-group">
47 <a class=
"btn btn-primary"
48 af-api4-action=
"['OAuthClient', 'create', {values:theNew}]"
49 af-api4-success=
"theNew = {provider: options.provider.name}; theClients.refresh(); selected.tab = 'client_' + response[0].id"