2018-10-30 16:31:16 +01:00
|
|
|
<div *ngIf="updateErrorMessage" class="uk-alert uk-alert-danger" role="alert">{{updateErrorMessage}}</div>
|
|
|
|
<div *ngIf="errorMessage" class="uk-alert uk-alert-danger" role="alert">{{errorMessage}}</div>
|
|
|
|
<div [style.display]="showLoading ? 'inline' : 'none'" class="uk-animation-fade uk-width-1-1" role="alert"><img class="uk-align-center loading-gif"></div>
|
|
|
|
<div class="uk-alert uk-alert-primary uk-margin-top-large">
|
|
|
|
<span class="uk-margin-small-right uk-icon" uk-icon="info"></span>
|
|
|
|
Create or edit help text
|
|
|
|
<div class="uk-text-small">
|
|
|
|
Select the page to be displayed, select position of the page
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<form *ngIf="!errorMessage && !showLoading" [formGroup]="myForm">
|
2018-01-24 16:45:12 +01:00
|
|
|
<div *ngIf="!pageId" class="form-group" [ngClass]="{'has-error':!myForm.controls.page.valid && myForm.controls.page.dirty}">
|
2017-09-22 12:26:08 +02:00
|
|
|
<label for="pageTag">Select Page</label>
|
|
|
|
<select formControlName="page" id="pageTag" class="form-control">
|
|
|
|
<option *ngFor="let page of availablePages" [value]="page._id">{{page.name}}</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
[Trunk | Admin]:
1. pages.component: Show link to add pageHelpContents only when at least one posiiton is enabled.
2. help-content.service:
Add 'pid' parameter in 'getDivIdsFull()' method to be able to get divIds that are enabled in a community.
Add 'with_positions' parameter in 'getPages()' method to be able to get pages that have at least one position or no positions enabled.
3. app.component: Hide '/classContents' route for communities (currently no divIds for communities).
4. div-help-content-form.component: Get divIds that are enabled for the community.
5. div-help-contents.component: When a page is pre-selected ('pageId' url param exists), check if page is enabled in the community, otherwise redirect.
6. edit-div-help-content.component & new-div-help-content.component:
Add 'getPage()' method, to get page (if disabled in community, redirect - if pageId is pre-selected) and show it in the page title.
7. edit-div-help-content.component: If there is no 'divContentId' url param, redirect
8. edit-page-help-content.component:
If there is no 'pageContentId' url param, redirect
Add 'getPage()' method, to get page (if disabled in community, redirect - if pageId is pre-selected or use pageHelpContent.page - if pageId != pageHelpContent.page, redirect) and show it in the p$
9. new-page-help-content.component: Add 'getPage()' method, to get page (if disabled in community, redirect - if pageId is pre-selected) and show it in the page title.
10. page-help-content-form.component: Do not perform a query to get page when it is pre-selected (new & edit do the query now) | Get pages with at least one posiiton enabled.
11. page-help-contents.component: When a page is pre-selected ('pageId' url param exists), check if page is enabled in the community, otherwise redirect | Get pages with at least one posiiton enabled.
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-admin-portal/trunk@56740 d315682c-612b-4755-9ff5-7f18f6832af3
2019-07-24 11:16:42 +02:00
|
|
|
<div *ngIf="myForm.controls.page.value" class="form-group" [ngClass]="{'has-error':!myForm.controls.placement.valid && myForm.controls.placement.dirty}">
|
2017-09-22 12:26:08 +02:00
|
|
|
<label for="placementTag">Select Placement</label>
|
|
|
|
<select formControlName="placement" id="placementTag" class="form-control">
|
2019-07-16 15:22:46 +02:00
|
|
|
<option *ngIf="placements.top" [value]="'top'">Top</option>
|
|
|
|
<option *ngIf="placements.left" [value]="'left'">Left</option>
|
|
|
|
<option *ngIf="placements.right" [value]="'right'">Right</option>
|
|
|
|
<option *ngIf="placements.bottom" [value]="'bottom'">Bottom</option>
|
2017-09-22 12:26:08 +02:00
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="form-group" [ngClass]="{'has-error':!myForm.controls.content.valid && myForm.controls.content.dirty}">
|
|
|
|
<label>Content</label>
|
|
|
|
<div>
|
2018-10-30 16:31:16 +01:00
|
|
|
<!-- [config]="{allowedContent: 'p(*); h; div; span'}"-->
|
|
|
|
<!-- [config]="{allowedContent: true,extraAllowedContent : '*(*)'}" -->
|
|
|
|
<!-- [config]="{allowedContent: true, disallowedContent:'script; *[on*]'}" -->
|
|
|
|
<!-- [config]="{ allowedContent: '{
|
|
|
|
elements: dtd,
|
|
|
|
attributes: true,
|
|
|
|
styles: true,
|
|
|
|
classes: true
|
|
|
|
}',
|
|
|
|
disallowedContent:'script; *[on*]'}" -->
|
2017-09-22 12:26:08 +02:00
|
|
|
<ckeditor
|
2020-08-14 11:49:53 +02:00
|
|
|
[readOnly]="false"
|
2017-09-22 12:26:08 +02:00
|
|
|
debounce="500"
|
|
|
|
formControlName="content"
|
2018-10-30 16:31:16 +01:00
|
|
|
[config]="{ extraAllowedContent: '* [uk-*](*) ; span', disallowedContent: 'script; *[on*]', removeButtons: 'Save,NewPage,DocProps,Preview,Print',
|
|
|
|
extraPlugins: 'divarea'}">
|
2017-09-22 12:26:08 +02:00
|
|
|
<!--id="contentTag"-->
|
|
|
|
<!--(ready)="onReady($event)"-->
|
|
|
|
<!--(focus)="onFocus($event)"-->
|
|
|
|
<!--[config]="{uiColor: '#99000'}"-->
|
|
|
|
<!--(blur)="onBlur($event)"-->
|
|
|
|
<!--(change)="onChange($event)"-->
|
|
|
|
</ckeditor>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!--<textarea class="form-control" formControlName="content" id="contentTag" placeholder="Content" rows="3"></textarea>-->
|
|
|
|
</div>
|
|
|
|
<div class="form-group" [ngClass]="{'has-error':!myForm.controls.order.valid && myForm.controls.order.dirty}">
|
|
|
|
<label for="orderTag">Order</label>
|
2019-07-16 15:22:46 +02:00
|
|
|
<input type="number" step="1" class="form-control" formControlName="order" id="orderTag" placeholder="Order (e.g. 2)">
|
2017-09-22 12:26:08 +02:00
|
|
|
</div>
|
2019-07-17 11:56:47 +02:00
|
|
|
<!--<div class="form-group">
|
2018-10-30 16:31:16 +01:00
|
|
|
<label>Help text before existing content</label>
|
2018-02-06 12:06:43 +01:00
|
|
|
<label class="checkbox">
|
2019-07-16 15:22:46 +02:00
|
|
|
<span class="uk-margin-small-right" style="font-weight: normal;">Before</span>
|
2018-02-06 12:06:43 +01:00
|
|
|
<input tabindex="0" type="checkbox" formControlName="isPriorTo">
|
|
|
|
</label>
|
2019-07-17 11:56:47 +02:00
|
|
|
</div>-->
|
2017-09-22 12:26:08 +02:00
|
|
|
<div class="form-group">
|
|
|
|
<label>Select Status</label>
|
|
|
|
<label class="checkbox">
|
2019-07-16 15:22:46 +02:00
|
|
|
<span class="uk-margin-small-right" style="font-weight: normal;">Active</span>
|
2017-09-22 12:26:08 +02:00
|
|
|
<input tabindex="0" type="checkbox" formControlName="isActive">
|
|
|
|
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
<input type="hidden" formControlName="_id">
|
|
|
|
</form>
|
|
|
|
<!--<pre>-->
|
|
|
|
<!--{{myForm.value | json}}-->
|
|
|
|
<!--{{myForm.valid}}-->
|
2018-01-04 16:56:22 +01:00
|
|
|
<!--</pre>-->
|