go-ssb-room/web/templates/admin/invite-list.tmpl

117 lines
4.4 KiB
Cheetah

{{ define "title" }}{{i18n "AdminInvitesTitle"}}{{ end }}
{{ define "content" }}
<h1
class="text-3xl tracking-tight font-black text-black mt-2 mb-4"
>{{i18n "AdminInvitesTitle"}}</h1>
<p id="welcome" class="my-2">{{i18n "AdminInvitesWelcome"}}</p>
<table class="table-auto w-full self-stretch mt-4 mb-8">
<thead class="block sm:table-header-group">
<tr class="sm:h-12 sm:table-row flex flex-col items-stretch">
<td class="sm:w-3 sm:table-cell block" colspan="2">
<div
id="invite-list-count"
class="inline ml-0 rounded-full px-3 py-1 tracking-tight font-black text-white bg-gradient-to-r from-pink-400 to-red-400"
>{{i18npl "AdminInvitesCount" .Count}}</div>
</td>
<td class="sm:w-1/2 sm:pl-2 pr-0 sm:table-cell block sm:my-0 my-4" colspan="2">
<form
id="create-invite"
action="{{urlTo "admin:invites:create"}}"
method="POST"
>
{{ .csrfField }}
<div class="h-10 flex flex-row items-center rounded-full ring-2 ring-green-400 bg-white">
<input
type="text"
name="alias_suggestion"
placeholder="{{i18n "AdminInvitesAliasSuggestion"}}"
class="h-10 ml-4 w-1/2 truncate flex-auto tracking-wider text-gray-900 focus:outline-none placeholder-gray-300"
>
<input
type="submit"
value="{{i18n "GenericCreate"}}"
class="pl-4 pr-3 w-20 py-2 text-center text-green-500 hover:text-green-600 font-bold bg-transparent cursor-pointer"
>
</div>
</form>
</td>
</tr>
<tr class="hidden sm:table-row h-8 uppercase text-sm text-gray-400">
<th class="w-10 text-center pl-3 pr-6">{{i18n "AdminInvitesCreatedAtColumn"}}</th>
<th class="w-1/2 text-left px-6">{{i18n "AdminInvitesCreatorColumn"}}</th>
<th class="w-0"></th>
</tr>
</thead>
<tbody id="the-table-rows" class="divide-y">
{{range .Entries}}
<tr class="h-12 hidden sm:table-row">
<td class="pl-3 pr-6 text-gray-400 text-center">
<div class="has-tooltip">
{{human_time .CreatedAt}}
<span class="tooltip">{{.CreatedAt.Format "2006-01-02T15:04:05.00"}}</span>
</div>
</td>
<td class="pl-2 pr-3">
<a
href="{{urlTo "admin:invites:revoke:confirm" "id" .ID}}"
class="pl-2 w-20 py-2 text-center text-gray-400 hover:text-red-600 font-bold cursor-pointer"
>{{i18n "AdminInviteRevoke"}}</a>
</td>
</tr>
<tr class="h-12 table-row sm:hidden">
<td class="flex flex-row items-center" colspan="4">
<span class="flex-1">{{i18n "AdminInvitesSummaryFrom"}} <b>{{.CreatedBy.PubKey.Ref }}</b> {{i18n "AdminInvitesSummaryTo"}}</span>
<a
href="{{urlTo "admin:invites:revoke:confirm" "id" .ID}}"
class="pl-4 w-20 py-2 text-center text-gray-400 hover:text-red-600 font-bold cursor-pointer"
>{{i18n "AdminInviteRevoke"}}</a>
</td>
</tr>
{{end}}
</tbody>
</table>
{{$pageNums := .Paginator.PageNums}}
{{$view := .View}}
{{if gt $pageNums 1}}
<div class="flex flex-row justify-center">
{{if not .FirstInView}}
<a
href="{{urlTo "admin:invites:overview"}}?page=1"
class="rounded px-3 py-2 text-pink-600 border-transparent hover:border-pink-400 border-2"
>1</a>
<span
class="px-3 py-2 text-gray-400 border-2 border-transparent"
>..</span>
{{end}}
{{range $view.Pages}}
{{if le . $pageNums}}
{{if eq . $view.Current}}
<span
class="px-3 py-2 cursor-default text-gray-500 border-2 border-transparent"
>{{.}}</span>
{{else}}
<a
href="{{urlTo "admin:invites:overview"}}?page={{.}}"
class="rounded px-3 py-2 mx-1 text-pink-600 border-transparent hover:border-pink-400 border-2"
>{{.}}</a>
{{end}}
{{end}}
{{end}}
{{if not .LastInView}}
<span
class="px-3 py-2 text-gray-400 border-2 border-transparent"
>..</span>
<a
href="{{urlTo "admin:invites:overview"}}?page={{$view.Last}}"
class="rounded px-3 py-2 text-pink-600 border-transparent hover:border-pink-400 border-2"
>{{$view.Last}}</a>
{{end}}
</div>
{{end}}
{{end}}