go-ssb-room/web/templates/admin/settings.tmpl

75 lines
3.4 KiB
Cheetah

{{ define "title" }}{{i18n "Settings"}}{{ end }}
{{ define "content" }}
<h1
class="text-3xl tracking-tight font-black text-black mt-2 mb-0"
>{{ i18n "Settings" }}</h1>
<div class="max-w-2xl">
<h2 class="text-xl tracking-tight font-bold text-black mt-2 mb-2">{{ i18n "PrivacyModesTitle" }}</h2>
<p class="mb-4">
{{ i18n "ExplanationPrivacyModes" }}
<a class="text-pink-600 underline" href="https://ssb-ngi-pointer.github.io/rooms2/#privacy-modes">{{ i18n "RoomsSpecification" }}</a>.
</p>
<h3 class="text-gray-400 text-sm font-bold mb-2">{{ i18n "SetPrivacyModeTitle" }}</h3>
<details class="mb-8 self-start max-w-sm" id="change-privacy">
<summary class="px-3 py-1 max-w-sm rounded shadow bg-white ring-1 ring-gray-300 hover:bg-gray-100 cursor-pointer">
{{ i18n .CurrentMode.String }}
</summary>
<div class="absolute max-w-sm z-10 bg-white mt-2 shadow-xl ring-1 ring-gray-200 rounded divide-y flex flex-col items-stretch overflow-hidden">
{{ range .PrivacyModes }}
{{ if ne . $.CurrentMode }}
<form
action="{{ urlTo "admin:settings:set-privacy" }}"
method="POST"
>
{{ $.csrfField }}
<input type="hidden" name="privacy_mode" value="{{.}}">
<input
type="submit"
value="{{ i18n .String }}"
class="pl-10 pr-3 py-2 w-full text-left bg-white text-gray-700 hover:text-gray-900 hover:bg-gray-50 cursor-pointer"
/>
</form>
{{ else }}
<div class="pr-3 py-2 text-gray-600 flex flex-row items-center cursor-default">
<div class="w-10 flex flex-row items-center justify-center">
<svg class="w-4 h-4" viewBox="0 0 24 24">
<path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" />
</svg>
</div>
<span>{{ i18n .String }}</span>
</div>
{{end}}
{{end}}
</div>
</details>
<div class="grid max-w-lg grid-cols-3 gap-y-2 mb-8">
<div class="text-xl text-gray-500 font-bold">{{ i18n "ModeOpen" }}</div>
<div class="text-md col-span-2 italic">{{ i18n "ExplanationOpen" }}</div>
<div class="text-xl text-gray-500 font-bold">{{ i18n "ModeCommunity" }}</div>
<div class="text-md col-span-2 italic">{{ i18n "ExplanationCommunity" }}</div>
<div class="text-xl text-gray-500 font-bold">{{ i18n "ModeRestricted" }}</div>
<div class="text-md col-span-2 italic">{{ i18n "ExplanationRestricted" }}</div>
</div>
</div>
<div class="max-w-2xl">
<h2 class="text-xl tracking-tight font-bold text-black mt-2 mb-2">{{ i18n "DefaultLanguageTitle" }}</h2>
<p class="mb-4">
{{ i18n "ExplanationDefaultLanguage" }}
</p>
<h3 class="text-gray-400 text-sm font-bold mb-2">{{ i18n "SetDefaultLanguageTitle" }}</h3>
<details class="mb-8 self-start max-w-sm">
<summary id="language-summary" class="px-3 py-1 max-w-sm rounded shadow bg-white ring-1 ring-gray-300 hover:bg-gray-100 cursor-pointer">
{{ $.CurrentLanguage }}
</summary>
<div class="mt-2 bg-gray bg-white px-3 rounded ring-1 ring-gray-300">
{{ $adminSetLanguageUrl := urlTo "admin:settings:set-language" }}
{{ list_languages $adminSetLanguageUrl "pl-10 pr-3 py-2 w-full text-left bg-white text-gray-700 hover:text-gray-900 hover:bg-gray-50 cursor-pointer" }}
</div>
</details>
</div>
</div>
{{end}}