Add new JavaScript and GIF assets for enhanced UI features

- Introduced a new loading indicator GIF to improve user experience during asynchronous operations.
- Added jQuery Ajax Queue plugin to manage queued Ajax requests, ensuring that new requests wait for previous ones to complete.
- Implemented jQuery Autocomplete plugin for enhanced input fields, allowing users to receive suggestions as they type.
- Included jQuery Bgiframe plugin to ensure proper rendering of elements in Internet Explorer 6.
This commit is contained in:
pacnpal
2025-08-20 12:31:33 -04:00
parent bead0654df
commit 69c07d1381
16 changed files with 1452 additions and 58 deletions

View File

@@ -2,6 +2,7 @@ from django.core.management.base import BaseCommand
from allauth.socialaccount.models import SocialApp, SocialAccount, SocialToken
from django.contrib.sites.models import Site
class Command(BaseCommand):
help = 'Check all social auth related tables'
@@ -9,7 +10,8 @@ class Command(BaseCommand):
# Check SocialApp
self.stdout.write('\nChecking SocialApp table:')
for app in SocialApp.objects.all():
self.stdout.write(f'ID: {app.id}, Provider: {app.provider}, Name: {app.name}, Client ID: {app.client_id}')
self.stdout.write(
f'ID: {app.pk}, Provider: {app.provider}, Name: {app.name}, Client ID: {app.client_id}')
self.stdout.write('Sites:')
for site in app.sites.all():
self.stdout.write(f' - {site.domain}')
@@ -17,14 +19,17 @@ class Command(BaseCommand):
# Check SocialAccount
self.stdout.write('\nChecking SocialAccount table:')
for account in SocialAccount.objects.all():
self.stdout.write(f'ID: {account.id}, Provider: {account.provider}, UID: {account.uid}')
self.stdout.write(
f'ID: {account.pk}, Provider: {account.provider}, UID: {account.uid}')
# Check SocialToken
self.stdout.write('\nChecking SocialToken table:')
for token in SocialToken.objects.all():
self.stdout.write(f'ID: {token.id}, Account: {token.account}, App: {token.app}')
self.stdout.write(
f'ID: {token.pk}, Account: {token.account}, App: {token.app}')
# Check Site
self.stdout.write('\nChecking Site table:')
for site in Site.objects.all():
self.stdout.write(f'ID: {site.id}, Domain: {site.domain}, Name: {site.name}')
self.stdout.write(
f'ID: {site.pk}, Domain: {site.domain}, Name: {site.name}')

View File

@@ -14,9 +14,10 @@ class Command(BaseCommand):
user = User.objects.create_user(
username="testuser",
email="testuser@example.com",
[PASSWORD-REMOVED]",
password="testpass123",
)
self.stdout.write(self.style.SUCCESS(f"Created test user: {user.username}"))
self.stdout.write(self.style.SUCCESS(
f"Created test user: {user.username}"))
else:
self.stdout.write(self.style.WARNING("Test user already exists"))
@@ -25,11 +26,12 @@ class Command(BaseCommand):
moderator = User.objects.create_user(
username="moderator",
email="moderator@example.com",
[PASSWORD-REMOVED]",
password="modpass123",
)
# Create moderator group if it doesn't exist
moderator_group, created = Group.objects.get_or_create(name="Moderators")
moderator_group, created = Group.objects.get_or_create(
name="Moderators")
# Add relevant permissions
permissions = Permission.objects.filter(
@@ -48,9 +50,11 @@ class Command(BaseCommand):
moderator.groups.add(moderator_group)
self.stdout.write(
self.style.SUCCESS(f"Created moderator user: {moderator.username}")
self.style.SUCCESS(
f"Created moderator user: {moderator.username}")
)
else:
self.stdout.write(self.style.WARNING("Moderator user already exists"))
self.stdout.write(self.style.WARNING(
"Moderator user already exists"))
self.stdout.write(self.style.SUCCESS("Test users setup complete"))

View File

@@ -3,6 +3,7 @@ from django.db import connection
from django.contrib.auth.hashers import make_password
import uuid
class Command(BaseCommand):
help = 'Reset database and create admin user'
@@ -57,8 +58,11 @@ class Command(BaseCommand):
'light'
) RETURNING id;
""", [make_password('admin'), user_id])
user_db_id = cursor.fetchone()[0]
result = cursor.fetchone()
if result is None:
raise Exception("Failed to create user - no ID returned")
user_db_id = result[0]
# Create profile
profile_id = str(uuid.uuid4())[:10]
@@ -79,7 +83,8 @@ class Command(BaseCommand):
self.stdout.write('Superuser created.')
except Exception as e:
self.stdout.write(self.style.ERROR(f'Error creating superuser: {str(e)}'))
self.stdout.write(self.style.ERROR(
f'Error creating superuser: {str(e)}'))
raise
self.stdout.write(self.style.SUCCESS('Database reset complete.'))