Project

General

Profile

1
<form [formGroup]="myForm">
2
    <div class="form-group" [ngClass]="{'has-error':!myForm.controls.route.valid && myForm.controls.route.dirty}">
3
        <label for="pageRouteTag">*Page Route</label>
4
        <input type="text" class="form-control" formControlName="route" id="pageRouteTag" placeholder="Page Route">
5
    </div>
6
    <div class="form-group" [ngClass]="{'has-error':!myForm.controls.name.valid && myForm.controls.name.dirty}">
7
        <label for="pageNameTag">*Page Name</label>
8
        <input type="text" class="form-control" formControlName="name" id="pageNameTag" placeholder="Page Name">
9
    </div>
10
    <div *ngIf="!type" class="form-group" [ngClass]="{'has-error':!myForm.controls.type.valid && myForm.controls.type.dirty}">
11
        <label for="typeTag">*Select Type</label>
12
        <select formControlName="type" id="typeTag" class="form-control">
13
            <option [value]="'search'">search</option>
14
            <option [value]="'link'">link</option>
15
            <option [value]="'share'">share</option>
16
            <option [value]="'landing'">landing</option>
17
            <option [value]="'html'">html</option>
18
            <option [value]="'other'">other</option>
19
        </select>
20
    </div>
21

    
22
    <div formArrayName="entities" class="form-group">
23
        <label for="entityNameTag">Entity Name</label>
24
        <div id="entityNameTag">
25
          <pre class="card card-block card-header"><span *ngFor="let entity of myForm.value.entities; let i=index">{{entity.name}}<span *ngIf="i<(myForm.value.entities.length-1)">, </span></span></pre>
26

    
27
          <button type="button" (click)="toggle()">Add / Remove entities</button>
28

    
29
          <ng-container *ngIf="!myForm.value.isCollapsed">
30
            <div *ngIf="errorMessage" class="uk-alert uk-alert-danger" role="alert">{{errorMessage}}</div>
31
            <div [style.display]="showLoading ? 'inline' : 'none'" class="uk-animation-fade uk-width-1-1" role="alert"><img class="uk-align-center loading-gif"></div>
32

    
33
            <div *ngFor="let entity of getKeys(allEntities)">
34
              <span>
35
                <span *ngIf="allEntities.get(entity)" class="activated" >
36
                    <input (click)="toggleEntity(false,[entity._id], entity)" class="deactivate" src="assets/imgs/delete-icon.png" title="Disable" width="20" type="image" height="20">
37
                </span>
38
                <span *ngIf="!allEntities.get(entity)" class="deactivated" >
39
                    <input (click)="toggleEntity(true,[entity._id], entity)" class="deactivate" src="assets/imgs/add-icon.png" title="Enable" width="20" type="image" height="20">
40
                </span>
41
                {{entity.name}}
42
              </span>
43
            </div>
44
          </ng-container>
45
        </div>
46
    </div>
47

    
48
    <div class="form-group" uk-grid>
49
      <label class="uk-width-1-1 uk-margin-small-bottom">
50
        Select positions of help contents for this page.
51
      </label>
52
      <label class="uk-text-danger uk-margin-small-bottom">
53
        By disabling a position, all contents in this position will be deleted.
54
      </label>
55
      <label class="uk-width-1-4 checkbox">
56
        <span class="uk-margin-small-right" style="font-weight: normal;">Top</span>
57
        <input tabindex="0" type="checkbox" formControlName="top">
58
      </label>
59
      <label class="uk-width-1-4 checkbox">
60
        <span class="uk-margin-small-right" style="font-weight: normal;">Bottom</span>
61
        <input tabindex="0" type="checkbox" formControlName="bottom">
62
      </label>
63
      <label class="uk-width-1-4 checkbox">
64
        <span class="uk-margin-small-right" style="font-weight: normal;">Left</span>
65
        <input tabindex="0" type="checkbox" formControlName="left">
66
      </label>
67
      <label class="uk-width-1-4 checkbox">
68
        <span class="uk-margin-small-right" style="font-weight: normal;">Right</span>
69
        <input tabindex="0" type="checkbox" formControlName="right">
70
      </label>
71
    </div>
72

    
73
    <div [ngClass]="{'has-error':!myForm.controls.portalType.valid && myForm.controls.portalType.dirty}" class="form-group" uk-grid>
74
      <label class="uk-width-1-1 uk-margin-small-bottom">
75
        Page exists in:
76
      </label>
77
      <label class="uk-width-1-1 radio uk-margin-large-left">
78
        <span class="uk-margin-small-right" style="font-weight: normal;">OpenAIRE portal</span>
79
<!--        <input tabindex="0" type="checkbox" formControlName="openaire">-->
80
        <input type="radio" value="explore" formControlName="portalType">
81
      </label>
82
      <label class="uk-width-1-1 radio uk-margin-large-left">
83
        <span class="uk-margin-small-right" style="font-weight: normal;">OpenAIRE Connect portal</span>
84
<!--        <input tabindex="0" type="checkbox" formControlName="connect">-->
85
        <input type="radio" value="connect" formControlName="portalType">
86
      </label>
87
      <label class="uk-width-1-1 radio uk-margin-large-left">
88
        <span class="uk-margin-small-right" style="font-weight: normal;">Communities' Gateway</span>
89
<!--        <input tabindex="0" type="checkbox" formControlName="communities">-->
90
        <input type="radio" value="community" formControlName="portalType">
91
      </label>
92
    </div>
93

    
94
<!--    <div *ngIf="update" class="form-group uk-disabled" uk-grid>-->
95
<!--      <label class="uk-width-1-1 radio">-->
96
<!--        This page exists in:-->
97
<!--        <span class="uk-margin-small-left uk-text-bold">-->
98
<!--          <span *ngIf="myForm.value.portalType == 'explore'">OpenAIRE portal</span>-->
99
<!--          <span *ngIf="myForm.value.portalType == 'connect'">OpenAIRE Connect portal</span>-->
100
<!--          <span *ngIf="myForm.value.portalType == 'community'">Communities' Gateway</span>-->
101
<!--        </span>-->
102
<!--      </label>-->
103
<!--    </div>-->
104

    
105
    <input type="hidden" formControlName="_id">
106
</form>
(1-1/6)