Project

General

Profile

1
<div page-content class="admin-pages">
2
  <div header>
3
    <admin-tabs tab="portal"></admin-tabs>
4
    <div *ngIf="!errorMessage && !showLoading" class="uk-grid filters" 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 search-input [control]="filterForm.controls.keyword" [showSearch]="false" placeholder="Search page"
18
             [bordered]="true" colorClass="uk-text-secondary"></div>
19
        <div class="show-options">
20
          <button class="uk-button uk-button-secondary">Bulk Actions</button>
21
          <div uk-dropdown="mode: click">
22
            <ul class="uk-nav uk-margin-left"
23
                [attr.uk-tooltip]="getSelectedCommunities().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
24
                title="Select at least one portal">
25
              <li><a [class]="getSelectedCommunities().length == 0 ? 'uk-disabled' : ''"
26
                     (click)="confirmDeleteSelectedCommunities()"><i></i> Delete </a></li>
27
            </ul>
28
          </div>
29
        </div>
30
        <div>
31
          <a (click)="newCommunity()"
32
             class="uk-flex uk-flex-middle uk-text-uppercase">
33
            <button class="large uk-icon-button uk-button-secondary">
34
              <icon name="add"></icon>
35
            </button>
36
            <button class="uk-button uk-button-link uk-margin-small-left uk-text-secondary">Add portal</button>
37
          </a>
38
        </div>
39
      </div>
40
    </div>
41
  </div>
42
  <div inner>
43
    <div *ngIf="updateErrorMessage" class="uk-alert-danger" uk-alert>
44
      <a class="uk-alert-close" uk-close></a>
45
      {{updateErrorMessage}}
46
    </div>
47
    <div *ngIf="errorMessage" class="uk-alert uk-alert-danger  uk-margin-large-top"
48
         role="alert">{{errorMessage}}</div>
49
    <div [style.display]="showLoading ? 'inline' : 'none'"
50
         class="uk-animation-fade uk-margin-large-top  uk-width-1-1" role="alert"><img
51
        class="uk-align-center loading-gif"></div>
52

    
53

    
54
    <div class=" uk-margin-medium-bottom" *ngIf="!errorMessage && !showLoading">
55

    
56
      <div class="">
57
        <div class="uk-overflow-container">
58
          <table class="uk-table uk-table-striped uk-table-hover">
59
            <thead class="form-header">
60
            <tr>
61
              <th><input id="allCommunityCheckbox" type="checkbox" (change)="toggleCheckBoxes($event)"></th>
62
              <th>Name</th>
63
              <th>Type</th>
64
              <th>Actions</th>
65
            </tr>
66
            </thead>
67
            <tbody>
68
            <tr *ngFor="let check of checkboxes; let i=index">
69
              <td><input id="{{check.community._id}}" class="checkBox" type="checkbox"
70
                         name="communitiescb[]" value="{{check.community._id}}" [(ngModel)]="check.checked">
71
              </td>
72
              <td>
73
                <div class="name" href="#">{{check.community.name}}</div>
74
              </td>
75
              <td>
76
                <div class="type" href="#">{{check.community.type}}</div>
77
              </td>
78
              <td>
79
                <div class="actions" href="#">
80
                  <i class="clickable" uk-icon="pencil" (click)="editCommunity(i)"></i>
81
                  <i class="clickable uk-text-danger" uk-icon="trash"
82
                     (click)="confirmDeleteCommunity(check.community._id)"></i>
83
                </div>
84
              </td>
85

    
86
            </tr>
87

    
88
            </tbody>
89
          </table>
90
          <div *ngIf="checkboxes.length==0" class="col-md-12">
91
            <div class="uk-alert-warning" uk-alert>No portals found</div>
92
          </div>
93
          <!--<div class="uk-width-1-1 uk-flex uk-flex-center ">
94
            <div class="uk-width-small uk-button-default uk-button" (click)="newCommunity()">
95
              <i class="" uk-icon="plus"></i>
96
            </div>
97
          </div>-->
98
        </div>
99
      </div>
100
    </div>
101
  </div>
102
</div>
103

    
104
<modal-alert #AlertModalSaveCommunity (alertOutput)="communitySaveConfirmed($event)"
105
             [okDisabled]="portalFG && (portalFG.invalid || !portalFG.dirty)">
106

    
107
  <div *ngIf="modalErrorMessage" class="uk-alert-danger" uk-alert aria-hidden="true">{{ modalErrorMessage }}</div>
108
  <form [formGroup]="portalFG">
109
    <div dashboard-input class="uk-margin-small-left" [formInput]="portalFG.controls.name"
110
         type="text"
111
         label="Portal Name">
112
    </div>
113
    <div [ngClass]="{'has-error':!portalFG.controls.type.valid && portalFG.controls.type.dirty}">
114
      <label for="portalTypeTag">*Portal Type</label>
115
      <select formControlName="type" id="portalTypeTag" class="form-control uk-select">
116
        <option *ngFor="let option of portalUtils.portalTypes" [value]="option.value">{{option.label}}</option>
117
      </select>
118
    </div>
119
    <div dashboard-input class="uk-margin-small-left " [formInput]="portalFG.controls.pid"
120
         type="text"
121
         label="Portal persistent id for portal">
122
    </div>
123
    <div dashboard-input class="uk-margin-small-left" [formInput]="portalFG.controls.piwik"
124
         type="text"
125
         label="Piwik id">
126
    </div>
127
    <input type="hidden" formControlName="_id">
128
  </form>
129

    
130
</modal-alert>
131
<modal-alert #AlertModalDeleteCommunities (alertOutput)="confirmedDeleteCommunities($event)"></modal-alert>
(3-3/5)