|
1 | 1 | @if (submissionCcLicenses) { |
2 | | - <div class="mb-4 ccLicense-select"> |
3 | | - <div ngbDropdown> |
4 | | - <input id="cc-license-dropdown" |
5 | | - class="form-control" |
6 | | - [(ngModel)]="selectedCcLicense.name" |
7 | | - placeholder="{{ !storedCcLicenseLink ? ('submission.sections.ccLicense.select' | translate) : ('submission.sections.ccLicense.change' | translate)}}" |
8 | | - [ngModelOptions]="{standalone: true}" |
9 | | - ngbDropdownToggle |
10 | | - role="combobox" |
11 | | - #script="ngModel"> |
12 | | - <div ngbDropdownMenu aria-labelledby="cc-license-dropdown" class="w-100 scrollable-menu" |
13 | | - role="menu" |
14 | | - infiniteScroll |
15 | | - (scroll)="onScroll($event)" |
16 | | - [infiniteScrollDistance]="5" |
17 | | - [infiniteScrollThrottle]="300" |
18 | | - [infiniteScrollUpDistance]="1.5" |
19 | | - [fromRoot]="true" |
20 | | - [scrollWindow]="false"> |
21 | | - |
22 | | - @if(submissionCcLicenses?.length === 0) { |
23 | | - <button class="dropdown-item disabled"> |
24 | | - {{ 'submission.sections.ccLicense.none' | translate }} |
25 | | - </button> |
26 | | - } @else { |
27 | | - @for(license of submissionCcLicenses; track license.id) { |
28 | | - <button class="dropdown-item" (click)="selectCcLicense(license)"> |
29 | | - {{ license.name }} |
30 | | - </button> |
31 | | - } |
32 | | - } |
33 | | - </div> |
34 | | - </div> |
35 | | - </div> |
| 2 | +<div class="mb-4 ccLicense-select"> |
| 3 | + <p [dsMarkdown]="'submission.sections.ccLicense.info' | translate "></p> |
| 4 | + <ds-select [disabled]="!submissionCcLicenses"> |
| 5 | + <ng-container class="selection"> |
| 6 | + <span *ngIf="getSelectedCcLicense()"> |
| 7 | + {{ getSelectedCcLicense().name }} |
| 8 | + </span> |
| 9 | + <span *ngIf="submissionCcLicenses && !getSelectedCcLicense()"> |
| 10 | + <ng-container *ngIf="storedCcLicenseLink"> |
| 11 | + {{ 'submission.sections.ccLicense.change' | translate }} |
| 12 | + </ng-container> |
| 13 | + <ng-container *ngIf="!storedCcLicenseLink"> |
| 14 | + {{ 'submission.sections.ccLicense.select' | translate }} |
| 15 | + </ng-container> |
| 16 | + </span> |
| 17 | + </ng-container> |
| 18 | + <ng-container class="menu"> |
| 19 | + <button *ngIf="submissionCcLicenses?.length == 0" |
| 20 | + class="dropdown-item disabled"> |
| 21 | + {{ 'submission.sections.ccLicense.none' | translate }} |
| 22 | + </button> |
| 23 | + <button *ngFor="let license of submissionCcLicenses" |
| 24 | + class="dropdown-item" |
| 25 | + (click)="selectCcLicense(license)"> |
| 26 | + {{ license.name }} |
| 27 | + </button> |
| 28 | + </ng-container> |
| 29 | + </ds-select> |
| 30 | +</div> |
36 | 31 | } |
37 | 32 |
|
38 | | -@if (getSelectedCcLicense()) { |
39 | | - @for (field of getSelectedCcLicense().fields; track field) { |
40 | | - <div |
41 | | - class="mb-4"> |
| 33 | +<ng-container *ngIf="getSelectedCcLicense()"> |
| 34 | + <div class="form-control" style="height: auto"> |
| 35 | + <div *ngFor="let field of getSelectedCcLicense().fields" class="m-0"> |
| 36 | + |
42 | 37 | <div class="d-flex flex-row"> |
43 | | - <div class="fw-bold {{ field.id }}"> |
44 | | - {{ field.label }} |
| 38 | + <div class="font-weight-bold {{ field.id }}">{{ field.label }} |
| 39 | + <button class="btn btn-outline-info btn-sm ml-2 mb-1" (click)="openInfoModal(infoModal)"> |
| 40 | + <i class="fas fa-question"></i> |
| 41 | + </button> |
45 | 42 | </div> |
46 | | - <button |
47 | | - class="btn btn-outline-info btn-sm ms-2" |
48 | | - (click)="openInfoModal(infoModal)"> |
49 | | - <i class="fas fa-question"></i> |
50 | | - </button> |
51 | 43 | </div> |
| 44 | + |
52 | 45 | <ng-template #infoModal> |
53 | 46 | <div> |
54 | 47 | <div class="modal-header mb-4 "> |
55 | 48 | <div> |
56 | | - <h4> |
57 | | - {{ field.label }} |
58 | | - </h4> |
| 49 | + <h4>{{ field.label }}</h4> |
59 | 50 | <div [innerHTML]="field.description"></div> |
60 | 51 | </div> |
61 | | - <button type="button" class="btn-close" |
62 | | - (click)="closeInfoModal()" aria-label="Close"> |
| 52 | + <button type="button" class="close mb-1" (click)="closeInfoModal()" aria-label="Close"> |
| 53 | + <span aria-hidden="true">×</span> |
63 | 54 | </button> |
64 | 55 | </div> |
65 | 56 | <div class="modal-body"> |
66 | | - @for (value of field.enums; track value) { |
67 | | - <div |
68 | | - class="mb-4"> |
69 | | - <h5> |
70 | | - {{ value.label }} |
71 | | - </h5> |
72 | | - <div [innerHTML]="value.description" class="fw-light"></div> |
73 | | - </div> |
74 | | - } |
| 57 | + <div *ngFor="let value of field.enums" class="mb-4"> |
| 58 | + <h5>{{ value.label }}</h5> |
| 59 | + <div [innerHTML]="value.description" class="font-weight-light"></div> |
| 60 | + </div> |
75 | 61 | </div> |
76 | 62 | </div> |
77 | 63 | </ng-template> |
78 | | - @if (field.enums?.length > 5) { |
79 | | - <ds-select [disabled]="field.id === 'jurisdiction' && defaultJurisdiction !== undefined && defaultJurisdiction !== 'none'"> |
80 | | - <ng-container class="selection" *ngVar="getSelectedOption(getSelectedCcLicense(), field) as option"> |
81 | | - @if (option) { |
82 | | - <span> |
83 | | - {{ option.label }} |
| 64 | + |
| 65 | + <ds-select *ngIf="field.enums && field.enums?.length > 5" [disabled]="field.id === 'jurisdiction' && defaultJurisdiction !== undefined && defaultJurisdiction !== 'none'"> |
| 66 | + <ng-container class="selection" *ngVar="getSelectedOption(getSelectedCcLicense(), field) as option"> |
| 67 | + <span *ngIf="option">{{ option.label }}</span> |
| 68 | + <span *ngIf="!option">{{ 'submission.sections.ccLicense.option.select' | translate }}</span> |
| 69 | + </ng-container> |
| 70 | + <ng-container class="menu"> |
| 71 | + <div class="options-select-menu overflow-auto"> |
| 72 | + <button *ngFor="let option of field.enums" class="dropdown-item" (click)="selectOption(getSelectedCcLicense(), field, option)"> |
| 73 | + {{ option.label }} |
| 74 | + </button> |
| 75 | + </div> |
| 76 | + </ng-container> |
| 77 | + </ds-select> |
| 78 | + |
| 79 | + <ng-container *ngIf="field.enums && field.enums?.length <= 5"> |
| 80 | + <div *ngFor="let option of field.enums" class="d-flex flex-row ml-3"> |
| 81 | + <div (click)="selectOption(getSelectedCcLicense(), field, option)"> |
| 82 | + <input type="radio" title="{{ option.label }}" class="mr-1" [checked]="isSelectedOption(getSelectedCcLicense(), field, option)"> |
| 83 | + <span>{{ option.label }}</span> |
| 84 | + </div> |
| 85 | + </div> |
| 86 | + </ng-container> |
| 87 | + |
| 88 | + <ng-container *ngIf="field.type && field.type === 'textarea'"> |
| 89 | + <div role="group" class="form-row" style="width: 100%;"> |
| 90 | + <div class="col-sm-12 d-flex flex-column justify-content-start"> |
| 91 | + <textarea [(ngModel)]="data.ccLicense.fields['dc_rights']" (blur)="updateInput(getSelectedCcLicense(), field)" class="form-control" cols="20" |
| 92 | + id="{{ field.id }}" name="{{ field.id }}" rows="2" spellcheck="true" wrap="undefined"></textarea> |
| 93 | + <small class="text-muted ds-hint">{{ field.description }}</small> |
| 94 | + </div> |
| 95 | + </div> |
| 96 | + </ng-container> |
| 97 | + |
| 98 | + <ng-container *ngIf="field.type && field.type === 'input'"> |
| 99 | + <div role="group" class="form-row" style="width: 100%;"> |
| 100 | + <div class="col-sm-12 d-flex flex-column justify-content-start"> |
| 101 | + <input [(ngModel)]="data.ccLicense.fields['dc_rights_uri']" (blur)="updateInput(getSelectedCcLicense(), field)" class="form-control" id="{{ field.id }}" |
| 102 | + name="{{ field.id }}" spellcheck="false" type="text"> |
| 103 | + <small class="text-muted ds-hint ng-star-inserted">{{ field.description }}</small> |
| 104 | + </div> |
| 105 | + </div> |
| 106 | + </ng-container> |
| 107 | + </div> |
| 108 | + |
| 109 | + <ng-container *ngVar="getCcLicenseLink$() | async as licenseLink"> |
| 110 | + <div class="mt-2 p-2 text-dark alert-info"> |
| 111 | + <div *ngIf="licenseLink && licenseLink!='All Rights Reserved' && licenseLink!='http://creativecommons.org/publicdomain/zero/1.0/'"> |
| 112 | + {{ 'submission.sections.ccLicense.selected' | translate }} |
| 113 | + <a class="license-link" href="{{ licenseLink }}" target="_blank" rel="noopener noreferrer">{{ licenseMap[licenseLink] }}</a>. |
| 114 | + <p>{{ 'submission.sections.ccLicense.link2' | translate }}</p> |
| 115 | + </div> |
| 116 | + <div *ngIf="licenseLink && licenseLink=='http://creativecommons.org/publicdomain/zero/1.0/'"> |
| 117 | + <p [dsMarkdown]="'submission.sections.ccLicense.publicdomain' | translate"></p> |
| 118 | + </div> |
| 119 | + <div class="m-2"> |
| 120 | + <div (click)="setAccepted(!accepted)"> |
| 121 | + <input type="checkbox" class="mr-2" title="accepted"> |
| 122 | + <span *ngIf="licenseLink=='All Rights Reserved'; else other_content"> |
| 123 | + {{ 'submission.sections.ccLicense.copyrighted' | translate }} |
| 124 | + </span> |
| 125 | + <ng-template #other_content> |
| 126 | + <span *ngIf="licenseLink!='http://creativecommons.org/publicdomain/zero/1.0/'; else zero_content"> |
| 127 | + {{ 'submission.sections.ccLicense.confirmation' | translate }} |
84 | 128 | </span> |
85 | | - } |
86 | | - @if (!option) { |
| 129 | + </ng-template> |
| 130 | + <ng-template #zero_content> |
87 | 131 | <span> |
88 | | - {{ 'submission.sections.ccLicense.option.select' | translate }} |
| 132 | + {{ 'submission.sections.ccLicense.cczero' | translate }} |
89 | 133 | </span> |
90 | | - } |
91 | | - </ng-container> |
92 | | - <ng-container class="menu"> |
93 | | - <div class="options-select-menu overflow-auto"> |
94 | | - @for (option of field.enums; track option) { |
95 | | - <button |
96 | | - class="dropdown-item" |
97 | | - (click)="selectOption(getSelectedCcLicense(), field, option)"> |
98 | | - {{ option.label }} |
99 | | - </button> |
100 | | - } |
101 | | - </div> |
102 | | - </ng-container> |
103 | | - </ds-select> |
104 | | - } |
105 | | - @if (field.enums?.length <= 5) { |
106 | | - @for (option of field.enums; track option) { |
107 | | - <div |
108 | | - class="d-flex flex-row m-1"> |
109 | | - <div (click)="selectOption(getSelectedCcLicense(), field, option)"> |
110 | | - <input type="radio" |
111 | | - title="{{ option.label }}" |
112 | | - class="me-1" |
113 | | - [checked]="isSelectedOption(getSelectedCcLicense(), field, option)"> |
114 | | - <span>{{ option.label }}</span> |
115 | | - </div> |
| 134 | + </ng-template> |
116 | 135 | </div> |
117 | | - } |
118 | | - } |
119 | | - </div> |
120 | | - } |
121 | | -} |
122 | | - |
123 | | -@if (ccLicenseLink$) { |
124 | | - @let licenseLink = (ccLicenseLink$ | async); |
125 | | - @if (licenseLink) { |
126 | | - <div |
127 | | - class="mt-2 p-4 bg-light text-dark"> |
128 | | - <div> |
129 | | - {{ 'submission.sections.ccLicense.link' | translate }} |
130 | | - </div> |
131 | | - <a class="license-link" href="{{ licenseLink }}" target="_blank" rel="noopener noreferrer"> |
132 | | - {{ licenseLink }} |
133 | | - </a> |
134 | | - <div class="m-2"> |
135 | | - <div (click)="setAccepted(!accepted)"> |
136 | | - <input type="checkbox" |
137 | | - class="me-2" |
138 | | - title="accepted" |
139 | | - [checked]="accepted"> |
140 | | - <span> {{ 'submission.sections.ccLicense.confirmation' | translate }}</span> |
141 | 136 | </div> |
142 | 137 | </div> |
143 | | - </div> |
144 | | - } @else { |
145 | | - <ds-loading></ds-loading> |
146 | | - } |
147 | | -} |
| 138 | + </ng-container> |
| 139 | + </div> |
| 140 | +</ng-container> |
| 141 | + |
| 142 | +<p class="small mb-0 mt-3">{{ 'submission.sections.ccLicense.attribution' | translate }}, <a href="http://creativecommons.org" target="_blank">creativecommons.org</a></p> |
0 commit comments