Merge pull request #7478 from xurizaemon/master
[civicrm-core.git] / ang / crmCxn / ManageCtrl.html
1 <div crm-ui-debug="appMetas"></div>
2 <div crm-ui-debug="cxns"></div>
3 <div crm-ui-debug="alerts"></div>
4
5 <!--
6 The merits of this layout:
7 * On a fresh install, the available connections show up first.
8 * Once you've made a connection, the extant connections bubble up.
9 * Extant connections can be portrayed as enabled or disabled.
10 -->
11
12 <div ng-show="cxns.length > 0">
13 <span crm-ui-order="{var: 'cxnOrder', defaults: ['-created_date']}"></span>
14 <h3>{{ts('Existing Connections')}}</h3>
15 <table class="display">
16 <thead>
17 <tr>
18 <th>{{ts('Title')}}</th> <!-- <a crm-ui-order-by="[cxnOrder, 'app_meta.appId']"> -->
19 <th>{{ts('Description')}}</th> <!-- <a crm-ui-order-by="[cxnOrder, 'desc']"> -->
20 <th>{{ts('Status')}}</th>
21 <th></th>
22 </tr>
23 </thead>
24 <tbody>
25 <tr ng-repeat="cxn in cxns | orderBy:cxnOrder.get()" ng-class-even="'even-row even'" ng-class-odd="'odd-row odd'">
26 <td>
27 <a class="action-item"
28 crm-confirm='{width: "65%", resizable: true, title:ts("%1: About", {1: cxn.app_meta.title}), templateUrl: "~/crmCxn/AboutCtrl.html", export: {appMeta: cxn.app_meta}}'
29 >{{cxn.app_meta.title}}</a>
30 </td>
31 <td><div ng-bind-html="cxn.app_meta.desc"></div></td>
32 <td>{{cxn.is_active ? ts('Enabled') : ts('Disabled')}}</td>
33 <td>
34 <span>
35 <!--
36 <a class="action-item crm-hover-button" ng-click="toggleCxn(cxn)">{{cxn.is_active ? ts('Disable') : ts('Enable') }}</a>
37 -->
38 <a class="action-item crm-hover-button" ng-click="openLink(cxn.app_meta, 'settings', {title: ts('%1: Settings (External)', {1: cxn.app_meta.title})})" ng-show="cxn.app_meta.links.settings">{{ts('Settings')}}</a>
39 <span class="btn-slide crm-hover-button">{{ts('more')}}
40 <ul class="panel" style="display: none;">
41 <li ng-show="cxn.app_meta.links.logs">
42 <a class="action-item crm-hover-button" ng-click="openLink(cxn.app_meta, 'logs', {title: ts('%1: Logs (External)', {1: cxn.app_meta.title})})">
43 {{ts('Logs')}}
44 </a>
45 </li>
46 <li ng-show="cxn.app_meta.links.docs">
47 <a class="action-item crm-hover-button" ng-click="openLink(cxn.app_meta, 'docs', {title: ts('%1: Documentation (External)', {1: cxn.app_meta.title})})">
48 {{ts('Docs')}}
49 </a>
50 </li>
51 <li ng-show="cxn.app_meta.links.support">
52 <a class="action-item crm-hover-button" ng-click="openLink(cxn.app_meta, 'support', {title: ts('%1: Support (External)', {1: cxn.app_meta.title})})">
53 {{ts('Support')}}
54 </a>
55 </li>
56 <li>
57 <a class="action-item crm-hover-button"
58 crm-confirm='{width: "65%", resizable: true, title:ts("%1: Reconnect", {1: cxn.app_meta.title}), templateUrl: "~/crmCxn/ConfirmReconnectCtrl.html", export: {cxn: cxn, appMeta: findAppByAppId(cxn.app_guid)}}'
59 on-yes="reregister(cxn.app_meta)"
60 >{{ts('Reconnect')}}</a>
61 </li>
62 <li>
63 <a class="action-item crm-hover-button"
64 crm-confirm='{width: "65%", resizable: true, title: ts("%1: Disconnect", {1: cxn.app_meta.title}), message: ts("Are you sure you want to disconnect \"%1?\". Doing so may permanently destroy data linkage.", {1: cxn.app_meta.title})}'
65 on-yes="unregister(cxn.app_meta)">
66 {{ts('Disconnect')}}
67 </a>
68 </li>
69 </ul>
70 </span>
71
72 </span>
73 </td>
74 </tr>
75 </tbody>
76 </table>
77 <br/>
78 </div>
79
80 <div ng-show="hasAvailApps()">
81 <span crm-ui-order="{var: 'availOrder', defaults: ['title']}"></span>
82
83 <h3>{{ts('New Connections')}}</h3>
84 <table class="display">
85 <thead>
86 <tr>
87 <th><a crm-ui-order-by="[availOrder, 'title']">{{ts('Title')}}</a></th>
88 <th><a crm-ui-order-by="[availOrder, 'desc']">{{ts('Description')}}</a></th>
89 <th></th>
90 </tr>
91 </thead>
92 <tbody>
93 <tr ng-repeat="appMeta in appMetas | orderBy:availOrder.get()" ng-show="!findCxnByAppId(appMeta.appId)" ng-class-even="'even-row even'" ng-class-odd="'odd-row odd'">
94 <td>
95 <a crm-confirm='{width: "65%", resizable: true, title:ts("%1: About", {1: appMeta.title}), templateUrl: "~/crmCxn/AboutCtrl.html", export: {appMeta: appMeta}}'
96 >{{appMeta.title}}</a>
97 </td>
98 <td><div ng-bind-html="appMeta.desc"></div></td>
99 <td>
100 <a class="action-item crm-hover-button"
101 crm-confirm='{width: "65%", resizable: true, title:ts("%1: Connect", {1: appMeta.title}), templateUrl: "~/crmCxn/ConfirmConnectCtrl.html", export: {appMeta: appMeta}}'
102 on-yes="register(appMeta)"
103 >{{ts('Connect')}}</a>
104 </td>
105 </tr>
106 </tbody>
107 </table>
108 </div>
109
110 <div ng-show="$.isEmptyObject(appMetas)" class="messages status no-popup">
111 <i class="crm-i fa-info-circle"></i>
112 {{ts('No available applications')}}
113 </div>