Project

General

Profile

1 61381 k.triantaf
<div page-content class="admin-pages">
2
  <div header>
3
    <admin-tabs tab="portal"></admin-tabs>
4
    <div *ngIf="!showLoading" class="uk-grid" uk-grid>
5
      <div class="uk-width-1-1">
6
        <ul class="uk-subnav uk-subnav-pill">
7
          <li [class.uk-active]="filterForm.get('type').value === 'all'" class="uk-margin-small-bottom"><a
8
              (click)="filterForm.get('type').setValue('all')"><span
9
              class="title">All portals</span></a></li>
10
          <li *ngFor="let type of  portalUtils.portalTypes; let i=index"
11
              [class.uk-active]="filterForm.get('type').value === type.value" class="uk-margin-small-bottom"><a
12
              (click)="filterForm.get('type').setValue(type.value)"><span
13
              class="title">{{type.label}}</span></a></li>
14
        </ul>
15
      </div>
16
      <div class="uk-width-1-1 uk-flex uk-flex-right@m uk-flex-center uk-flex-wrap uk-flex-middle uk-grid" uk-grid>
17
        <div #searchInputComponent search-input [control]="filterForm.controls.keyword" [showSearch]="false"
18
             placeholder="Search portal"
19
             [selected]="selectedKeyword" (closeEmitter)="onSearchClose()" (resetEmitter)="reset()"
20
             [bordered]="true" colorClass="uk-text-secondary"
21
             class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1"></div>
22
        <div class="show-options">
23
          <button class="uk-button uk-button-secondary">Bulk Actions</button>
24
          <div uk-dropdown="mode: click">
25
            <ul class="uk-nav uk-dropdown-nav"
26
                [attr.uk-tooltip]="getSelectedPortals().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
27
                title="Select at least one portal">
28
              <li><a [class]="getSelectedPortals().length == 0 ? 'uk-disabled' : ''"
29
                     (click)="confirmDeleteSelectedPortals()"><i></i> Delete </a></li>
30
            </ul>
31
          </div>
32
        </div>
33
        <div>
34
          <a (click)="newPortal()"
35
             class="uk-flex uk-flex-middle uk-text-uppercase">
36
            <button class="large uk-icon-button uk-button-secondary">
37
              <icon name="add"></icon>
38
            </button>
39
            <button class="uk-button uk-button-link uk-margin-small-left uk-text-secondary">Add portal</button>
40
          </a>
41
        </div>
42
      </div>
43
    </div>
44
  </div>
45
  <div inner>
46
    <div *ngIf="showLoading" class="uk-position-center">
47
      <loading></loading>
48
    </div>
49
    <div *ngIf="!showLoading">
50
      <table *ngIf="checkboxes.length > 0" class="uk-table uk-table-striped uk-table-hover">
51
        <thead class="uk-card-header">
52
        <tr>
53
          <th><input id="allCommunityCheckbox" type="checkbox" (change)="toggleCheckBoxes($event)"></th>
54
          <th>Name</th>
55
          <th>Type</th>
56
          <th>Actions</th>
57
        </tr>
58
        </thead>
59
        <tbody>
60
        <tr *ngFor="let check of checkboxes; let i=index">
61
          <td><input id="{{check.portal._id}}" class="checkBox" type="checkbox"
62
                     name="communitiescb[]" value="{{check.portal._id}}" [(ngModel)]="check.checked">
63
          </td>
64
          <td>
65
            <div class="name" href="#">{{check.portal.name}}</div>
66
          </td>
67
          <td>
68
            <div class="type" href="#">{{check.portal.type}}</div>
69
          </td>
70
          <td>
71
            <div class="actions" href="#">
72
              <i class="clickable" uk-icon="pencil" (click)="editPortal(i)"></i>
73
              <i class="clickable uk-text-danger" uk-icon="trash"
74
                 (click)="confirmDeletePortal(check.portal._id)"></i>
75
            </div>
76
          </td>
77
78
        </tr>
79
80
        </tbody>
81
      </table>
82
      <div *ngIf="checkboxes.length == 0"
83
           class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
84
        <div>No portals found</div>
85
      </div>
86
    </div>
87
  </div>
88
</div>
89
90
<modal-alert #editModal (alertOutput)="portalSaveConfirmed($event)"
91
             [okDisabled]="portalForm && (portalForm.invalid || !portalForm.dirty)">
92
  <form *ngIf="portalForm" [formGroup]="portalForm" class="uk-grid uk-child-width-1-1" uk-grid>
93
    <div dashboard-input [formInput]="portalForm.get('name')" type="text" label="Portal Name"
94
         placeholder="Write a name">
95
    </div>
96
    <div dashboard-input type="select" label="Portal Type" placeholder="Choose a type"
97
         [formInput]="portalForm.get('type')" [options]="portalUtils.portalTypes"></div>
98
    <div dashboard-input [formInput]="portalForm.get('pid')"
99
         type="text" placeholder="Write pid of portal"
100
         label="Portal persistent id for portal">
101
    </div>
102
    <div dashboard-input [formInput]="portalForm.get('piwik')"
103
         type="text" placeholder="Write piwik id of portal"
104
         label="Piwik id">
105
    </div>
106
    <input type="hidden" formControlName="_id">
107
  </form>
108
109
</modal-alert>
110
<modal-alert #deleteModal (alertOutput)="confirmedDeletePortals($event)"></modal-alert>