go-ssb-room/web/templates/base.tmpl

129 lines
4.9 KiB
Cheetah

<!--
SPDX-FileCopyrightText: 2021 The NGI Pointer Secure-Scuttlebutt Team of 2020/2021
SPDX-License-Identifier: CC-BY-4.0
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="/assets/fixfouc.css" rel="stylesheet">
<link href="/assets/style.css" rel="stylesheet">
<title>{{block "title" .}}Go-SSB Room Server{{end}}</title>
<!-- generated using https://favicon.io/favicon-converter -->
<link rel="apple-touch-icon" sizes="180x180" href="/assets/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon/favicon-16x16.png">
<link rel="manifest" href="/assets/favicon/site.webmanifest">
</head>
<body class="bg-gray-100 overflow-y-scroll">
<div class="sm:mx-auto sm:container">
<div class="flex flex-row justify-end space-x-4 my-4">
{{$user := is_logged_in}}
{{if $user}}
<div class="ml-4 flex-1 sm:hidden flex flex-row items-center">
{{if current_page_is "admin:menu"}}
<svg class="w-6 h-6 text-gray-200" viewBox="0 0 24 24">
<path fill="currentColor" d="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z" />
</svg>
{{else}}
<a href="{{urlTo "admin:menu"}}">
<svg class="w-6 h-6 text-gray-700" viewBox="0 0 24 24">
<path fill="currentColor" d="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z" />
</svg>
</a>
{{end}}
</div>
<span class="flex flex-row items-center divide-x divide-gray-300">
<div class="flex flex-row items-center pr-3">
<div class="text-green-500">
<a id="own-details-page" href="{{urlTo "admin:member:details" "id" $user.ID}}">
<svg class="text-green-500 w-4 h-4 mr-1 float-left" viewBox="0 0 24 24">
<path fill="currentColor" d="M22,18V22H18V19H15V16H12L9.74,13.74C9.19,13.91 8.61,14 8,14A6,6 0 0,1 2,8A6,6 0 0,1 8,2A6,6 0 0,1 14,8C14,8.61 13.91,9.19 13.74,9.74L22,18M7,5A2,2 0 0,0 5,7A2,2 0 0,0 7,9A2,2 0 0,0 9,7A2,2 0 0,0 7,5Z" />
</svg><div class="float-right text-sm truncate w-32">{{$user.PubKey.String}}</div>
</a>
</div>
</div>
<a
href="{{urlTo "auth:logout"}}"
class="pl-3 pr-4 py-2 sm:py-1 font-semibold text-sm text-gray-500 hover:text-red-600"
>{{i18n "AuthSignOut"}}</a>
</span>
{{else}}
<span class="divide-x divide-gray-300">
{{if privacy_mode_is "ModeOpen"}}
<a
href="{{urlTo "open:invites:create"}}"
class="pl-3 pr-4 py-2 sm:py-1 font-semibold text-sm text-gray-500 hover:text-green-500"
>{{i18n "AdminInvitesCreate"}}</a>
{{end}}
<a
href="{{urlTo "auth:login"}}"
class="pl-3 pr-4 py-2 sm:py-1 font-semibold text-sm text-gray-500 hover:text-green-500"
>{{i18n "AuthSignIn"}}</a>
</span>
{{end}}
</div>
{{block "extra" .}}{{end}}
{{block "main" .}}
<div class="flex flex-row items-start">
{{$user := is_logged_in}}
{{if $user}}
<div class="hidden sm:block">
{{template "menu" .}}
</div>
{{end}}
<div class="flex flex-col bg-gray-50 rounded-2xl py-4 px-4 sm:px-8 shadow-xl mb-16 flex-1 max-w-full">
{{ block "content" . }}{{end}}
</div>
</div>
{{end}}
{{block "footer" .}}
{{$cocUrl := urlToNotice "NoticeCodeOfConduct"}}
{{$ppUrl := urlToNotice "NoticePrivacyPolicy"}}
{{$setLanguageUrl := urlTo "complete:set-language"}}
<footer class="grid auto-rows-min mb-12">
<div class="mb-4 flex flex-row items-center justify-center divide-x divide-gray-300">
<a
href="{{urlTo "complete:index"}}"
class="px-4 text-gray-500 hover:underline"
>{{i18n "NavAdminLanding"}}</a>
{{if $cocUrl}}
<a
href="{{$cocUrl}}"
class="px-4 text-gray-500 hover:underline"
>{{i18n "NoticeCodeOfConduct"}}</a>
{{end}}
{{if $ppUrl}}
<a
href="{{$ppUrl}}"
class="px-4 text-gray-500 hover:underline"
>{{i18n "NoticePrivacyPolicy"}}</a>
{{end}}
</div>
<div class="flex justify-center">
{{ $languages := language_count }}
{{ if gt $languages 1 }}
<details class="w-72">
<summary
class="mb-2 mx-auto px-3 py-1 text-gray-500 w-32 rounded shadow bg-gray-50 ring-1 ring-gray-300 hover:bg-gray-100 cursor-pointer">
Language
</summary>
<div id="visitor-set-language" class="grid grid-cols-2 justify-items-center gap-x-1">
{{ list_languages $setLanguageUrl "text-gray-500 hover:underline cursor-pointer" }}
</div>
</details>
{{ end }}
</div>
</footer>
{{end}}
</div>
</body>
</html>