Enhance moderation dashboard UI and UX:

- Add HTMX-powered filtering with instant updates
- Add smooth transitions and loading states
- Improve visual hierarchy and styling
- Add review notes functionality
- Add confirmation dialogs for actions
- Make navigation sticky
- Add hover effects and visual feedback
- Improve dark mode support
This commit is contained in:
pacnpal
2024-11-13 14:38:38 +00:00
parent d2c9d02523
commit 9ee380c3ea
98 changed files with 5073 additions and 3040 deletions

View File

@@ -1,4 +1,4 @@
# Generated by Django 5.1.2 on 2024-10-28 21:50
# Generated by Django 5.1.3 on 2024-11-12 18:07
import django.contrib.auth.models
import django.contrib.auth.validators
@@ -60,6 +60,18 @@ class Migration(migrations.Migration):
verbose_name="username",
),
),
(
"first_name",
models.CharField(
blank=True, max_length=150, verbose_name="first name"
),
),
(
"last_name",
models.CharField(
blank=True, max_length=150, verbose_name="last name"
),
),
(
"email",
models.EmailField(
@@ -97,18 +109,6 @@ class Migration(migrations.Migration):
unique=True,
),
),
(
"first_name",
models.CharField(
default="", max_length=150, verbose_name="first name"
),
),
(
"last_name",
models.CharField(
default="", max_length=150, verbose_name="last name"
),
),
(
"role",
models.CharField(

View File

@@ -64,7 +64,7 @@ class CustomLoginView(TurnstileMixin, LoginView):
if getattr(request, 'htmx', False):
return render(
request,
'account/partials/login_form.html',
'account/partials/login_modal.html',
self.get_context_data()
)
return super().get(request, *args, **kwargs)
@@ -76,7 +76,30 @@ class CustomSignupView(TurnstileMixin, SignupView):
except ValidationError as e:
form.add_error(None, str(e))
return self.form_invalid(form)
return super().form_valid(form)
response = super().form_valid(form)
if getattr(self.request, 'htmx', False):
return HttpResponseClientRefresh()
return response
def form_invalid(self, form):
if getattr(self.request, 'htmx', False):
return render(
self.request,
'account/partials/signup_modal.html',
self.get_context_data(form=form)
)
return super().form_invalid(form)
def get(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse:
if getattr(request, 'htmx', False):
return render(
request,
'account/partials/signup_modal.html',
self.get_context_data()
)
return super().get(request, *args, **kwargs)
@login_required
def user_redirect_view(request: HttpRequest) -> HttpResponse: