Skip to content

Commit

Permalink
Pridani informace o neverejnem dokumentu do panelu s metadaty s prokl…
Browse files Browse the repository at this point in the history
…ikem do dialogu s vysvetlujicim textem
  • Loading branch information
honza-rychtar committed Feb 11, 2020
1 parent 885ec3c commit 6953f45
Show file tree
Hide file tree
Showing 10 changed files with 129 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ import { IiifService } from './services/iiif.service';
import { ZoomifyService } from './services/zoomify.service';
import { LoggerService } from './services/logger.service';
import { DialogAdvancedSearchComponent } from './dialog/dialog-advanced-search/dialog-advanced-search.component';
import { DialogPolicyComponent } from './dialog/dialog-policy/dialog-policy.component';


export function hljsLanguages() {
Expand Down Expand Up @@ -229,7 +230,8 @@ export function hljsLanguages() {
DialogAdminMetadataComponent,
MapBrowseComponent,
PresentationComponent,
DialogAdvancedSearchComponent
DialogAdvancedSearchComponent,
DialogPolicyComponent
],
entryComponents: [
DialogOcrComponent,
Expand All @@ -240,7 +242,8 @@ export function hljsLanguages() {
DialogAuthosComponent,
DialogPdfGeneratorComponent,
DialogAdminMetadataComponent,
DialogAdvancedSearchComponent
DialogAdvancedSearchComponent,
DialogPolicyComponent
],
imports: [
BrowserModule,
Expand Down
16 changes: 16 additions & 0 deletions src/app/dialog/dialog-policy/dialog-policy.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<mz-modal #modal [fixedFooter]="false" class="app-dialog-policy">
<mz-modal-content>
<mz-input-container>
<div *ngIf="!appSettings.customRightMessage" class="app-text">
{{ 'alert.inaccessible_document_description' | translate }}
</div>
<div *ngIf="appSettings.customRightMessage" class="app-html"
[innerHTML]="(krameriusInfo.data$ | async).rightMsg">
</div>
</mz-input-container>

</mz-modal-content>
<mz-modal-footer>
<button mz-button [flat]="true" mz-modal-close>{{ 'common.close' | translate }}</button>
</mz-modal-footer>
</mz-modal>
24 changes: 24 additions & 0 deletions src/app/dialog/dialog-policy/dialog-policy.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Component, OnInit, Input } from '@angular/core';
import { MzBaseModal } from 'ngx-materialize';
import { AppSettings } from '../../services/app-settings';
import { KrameriusInfoService } from '../../services/kramerius-info.service';

@Component({
selector: 'app-dialog-policy',
templateUrl: './dialog-policy.component.html'
})
export class DialogPolicyComponent extends MzBaseModal implements OnInit {
@Input() type: string;

constructor(
public krameriusInfo: KrameriusInfoService,
public appSettings: AppSettings) {
super();
}

ngOnInit(): void {
}



}
5 changes: 5 additions & 0 deletions src/app/metadata/metadata.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ <h5 [class.app-cut]="metadata.getTitle().length > 75 && showingTitle == false">

</ng-container>

<div *ngIf="!metadata.isPublic" class="app-policy">
<i mz-icon-mdi [icon]="'lock'" [size]="'18px'" [class]="'app-lock'"></i>
<span class="app-message">{{ 'metadata.policy_private' | translate }} (<span><i (click)="showPolicyPrivateDialog()" mz-icon-mdi [icon]="'help'" class="app-help" [size]="'15px'"></i></span>)</span>
<div class="divider"></div>
</div>

<div *ngIf="metadata.getPrimaryAuthors().length > 0">
<label>{{ 'metadata.author' | translate }}</label>
Expand Down
5 changes: 5 additions & 0 deletions src/app/metadata/metadata.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { MzModalService } from 'ngx-materialize';
import { AnalyticsService } from '../services/analytics.service';
import { DialogShareComponent } from '../dialog/dialog-share/dialog-share.component';
import { DialogAdminMetadataComponent } from '../dialog/dialog-admin-metadata/dialog-admin-metadata.component';
import { DialogPolicyComponent } from '../dialog/dialog-policy/dialog-policy.component';

@Component({
selector: 'app-metadata',
Expand Down Expand Up @@ -43,6 +44,10 @@ export class MetadataComponent implements OnInit {
this.modalService.open(DialogAuthosComponent, { authors: this.metadata.authors} );
}

showPolicyPrivateDialog() {
this.modalService.open(DialogPolicyComponent, { type: 'private' } );
}

showCitation() {
this.analytics.sendEvent('metadata', 'citation');
this.modalService.open(DialogCitationComponent, { metadata: this.metadata });
Expand Down
4 changes: 3 additions & 1 deletion src/assets/i18n/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@
"btn_show_metadata": "Zobrazit metadata",
"btn_hide_metadata": "Skrýt metadata",
"authors_info": "Více o autorech",
"donator": "S podporou"
"donator": "S podporou",
"policy_private": "Dokument není veřejně přístupný",
"policy_dnnt": "Dílo nedostupné na trhu"
},
"donator": {
"norway": {
Expand Down
4 changes: 3 additions & 1 deletion src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@
"btn_show_metadata": "Show metadata",
"btn_hide_metadata": "Hide metadata",
"authors_info": "More about authors",
"donator": "Supported by"
"donator": "Supported by",
"policy_private": "Not publicly accessible document",
"policy_dnnt": "Dílo nedostupné na trhu"
},
"donator": {
"norway": {
Expand Down
1 change: 1 addition & 0 deletions src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@
@import "styles/app-dialog-advanced-search";
@import "styles/app-dialog-authors";
@import "styles/app-dialog-sheetmusic-warning";
@import "styles/app-dialog-policy";
@import "styles/app-page-not-found";
@import "styles/app-login";
51 changes: 51 additions & 0 deletions src/styles/_app-dialog-policy.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
mz-modal.app-dialog-policy {
.modal {
max-width: 800px;
.modal-content {
padding-bottom: 0;
}
}
.app-text {
padding: 10px 20px;
text-align: left;
color: #444;
margin: 10px auto 0;
max-width: 800px;
}
mz-modal-content {
.app-html {
padding: 10px 20px;
overflow: auto;
text-align: left;
color: #444;
margin: 10px auto 0;
max-width: 800px;
h1,h2,h3,h4,h5 {
line-height: 120%;
color: #444;
font-weight: 400;
text-align: left;
}
h1: {
text-align: center;
}
h1, h2, h3 {
font-size: 24px;
}
h4 {
font-size: 22px;
}
h5 {
font-size: 20px;
}
b, strong {
font-weight: 600;
}
ul {
padding-left: 0;
list-style-type: none;
margin-top: 5px;
}
}
}
}
16 changes: 16 additions & 0 deletions src/styles/_app-metadata.scss
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,22 @@ app-metadata {
font-size: 15px;
color: $app-grey-d-2;
}
.app-policy {
.app-lock {
color: $app-grey-d-2;
margin-right: 4px;
&.app-dnnt {
color: $app-dnnt;
}
}
.app-message {
color: $app-grey-d-2;
}
.app-help {
color: $primary-color;
cursor: pointer;
}
}
}
}

Expand Down

0 comments on commit 6953f45

Please sign in to comment.