require log in to edit thinks
This commit is contained in:
parent
52ab7aa331
commit
46c9f0a447
4 changed files with 29 additions and 13 deletions
|
@ -1,5 +1,6 @@
|
|||
:root {
|
||||
--spacing: 1em;
|
||||
--half-spacing: calc(0.5 * var(--spacing));
|
||||
}
|
||||
|
||||
* {
|
||||
|
@ -71,6 +72,18 @@ body.thing-editor {
|
|||
display: flex;
|
||||
gap: var(--spacing);
|
||||
justify-content: space-between;
|
||||
|
||||
& > details {
|
||||
text-align: right;
|
||||
|
||||
& > summary {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
& button {
|
||||
margin: var(--half-spacing) 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
& #code-editor {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from django.conf import settings
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.http import HttpResponse, JsonResponse
|
||||
from django.shortcuts import render, redirect
|
||||
from django.views import generic
|
||||
|
@ -11,7 +12,7 @@ from . import forms
|
|||
from .models import Think
|
||||
from .random_slug import random_slug
|
||||
|
||||
class ThinkMixin:
|
||||
class ThinkMixin(LoginRequiredMixin):
|
||||
model = Think
|
||||
context_object_name = 'think'
|
||||
|
||||
|
|
|
@ -117,6 +117,7 @@ USE_TZ = True
|
|||
# https://docs.djangoproject.com/en/5.0/howto/static-files/
|
||||
|
||||
STATIC_URL = 'static/'
|
||||
STATIC_ROOT = '/srv/think.somethingorotherwhatever.com/public/static'
|
||||
|
||||
# Default primary key field type
|
||||
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
|
||||
|
@ -126,4 +127,4 @@ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
|||
THINKS_DIR = Path('think_data')
|
||||
THINKS_DIR.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
THINKS_STATIC_URL = 'http://{slug}.thinks.localhost'
|
||||
THINKS_STATIC_URL = 'http://{slug}.think.somethingorotherwhatever.com'
|
||||
|
|
|
@ -19,5 +19,6 @@ from django.urls import path, include
|
|||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path("accounts/", include("django.contrib.auth.urls")),
|
||||
path("", include('thinks.urls')),
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue