mirror of
https://github.com/thomiceli/opengist.git
synced 2025-06-13 05:47:12 +02:00
Add require login feature to see gists
This commit is contained in:
2
templates/base/base_header.html
vendored
2
templates/base/base_header.html
vendored
@ -66,7 +66,7 @@
|
||||
</svg>
|
||||
</a>
|
||||
{{ else }}
|
||||
{{ if not .signupDisabled }}
|
||||
{{ if not .DisableSignup }}
|
||||
<a href="/register" class="inline-flex text-slate-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">
|
||||
<p class="text-slate-300 mr-1">Register</p>
|
||||
</a>
|
||||
|
6
templates/pages/admin_index.html
vendored
6
templates/pages/admin_index.html
vendored
@ -81,7 +81,11 @@
|
||||
<div class="space-y-2">
|
||||
<div>
|
||||
<label for="disable-signup" class="text-sm text-slate-300">Disable signup</label>
|
||||
<input type="checkbox" id="disable-signup" name="disable-signup" {{ if .signupDisabled }}checked="checked"{{ end }} class="ml-1 h-4 w-4 rounded border-gray-300 text-primary-600 focus:ring-primary-600" />
|
||||
<input type="checkbox" id="disable-signup" name="disable-signup" {{ if .DisableSignup }}checked="checked"{{ end }} class="ml-1 h-4 w-4 rounded border-gray-300 text-primary-600 focus:ring-primary-600" />
|
||||
</div>
|
||||
<div>
|
||||
<label for="disable-signup" class="text-sm text-slate-300">Login required</label>
|
||||
<input type="checkbox" id="require-login" name="require-login" {{ if .RequireLogin }}checked="checked"{{ end }} class="ml-1 h-4 w-4 rounded border-gray-300 text-primary-600 focus:ring-primary-600" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
4
templates/pages/auth_form.html
vendored
4
templates/pages/auth_form.html
vendored
@ -8,7 +8,7 @@
|
||||
|
||||
</header>
|
||||
<main class="mt-4">
|
||||
{{ if and .signupDisabled (ne .title "Login") }}
|
||||
{{ if and .DisableSignup (ne .title "Login") }}
|
||||
<p class="italic">Administrator has disabled signing up</p>
|
||||
{{ else }}
|
||||
<div class="sm:col-span-6">
|
||||
@ -33,7 +33,7 @@
|
||||
<div class="flex-auto">
|
||||
<button type="submit" class="inline-flex items-center px-4 py-2 border border-transparent border-gray-700 text-sm font-medium rounded-md shadow-sm text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">Login</button>
|
||||
</div>
|
||||
{{ if not .signupDisabled }}
|
||||
{{ if not .DisableSignup }}
|
||||
<span class="float-right text-sm py-2 underline"><a href="/register">Register instead →</a></span>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user