Skip to content

Commit

Permalink
feat(octra): add urls to imprint, privacy and TOS to about modal if a…
Browse files Browse the repository at this point in the history
…vailable
  • Loading branch information
julianpoemp committed Aug 16, 2024
1 parent ee01e9a commit d47089f
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ <h4 class="modal-title">About OCTRA
></button>
</div>
<div class="modal-body">

<h5 class="mt-1 pt-0">
Affiliations
</h5>
Expand Down Expand Up @@ -84,6 +83,15 @@ <h5>
</tr>
</tbody>
</table>

<ng-container>
<h5>{{"g.legals" | transloco}}</h5>
<ul>
<li *ngFor="let legal of legals">
<a [href]="legal.url" target="_blank">{{"g." + legal.label | transloco}}</a>
</li>
</ul>
</ng-container>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal" (click)="close()">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#export-table td {
cursor: pointer;
}

#export-table a {
cursor: pointer;
}

progressbar {
height: 20px;
}

h5 {
margin-top: 40px;
margin-bottom: 10px;
Expand All @@ -20,14 +8,3 @@ h5 {
margin-bottom: 20px;
display: inline-block;
}

.language {
font-size: 1.1rem;
font-weight: 400;
}

.translators {
font-size: 0.85rem;
}


Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { AppInfo } from '../../../app.info';
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
import { NgbActiveModal, NgbModalOptions } from '@ng-bootstrap/ng-bootstrap';
import { OctraModal } from '../types';
import { OctraAPIService } from '@octra/ngx-octra-api';

@Component({
selector: 'octra-about-modal',
Expand All @@ -17,6 +18,11 @@ export class AboutModalComponent extends OctraModal implements OnDestroy {
backdrop: true,
};
public visible = false;
legalsExist = false;
legals: {
label: string;
url: string;
}[] = [];

@ViewChild('modal', { static: true }) modal: any;
@ViewChild('content', { static: false }) contentElement?: ElementRef;
Expand All @@ -32,10 +38,37 @@ export class AboutModalComponent extends OctraModal implements OnDestroy {

constructor(
private sanitizer: DomSanitizer,
private api: OctraAPIService,
protected override activeModal: NgbActiveModal
) {
super('octraModal', activeModal);

this.legalsExist =
this.api.appProperties?.legals.imprint_url !== undefined &&
this.api.appProperties?.legals.privacy_url !== undefined &&
this.api.appProperties?.legals.tos_url !== undefined;

if (this.api.appProperties?.legals?.imprint_url) {
this.legals.push({
label: 'imprint',
url: this.api.appProperties?.legals?.imprint_url,
});
}

if (this.api.appProperties?.legals?.privacy_url) {
this.legals.push({
label: 'privacy',
url: this.api.appProperties?.legals?.privacy_url,
});
}

if (this.api.appProperties?.legals?.tos_url) {
this.legals.push({
label: 'terms and conditions',
url: this.api.appProperties?.legals?.tos_url,
});
}

const bibtex = new File(
[
`@INPROCEEDINGS{peomp2017octra
Expand Down
26 changes: 13 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
"@ngrx/store": "18.0.1",
"@ngrx/store-devtools": "18.0.1",
"@nx/angular": "19.5.3",
"@octra/api-types": "^0.1.4",
"@octra/ngx-octra-api": "^0.1.5",
"@octra/api-types": "^0.2.0",
"@octra/ngx-octra-api": "^0.2.0",
"@popperjs/core": "^2.11.6",
"@swc/helpers": "0.5.11",
"ajv": "^8.16.0",
Expand All @@ -99,7 +99,7 @@
"luxon": "^3.4.4",
"modernizr": "^3.13.0",
"ngrx-wieder": "^12.0.0",
"ngx-jodit": "^3.1.2",
"ngx-jodit": "^3.1.3",
"ngx-webstorage": "^18.0.0",
"node-ssh": "^13.2.0",
"platform": "^1.3.6",
Expand Down

0 comments on commit d47089f

Please sign in to comment.