00e6189c053516a4f1c31f464eafd09b6e90a269
[motion-next.git] /
1 <div
2   id="freshsalesAccounts"
3   class="page-layout simple left-sidenav inner-sidenav motion-list"
4 >
5   <!-- HEADER -->
6   <div
7     class="header md-accent-bg"
8     layout="row"
9     layout-align="space-between center"
10   >
11     <!-- APP TITLE -->
12     <div layout="row" layout-align="start center">
13       <div class="logo" layout="row" layout-align="start center">
14         <span class="logo-icon">
15           <md-icon md-font-icon="icon-heart" class="s24"></md-icon>
16         </span>
17         <span class="logo-text" translate="INTEGRATIONS.FRESHSALESACCOUNTS"
18           >FreshsalesAccounts</span
19         >
20       </div>
21     </div>
22     <!-- / APP TITLE -->
23
24     <div layout="row">
25       <!-- SEARCH -->
26       <div
27         class="search-input-wrapper"
28         layout="row"
29         layout-align="start center"
30       >
31         <label for="search">
32           <md-icon md-font-icon="icon-magnify"></md-icon>
33         </label>
34         <md-input-container md-no-float class="m-0">
35           <input
36             id="search"
37             placeholder="Search for anyone"
38             type="text"
39             ng-model="vm.query.filter"
40             ng-model-options="{ debounce: 1000 }"
41             translate
42             translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE"
43           />
44         </md-input-container>
45       </div>
46       <!-- / SEARCH -->
47     </div>
48   </div>
49   <!-- / HEADER -->
50
51   <!-- SELECTED BAR -->
52   <div
53     ng-show="vm.selectedFreshsalesAccounts.length > 0"
54     class="selected-bar header animate-slide-down md-accent-bg"
55     layout="row"
56     layout-align="start center"
57   >
58     <div
59       class="close-button-wrapper"
60       ng-click="vm.selectedFreshsalesAccounts =[]"
61     >
62       <md-button layout="row" layout-align="start center">
63         <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>
64         <span translate="INTEGRATIONS.BACK">Back</span>
65       </md-button>
66     </div>
67
68     <div flex layout="row" layout-align="space-between center">
69       <div>
70         <span class="selected-freshsalesAccounts-count">
71           <span>{{vm.selectedFreshsalesAccounts.length}}</span>
72           <span translate="INTEGRATIONS.SELECTED">selected</span>
73         </span>
74
75         <md-menu class="select-menu" ng-if="!vm.currentThread">
76           <md-button
77             class="md-icon-button"
78             ng-click="$mdMenu.open($event)"
79             aria-label="multi select toggle"
80             translate
81             translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE"
82           >
83             <md-icon md-font-icon="icon-menu-down"></md-icon>
84           </md-button>
85           <md-menu-content width="3">
86             <md-menu-item>
87               <md-button
88                 ng-click="vm.selectAllFreshsalesAccounts()"
89                 translate="INTEGRATIONS.SELECT_ALL"
90               >
91                 Select all
92               </md-button>
93             </md-menu-item>
94             <md-menu-item>
95               <md-button
96                 ng-click="vm.deselectFreshsalesAccounts()"
97                 translate="INTEGRATIONS.SELECT_NONE"
98               >
99                 Select none
100               </md-button>
101             </md-menu-item>
102           </md-menu-content>
103         </md-menu>
104       </div>
105
106       <div class="multi-select-actions">
107         <button
108           class="md-icon-button"
109           ng-csv="vm.exportSelectedFreshsalesAccounts"
110           csv-label="true"
111           filename="freshsalesAccounts.csv"
112         >
113           <md-icon md-font-icon="icon-file-excel"></md-icon>
114         </button>
115         <md-button
116           class="md-icon-button"
117           ng-if="vm.crudPermissions.canDelete"
118           ng-click="vm.deleteSelectedFreshsalesAccounts($event)"
119           aria-label="delete selected"
120           translate
121           translate-attr-label="INTEGRATIONS.DELETE_SELECTED"
122         >
123           <md-icon md-font-icon="icon-delete"></md-icon>
124         </md-button>
125       </div>
126     </div>
127   </div>
128   <!-- / SELECTED BAR -->
129
130   <!-- CONTENT -->
131   <div class="content" md-background-bg layout="row" layout-align="start start">
132     <!-- MAIN -->
133     <div class="main scrollable" ms-scroll>
134       <!-- FRESHSALESACCOUNT TABLE -->
135       <md-card>
136         <md-table-container>
137           <table
138             md-table
139             md-row-select
140             multiple
141             ng-model="vm.selectedFreshsalesAccounts"
142             md-progress="vm.promise"
143           >
144             <thead
145               md-head
146               md-order="vm.query.sort"
147               md-on-reorder="vm.getFreshsalesAccounts"
148             >
149               <tr md-row>
150                 <th
151                   md-column
152                   ng-if="vm.table == 'users' || vm.table == 'agents'"
153                   width="20px"
154                 ></th>
155                 <th md-column md-order-by="id">
156                   {{ 'INTEGRATIONS.ID' | translate }}
157                 </th>
158                 <th md-column md-order-by="name">
159                   {{ 'INTEGRATIONS.NAME' | translate }}
160                 </th>
161                 <th md-column md-order-by="username">
162                   {{ 'INTEGRATIONS.USERNAME' | translate }}
163                 </th>
164                 <th md-column md-order-by="remoteUri">
165                   {{ 'INTEGRATIONS.URI' | translate }}
166                 </th>
167                 <th md-column width="10px"></th>
168               </tr>
169             </thead>
170             <tbody md-body>
171               <tr md-row ng-hide="vm.freshsalesAccounts.rows.length">
172                 <td md-cell colspan="5">
173                   <div layout="row" layout-align="center center">
174                     <span translate="INTEGRATIONS.NO_AVAILABLE_INFO"
175                       >No Available Info</span
176                     >
177                   </div>
178                 </td>
179               </tr>
180               <tr
181                 md-row
182                 md-select="freshsalesAccount"
183                 md-select-id="id"
184                 ng-repeat="freshsalesAccount in vm.freshsalesAccounts.rows"
185               >
186                 <td md-cell ng-if="freshsalesAccount.userpic">
187                   <img
188                     class="avatar"
189                     alt="{{freshsalesAccount.name}}"
190                     ng-src="api/users/{{freshsalesAccount.id}}/avatar"
191                   />
192                 </td>
193                 <td
194                   md-cell
195                   ng-if="!freshsalesAccount.userpic && (vm.table == 'users' || vm.table == 'agents')"
196                 >
197                   <img
198                     class="avatar"
199                     alt="{{freshsalesAccount.name}}"
200                     ng-src="assets/images/avatars/profile.png"
201                   />
202                 </td>
203                 <td
204                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshsalesAccount, ev) : vm.createOrEditFreshsalesAccount($event, freshsalesAccount)"
205                   md-cell
206                   class="id"
207                 >
208                   {{freshsalesAccount.id}}
209                 </td>
210                 <td
211                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshsalesAccount, ev) : vm.createOrEditFreshsalesAccount($event, freshsalesAccount)"
212                   md-cell
213                   class="name"
214                 >
215                   {{freshsalesAccount.name}}
216                 </td>
217                 <td
218                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshsalesAccount, ev) : vm.createOrEditFreshsalesAccount($event, freshsalesAccount)"
219                   md-cell
220                   class="username"
221                 >
222                   {{freshsalesAccount.username}}
223                 </td>
224                 <td
225                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(freshsalesAccount, ev) : vm.createOrEditFreshsalesAccount($event, freshsalesAccount)"
226                   md-cell
227                   class="remoteUri"
228                 >
229                   {{freshsalesAccount.remoteUri}}
230                 </td>
231
232                 <td md-cell class="actions">
233                   <md-menu>
234                     <md-button
235                       class="md-icon-button"
236                       aria-label="More"
237                       translate
238                       translate-attr-aria-label="INTEGRATIONS.MORE"
239                       ng-click="$mdMenu.open($event)"
240                     >
241                       <md-icon md-font-icon="icon-dots-vertical"></md-icon>
242                     </md-button>
243
244                     <md-menu-content width="3">
245                       <!-- SUBACTIONS -->
246
247                       <!-- ACTIONS -->
248
249                       <md-menu-item ng-if="vm.crudPermissions.canEdit">
250                         <md-button
251                           ng-click="vm.editstate(freshsalesAccount, $event    )"
252                           translate="INTEGRATIONS.EDIT_FRESHSALESACCOUNT"
253                         >
254                           Edit FreshsalesAccount
255                         </md-button>
256                       </md-menu-item>
257
258                       <!-- SUBACTIONS -->
259
260                       <!-- ACTIONS -->
261
262                       <md-menu-item>
263                         <md-button
264                           ng-click="vm.testtestintegrationaccount(freshsalesAccount, $event    )"
265                           translate="INTEGRATIONS.TEST_FRESHSALESACCOUNT"
266                         >
267                           Test FreshsalesAccount
268                         </md-button>
269                       </md-menu-item>
270
271                       <!-- SUBACTIONS -->
272
273                       <!-- ACTIONS -->
274
275                       <md-menu-item ng-if="vm.crudPermissions.canDelete">
276                         <md-button
277                           ng-click="vm.deleteconfirm(freshsalesAccount, $event    )"
278                           translate="INTEGRATIONS.DELETE_FRESHSALESACCOUNT"
279                         >
280                           Delete FreshsalesAccount
281                         </md-button>
282                       </md-menu-item>
283                     </md-menu-content>
284                   </md-menu>
285                 </td>
286               </tr>
287             </tbody>
288           </table>
289         </md-table-container>
290
291         <md-table-pagination
292           md-label="{page: '{{'INTEGRATIONS.PAGE' | translate}}:', rowsPerPage: '{{'INTEGRATIONS.ROWSPERPAGE' | translate}}:', of: '{{'INTEGRATIONS.OF' | translate}}'}"
293           md-limit="vm.query.limit"
294           md-limit-options="[10, 15, 20, 50, 100, 250]"
295           md-page="vm.query.page"
296           md-total="{{vm.freshsalesAccounts.count}}"
297           md-on-paginate="vm.getFreshsalesAccounts"
298           md-page-select
299         ></md-table-pagination>
300       </md-card>
301       <!-- / FRESHSALESACCOUNT TABLE -->
302       <!-- NO RESULTS -->
303
304       <!-- / NO RESULTS -->
305     </div>
306     <!-- / MAIN -->
307   </div>
308   <!-- / CONTENT -->
309
310   <!-- ADD FRESHSALESACCOUNT BUTTON -->
311   <md-button
312     ng-if="vm.crudPermissions.canEdit"
313     class="md-fab md-accent add-item-button"
314     id="add-freshsalesAccount-button"
315     ng-click="vm.createOrEditFreshsalesAccount($event)"
316     aria-label="add freshsalesAccount"
317     translate
318     translate-attr-aria-label="INTEGRATIONS.ADD_FRESHSALESACCOUNT"
319   >
320     <md-icon md-font-icon="icon-plus"></md-icon>
321   </md-button>
322   <!-- / ADD FRESHSALESACCOUNT BUTTON -->
323 </div>