Skip to content
Snippets Groups Projects
dbp-signature.html.ejs 4.09 KiB
<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- Favicons -->
    <link rel="shortcut icon" type="image/x-icon" href="<%= getPrivateUrl('favicon.ico') %>">
    <link rel="icon" type="image/svg+xml" href="<%= getPrivateUrl('favicon.svg') %>" sizes="any">

    <!-- PWA manfiest file -->
    <link rel="manifest" href="<%= getUrl(name + '.manifest.json') %>">

    <!-- PWA iphone -->
    <link rel="apple-touch-icon" sizes="180x180" href="<%= getPrivateUrl('icon-180x180.png') %>">
    <link rel="icon" type="image/png" sizes="32x32" href="<%= getPrivateUrl('icon-32x32.png') %>">
    <link rel="icon" type="image/png" sizes="16x16" href="<%= getPrivateUrl('icon-16x16.png') %>">

    <!-- Loading spinner -->
    <script type="module">
        import {Spinner} from '<%= getPrivateUrl('spinner.js') %>';
        customElements.define('dbp-loading-spinner', Spinner);
    </script>

    <!-- App bundles-->
    <script type="module" src="<%= getUrl(name + '.js') %>"></script>

    <!-- Prevent Chrome/Edge from suggesting to translate the page -->
    <meta name="google" content="notranslate">

    <!-- Font related CSS -->
    <style>
        @import "<%= getPrivateUrl('fonts/source-sans-pro/300.css') %>";
        @import "<%= getPrivateUrl('fonts/source-sans-pro/400.css') %>";
        @import "<%= getPrivateUrl('fonts/source-sans-pro/600.css') %>";

        body {
            font-family: 'Source Sans Pro', 'Calibri', 'Arial', 'sans-serif';
            font-weight: 300;
            margin: 0;
        }

        /* TU-Graz style override */
        html {
            --dbp-override-primary-bg-color: #245b78;
            --dbp-override-primary-button-border: solid 1px #245b78;
            --dbp-override-info-bg-color: #245b78;
            --dbp-override-danger-bg-color: #e4154b;
            --dbp-override-warning-bg-color: #ffe183;
            --dbp-override-warning-text-color: black;
            --dbp-override-success-bg-color: #259207;
            --dbp-override-downloaded-bg-color: #9fdf9f;
        }
    </style>

    <!-- Preloading/Preconnecting -->
    <link rel="preconnect" href="<%= entryPointURL %>">
    <link rel="preconnect" href="<%= keyCloakBaseURL %>">
</head>

<body>
<<%= name %>
    id="app"
    lang="de" entry-point-url="<%= entryPointURL %>"
    show-nextcloud-file-picker
    <%= buildInfo.env !== 'production' ? 'show-clipboard' : '' %>
    <%= buildInfo.env !== 'production' ? 'allow-annotating' : '' %>
    nextcloud-web-app-password-url="<%= nextcloudWebAppPasswordURL %>"
    nextcloud-webdav-url="<%= nextcloudWebDavURL %>"
    nextcloud-name="<%= nextcloudName %>"
    nextcloud-auth-info=""
    nextcloud-file-url="<%= nextcloudFileURL %>"
    initial-file-handling-state
    clipboard-files
    auth requested-login-status analytics-event
    src="<%= getUrl(name + '.topic.metadata.json') %>"
    base-path="<%= getUrl('') %>"
    keycloak-config='{"url": "<%= keyCloakBaseURL %>", "realm": "tugraz", "clientId": "<%= keyCloakClientId %>", "silentCheckSsoRedirectUri": "<%= getUrl('silent-check-sso.html') %>"}'
    matomo-url='<%= matomoUrl %>'
    matomo-site-id='<%= matomoSiteId %>'
    git-info='<%= buildInfo.info %>'
    build-url='<%= buildInfo.url %>'
    build-time='<%= buildInfo.time %>'
    env='<%= buildInfo.env %>'
><dbp-loading-spinner></dbp-loading-spinner></<%= name %>>

<!-- Error handling for too old browsers -->
<script src="<%= getPrivateUrl('browser-check.js') %>" defer></script>
<noscript>Diese Applikation benötigt Javascript / This application requires Javascript</noscript>
<script>
    const langTexts = {
        "de": {
            "nextcloud-auth-info": "<%= nextcloudAuthInfoDE %>",
        },
        "en": {
            "nextcloud-auth-info": "<%= nextcloudAuthInfoEN %>",
        },
    }

    window.addEventListener('dbp-lang', function (e) {
        const lang = e.detail;
        if (!lang) {
            return;
        }

        const app = document.getElementById("app");
        app.setAttribute("nextcloud-auth-info", langTexts[lang]["nextcloud-auth-info"]);
    });
</script>
</body>
</html>