Project

General

Profile

« Previous | Next » 

Revision 60310

[Library | Trunk]: Admin tools pages, fix modals and update behaviour

View differences:

pages.component.html
121 121
              </li>
122 122

  
123 123
            </ul>
124

  
125
            <div *ngIf="checkboxes.length==0" class="col-md-12">
124
            <div *ngIf="checkboxes.length==0">
126 125
              <div class="uk-alert-warning" uk-alert>No pages found</div>
127 126
            </div>
128
            <div *ngIf="isPortalAdministrator" class="uk-width-1-1 uk-flex uk-flex-center ">
129
              <div class="uk-width-small uk-button uk-button-default" (click)="newPage()">
130
                <i class="" uk-icon="plus"></i>
131
              </div>
132
            </div>
133 127
          </div>
134 128
        </div>
135 129
      </div>
......
137 131
  </div>
138 132
</div>
139 133

  
140
<modal-alert #AlertModalSavePage (alertOutput)="pageSaveConfirmed($event)"
141
             [okDisabled]="myForm && (myForm.invalid || !myForm.dirty)">
134
<modal-alert #editModal (alertOutput)="pageSaveConfirmed($event)"
135
             [okDisabled]="pageForm && (pageForm.invalid || !pageForm.dirty)">
142 136
  <div *ngIf="modalErrorMessage" class="uk-alert-danger" uk-alert aria-hidden="true">{{ modalErrorMessage }}</div>
143
  <form [formGroup]="myForm">
144

  
145
    <div dashboard-input class="uk-margin-small-left" [formInput]="myForm.get('route')"
146
         type="text"
147
         label="Page route">
137
  <form *ngIf="pageForm" [formGroup]="pageForm" class="uk-grid uk-child-width-1-1" uk-grid>
138
    <div dashboard-input  [formInput]="pageForm.get('route')"
139
         type="text" label="Page route" placeholder="Write a route">
148 140
    </div>
149

  
150
    <div dashboard-input class="uk-margin-small-left" [formInput]="myForm.get('name')"
151
         type="text"
141
    <div dashboard-input [formInput]="pageForm.get('name')"
142
         type="text" placeholder="Write a name"
152 143
         label="Page Name">
153 144
    </div>
154

  
155
    <div dashboard-input class="uk-margin-small-left" [formInput]="myForm.get('type')"
156
         type="select"
145
    <div dashboard-input [formInput]="pageForm.get('type')"
146
         type="select" placeholder="Choose a page Type"
157 147
         label="Type" [options]="typeOptions">
158 148
    </div>
159
    <mat-form-field class="example-chip-list uk-width-1-1  uk-margin-small-left">
160
      <mat-chip-list #chipList aria-label="Page selection">
161
        <mat-chip
162
            *ngFor="let entity of selectedEntities"
163
            [selectable]="true"
164
            [removable]="true">
165
          {{entity.name}}
166
          <span (click)="remove(entity)"
167
                class=" notranslate mat-chip-remove mat-chip-trailing-icon " uk-icon="trash"></span>
168
        </mat-chip>
169
        <input placeholder="Add in  pages..." #PageInput
170
               [formControl]="entitiesSearchCtrl" [matAutocomplete]="auto" [matChipInputFor]="chipList">
171
      </mat-chip-list>
172
      <mat-autocomplete #auto="matAutocomplete" (optionSelected)="selected($event)">
173
        <mat-option *ngFor="let entity of  filteredEntities| async" [value]="entity">
174
          {{entity.name}}
175
        </mat-option>
176
      </mat-autocomplete>
177
    </mat-form-field>
178

  
149
    <div dashboard-input [formInput]="pageForm.get('entities')" placeholder="Add an entity"
150
         type="chips" [options]="allEntities" label="Entities" chipLabel="name">
151
    </div>
152
    <div dashboard-input type="select" label="Portal Type" placeholder="Choose a type"
153
         [formInput]="pageForm.get('portalType')" [options]="portalUtils.portalTypes"></div>
179 154
    <div class="form-group">
180
      <label class="uk-text-danger uk-margin-small-bottom">
181
        By disabling a position, all contents in this position will be deleted.
182
      </label>
183
      <div class="title"> Select if this page exists in:</div>
184
      <div class=" uk-grid">
185
        <span dashboard-input class="" [formInput]="myForm.get('top')"
155
      <div class="uk-form-label uk-text-bold uk-margin-small-bottom"> Select if this page have helptext at: </div>
156
      <div class="uk-grid uk-grid-small uk-child-width-1-4" uk-grid>
157
        <div dashboard-input [formInput]="pageForm.get('top')"
186 158
              type="checkbox"
187 159
              label="Top">
188
        </span>
189
        <span dashboard-input class="uk-margin-small-left" [formInput]="myForm.get('right')"
160
        </div>
161
        <div dashboard-input [formInput]="pageForm.get('right')"
190 162
              type="checkbox"
191 163
              label="Right">
192
        </span>
193
        <span dashboard-input class="uk-margin-small-left" [formInput]="myForm.get('bottom')"
164
        </div>
165
        <div dashboard-input [formInput]="pageForm.get('bottom')"
194 166
              type="checkbox"
195 167
              label="Bottom">
196
        </span>
197
        <span dashboard-input class="uk-margin-small-left" [formInput]="myForm.get('left')"
168
        </div>
169
        <div dashboard-input [formInput]="pageForm.get('left')"
198 170
              type="checkbox"
199 171
              label="Left">
200
        </span>
172
        </div>
201 173
      </div>
174
      <label class="uk-text-danger">
175
        By disabling a position, all contents in this position will be deleted.
176
      </label>
202 177
    </div>
203
    <div [ngClass]="{'has-error':!myForm.controls.portalType.valid && myForm.controls.portalType.dirty}"
204
         class="form-group">
205
      <div class="uk-width-1-1 uk-margin-small-bottom uk-text-bold uk-form-label">
206
        Page exists in:
207
      </div>
208
      <div class="uk-child-width-1-2 uk-grid">
209
        <span *ngFor="let option of portalUtils.portalTypes" class="radio ">
210
          <span class="uk-margin-small-right" style="font-weight: normal;">{{option.label}}</span>
211
          <input type="radio" [value]="option.value" formControlName="portalType">
212
        </span>
213
      </div>
214
    </div>
215

  
216
    <input type="hidden" formControlName="_id">
217 178
  </form>
218 179

  
219 180
</modal-alert>
220 181

  
221
<modal-alert #AlertModalDeletePages (alertOutput)="confirmedDeletePages($event)"></modal-alert>
182
<modal-alert #deleteModal (alertOutput)="confirmedDeletePages($event)"></modal-alert>

Also available in: Unified diff