WIP: Cleanup

This commit is contained in:
Neill Cox 2024-08-10 14:26:12 +10:00
parent 715224653d
commit 6ee942f8dc
37 changed files with 547 additions and 2591 deletions

4
.gitignore vendored
View file

@ -2,3 +2,7 @@ db.sqlite3
.idea/ .idea/
.venv/ .venv/
.hidden_notes.txt .hidden_notes.txt
env/
*pyc
__pycache__/
xxxthemexxx/

39
.run/django_gurps.run.xml Normal file
View file

@ -0,0 +1,39 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="django_gurps" type="Python.DjangoServer" factoryName="Django server">
<module name="django_gurps" />
<option name="ENV_FILES" value="" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="DJANGO_SETTINGS_MODULE" value="django_gurps.settings" />
</envs>
<option name="SDK_HOME" value="" />
<option name="SDK_NAME" value="Python 3.12 (django_gurps)" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="net.ashald.envfile">
<option name="IS_ENABLED" value="true" />
<option name="IS_SUBST" value="false" />
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
<option name="IS_IGNORE_MISSING_FILES" value="false" />
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
<ENTRIES>
<ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" />
<ENTRY IS_ENABLED="false" PARSER="env" IS_EXECUTABLE="false" PATH="env/dev_config_settings.env" />
<ENTRY IS_ENABLED="true" PARSER="env" IS_EXECUTABLE="false" PATH="env/dev_local.env" />
</ENTRIES>
</EXTENSION>
<option name="launchJavascriptDebuger" value="false" />
<option name="port" value="8000" />
<option name="host" value="0.0.0.0" />
<option name="additionalOptions" value="" />
<option name="browserUrl" value="" />
<option name="runTestServer" value="false" />
<option name="runNoReload" value="false" />
<option name="useCustomRunCommand" value="false" />
<option name="customRunCommand" value="" />
<method v="2" />
</configuration>
</component>

View file

@ -36,6 +36,15 @@ CSRF_TRUSTED_ORIGINS = [
"https://gcs.neill.id.au", "https://gcs.neill.id.au",
] ]
AUTHENTICATION_BACKENDS = [
# Needed to log in by username in Django admin, regardless of `allauth`
'django.contrib.auth.backends.ModelBackend',
# `allauth` specific authentication methods, such as login by email
'allauth.account.auth_backends.AuthenticationBackend',
]
# Application definition # Application definition
@ -46,10 +55,20 @@ INSTALLED_APPS = [
"django.contrib.contenttypes", "django.contrib.contenttypes",
"django.contrib.sessions", "django.contrib.sessions",
"django.contrib.messages", "django.contrib.messages",
'allauth',
'allauth.account',
'allauth.socialaccount',
# ... include the providers you want to enable:
'allauth.socialaccount.providers.amazon',
'allauth.socialaccount.providers.apple',
'allauth.socialaccount.providers.google',
"django.contrib.staticfiles", "django.contrib.staticfiles",
"tailwind", # "tailwind",
"theme", # "theme",
"django_browser_reload", "django_browser_reload",
'django_bootstrap_icons',
] ]
MIDDLEWARE = [ MIDDLEWARE = [
@ -61,6 +80,8 @@ MIDDLEWARE = [
"django.contrib.messages.middleware.MessageMiddleware", "django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware",
"django_browser_reload.middleware.BrowserReloadMiddleware", "django_browser_reload.middleware.BrowserReloadMiddleware",
# Add the account middleware:
"allauth.account.middleware.AccountMiddleware",
] ]
ROOT_URLCONF = "django_gurps.urls" ROOT_URLCONF = "django_gurps.urls"
@ -76,6 +97,7 @@ TEMPLATES = [
"django.template.context_processors.request", "django.template.context_processors.request",
"django.contrib.auth.context_processors.auth", "django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages", "django.contrib.messages.context_processors.messages",
'django.template.context_processors.request',
], ],
}, },
}, },
@ -87,12 +109,12 @@ WSGI_APPLICATION = "django_gurps.wsgi.application"
# Database # Database
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases # https://docs.djangoproject.com/en/5.0/ref/settings/#databases
DATABASES = { # DATABASES = {
"default": { # "default": {
"ENGINE": "django.db.backends.sqlite3", # "ENGINE": "django.db.backends.sqlite3",
"NAME": BASE_DIR / "db.sqlite3", # "NAME": BASE_DIR / "db.sqlite3",
} # }
} # }
# Password validation # Password validation
@ -155,3 +177,11 @@ INTERNAL_IPS = [
LOGIN_REDIRECT_URL = "home" LOGIN_REDIRECT_URL = "home"
LOGOUT_REDIRECT_URL = "home" LOGOUT_REDIRECT_URL = "home"
EMAIL_HOST = os.environ["GURPS_SMTP_HOST"]
EMAIL_HOST_USER = os.environ["GURPS_SMTP_USER"]
EMAIL_PORT = os.environ["GURPS_SMTP_PORT"]
EMAIL_HOST_PASSWORD = os.environ["GURPS_EMAIL_PASSWORD"]
EMAIL_USE_SSL = os.environ["GURPS_SMTP_SSL"] == "Y"
DEFAULT_FROM_EMAIL = os.environ["GURPS_EMAIL_ADDRESS"]
ACCOUNT_LOGIN_BY_CODE_ENABLED = True

View file

@ -23,7 +23,8 @@ urlpatterns = [
path("gurps/", include("gurps_character.urls")), path("gurps/", include("gurps_character.urls")),
path("admin/", admin.site.urls), path("admin/", admin.site.urls),
path("__reload__/", include("django_browser_reload.urls")), path("__reload__/", include("django_browser_reload.urls")),
path("accounts/", include("django.contrib.auth.urls")), # path("accounts/", include("django.contrib.auth.urls")),
path('accounts/', include('allauth.urls')),
path("", TemplateView.as_view(template_name="home.html"), name="home"), path("", TemplateView.as_view(template_name="home.html"), name="home"),
path('logout/', views.LogoutView.as_view(), name='logout'), path('logout/', views.LogoutView.as_view(), name='logout'),
] ]

View file

@ -1 +1,2 @@
def logout(request): def logout(request):
pass

View file

@ -0,0 +1,19 @@
from django.contrib.auth.models import User
def create_users():
User.objects.create(
username="neill",
is_superuser=True,
first_name="Neill",
last_name="Cox",
email="neill@neill.id.au",
is_staff=True,
is_active=True,
date_joined="2024-07-31T00:00:00.000Z",
)
if __name__ == "__main__":
create_users()

View file

@ -1,7 +1,8 @@
from django.contrib import admin from django.contrib import admin
# Register your models here. # Register your models here.
from .models import GURPSCharacter, GameSystem from .models import GURPSCharacter, GameSystem, Campaign
admin.site.register(GURPSCharacter) admin.site.register(GURPSCharacter)
admin.site.register(GameSystem) admin.site.register(GameSystem)
admin.site.register(Campaign)

View file

@ -0,0 +1,24 @@
from django.contrib.auth.models import User
from django.core.management import BaseCommand
def create_users():
user = User.objects.create_user(
username="neill",
is_superuser=True,
first_name="Neill",
last_name="Cox",
email="neill@neill.id.au",
is_staff=True,
is_active=True,
date_joined="2024-07-31T00:00:00.000Z",
password="password",
)
# user.save()
class Command(BaseCommand):
help = "Load some initial data"
def handle(self, *args, **options):
create_users()

View file

@ -0,0 +1,24 @@
from django.contrib.auth.models import User
from django.core.management import BaseCommand
def create_users():
user = User.objects.create_user(
username="neill",
is_superuser=True,
first_name="Neill",
last_name="Cox",
email="neill@neill.id.au",
is_staff=True,
is_active=True,
date_joined="2024-07-31T00:00:00.000Z",
password="password",
)
# user.save()
class Command(BaseCommand):
help = "Load some initial data"
def handle(self, *args, **options):
create_users()

View file

@ -0,0 +1,57 @@
# Generated by Django 5.0.6 on 2024-07-14 09:14
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("gurps_character", "0003_gamesystem"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.AddField(
model_name="gurpscharacter",
name="player",
field=models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL,
),
),
migrations.CreateModel(
name="Campaign",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=255, unique=True)),
("description", models.TextField(null=True)),
(
"game_system",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="gurps_character.gamesystem",
),
),
],
),
migrations.AddField(
model_name="gurpscharacter",
name="campaign",
field=models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.CASCADE,
to="gurps_character.campaign",
),
),
]

View file

@ -0,0 +1,20 @@
# Generated by Django 5.0.6 on 2024-07-14 09:25
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("gurps_character", "0004_gurpscharacter_player_campaign_and_more"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.AddField(
model_name="campaign",
name="gm",
field=models.ManyToManyField(to=settings.AUTH_USER_MODEL),
),
]

View file

@ -1,20 +1,54 @@
from django.db import models from django.db import models
from django.contrib.auth.models import User
# Create your models here. # Create your models here.
class GameSystem(models.Model): class GameSystem(models.Model):
name = models.CharField(max_length=255, unique=True) name = models.CharField(max_length=255, unique=True)
description = models.TextField(null=True) description = models.TextField(null=True)
def __str__(self):
return self.name
class GM(models.Model):
gm = models.ForeignKey(User, on_delete=models.CASCADE)
campaign = models.ForeignKey("Campaign", null=True, on_delete=models.CASCADE, related_name='campaign')
class Player(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
status = models.CharField(max_length=255, unique=True)
#
# class Players(models.Model):
# player = models.ForeignKey(User, on_delete=models.CASCADE)
# status = models.CharField(max_length=255, unique=True)
class Campaign(models.Model):
name = models.CharField(max_length=255, unique=True)
description = models.TextField(null=True)
game_system = models.ForeignKey(GameSystem, on_delete=models.CASCADE)
gm = models.ManyToManyField('GM', related_name='GM')
player = models.ManyToManyField('Player')
def __str__(self):
return self.name
class GURPSCharacter(models.Model): class GURPSCharacter(models.Model):
uuid = models.CharField(max_length=128, unique=True) uuid = models.CharField(max_length=128, unique=True)
name = models.CharField(max_length=255, unique=True) name = models.CharField(max_length=255, unique=True)
player = models.ForeignKey(Player, null=True, on_delete=models.CASCADE)
campaign = models.ForeignKey(Campaign, null=True, on_delete=models.CASCADE)
details = models.JSONField() details = models.JSONField()
# owner => user # owner => user
# campaign => campaign # campaign => campaign
def __str__(self):
return self.name + " Player " + str(self.player) + " Campaign " + str(self.campaign)
def adv_points(self): def adv_points(self):
return sum([a['calc']['points'] for a in self.details.get('advantages', []) if a['calc']['points'] > 0]) return sum([a['calc']['points'] for a in self.details.get('advantages', []) if a['calc']['points'] > 0])
@ -31,10 +65,10 @@ class GURPSCharacter(models.Model):
return sum([s['points'] for s in self.details.get('skills', [])]) return sum([s['points'] for s in self.details.get('skills', [])])
def spells_points(self): def spells_points(self):
return 0 return sum([s['points'] for s in self.details.get('spells', [])])
def race_points(self): def race_points(self):
return 0 return sum([s['points'] for s in self.details.get('race', [])]) # Are we sure?
def unspent_points(self): def unspent_points(self):
return self.details['total_points'] - self.adv_points() - \ return self.details['total_points'] - self.adv_points() - \
@ -116,11 +150,36 @@ class GURPSCharacter(models.Model):
dodge = self.details["calc"]["dodge"][0] dodge = self.details["calc"]["dodge"][0]
basic_move = self.basic_move()["value"] basic_move = self.basic_move()["value"]
return [ return [
{ "max_load": round(self.basic_lift()), "move": basic_move, "dodge": dodge, "current": "current" * (enc_level == 0) }, {
{ "max_load": round(self.basic_lift()) * 2, "move": basic_move -2, "dodge": dodge -1, "current": "current" * (enc_level == 1) }, "max_load": round(self.basic_lift()),
{ "max_load": round(self.basic_lift()) * 3, "move": basic_move -3, "dodge": dodge -2, "current": "current" * (enc_level == 2) }, "move": basic_move,
{ "max_load": round(self.basic_lift()) * 6, "move": basic_move -4, "dodge": dodge -3, "current": "current" * (enc_level == 3) }, "dodge": dodge,
{ "max_load": round(self.basic_lift()) * 10, "move": basic_move -5, "dodge": dodge -4, "current": "current" * (enc_level == 4) }, "current": "current" * (enc_level == 0)
},
{
"max_load": round(self.basic_lift()) * 2,
"move": basic_move - 2,
"dodge": dodge - 1,
"current": "current" * (enc_level == 1)
},
{
"max_load": round(self.basic_lift()) * 3,
"move": basic_move - 3,
"dodge": dodge - 2,
"current": "current" * (enc_level == 2)
},
{
"max_load": round(self.basic_lift()) * 6,
"move": basic_move - 4,
"dodge": dodge - 3,
"current": "current" * (enc_level == 3)
},
{
"max_load": round(self.basic_lift()) * 10,
"move": basic_move - 5,
"dodge": dodge - 4,
"current": "current" * (enc_level == 4)
},
] ]
def basic_lift(self): def basic_lift(self):
@ -150,6 +209,7 @@ class GURPSCharacter(models.Model):
modifiers.append(f) modifiers.append(f)
return modifiers return modifiers
def conditional_modifiers(self): def conditional_modifiers(self):
modifiers = [] modifiers = []
@ -207,7 +267,6 @@ class GURPSCharacter(models.Model):
else: else:
return wpn_range return wpn_range
rw = [] rw = []
for item in self.weapons(): for item in self.weapons():
for weapon in item["weapons"]: for weapon in item["weapons"]:
@ -265,8 +324,8 @@ class GURPSCharacter(models.Model):
return traits return traits
def spells(self): def spells(self):
def get_casting_details(spell): def get_casting_details(spell_details):
level = spell['calc']['level'] level = spell_details['calc']['level']
if level < 10: if level < 10:
descr = ( descr = (
@ -293,7 +352,7 @@ class GURPSCharacter(models.Model):
else: else:
delta = int((level - 25) / 5) delta = int((level - 25) / 5)
power = 2 + delta power = 2 + delta
divisor = 2**power # divisor = 2**power
cost = 3 + delta cost = 3 + delta
descr = ( descr = (
f"Ritual: None. Time: / {power} round up. Cost: " f"Ritual: None. Time: / {power} round up. Cost: "
@ -302,12 +361,12 @@ class GURPSCharacter(models.Model):
return descr return descr
spells = [] spells = []
for spell in self.details.get('spells', []): for spell in self.details.get('spells', []):
notes = ( notes = (
f"{get_casting_details(spell)}<br> Class: {spell['spell_class']}; " f"{get_casting_details(spell)}<br> Class: {spell['spell_class']}; "
f"Cost: {spell['casting_cost']}; Maintain: {spell['maintenance_cost']}; Time: {spell['casting_time']}; Duration: {spell['duration']}; " f"Cost: {spell['casting_cost']}; Maintain: {spell['maintenance_cost']};"
f" Time: {spell['casting_time']}; Duration: {spell['duration']}; "
) )
spells.append( spells.append(
{ {
@ -325,33 +384,39 @@ class GURPSCharacter(models.Model):
def skills(self): def skills(self):
skills = [] skills = []
for skill in self.details.get('skills', []): for skill in self.details.get('skills', []):
skills.append({'name': skill["name"], "level": skill["calc"]["level"], "rsl":skill["calc"]["rsl"], "points":skill["points"], "reference":skill["reference"] }) skills.append({
'name': skill["name"],
"level": skill["calc"]["level"],
"rsl": skill["calc"]["rsl"],
"points": skill["points"],
"reference": skill["reference"]
})
return skills return skills
def equipment(self): def equipment(self):
def get_children(parent, level=1): def get_children(parent, level=1):
children = [] children = []
for item in parent["children"]: for item_details in parent["children"]:
equipment = { equipment_details = {
"name": item["description"], "name": item_details["description"],
"uses": "", "uses": "",
"tech_level":item["tech_level"], "tech_level": item_details["tech_level"],
"lc": "", "lc": "",
"value":item["value"], "value": item_details["value"],
"weight":item["weight"], "weight": item_details["weight"],
"quantity":item.get("quantity",1), "quantity": item_details.get("quantity", 1),
"ref":item["reference"], "ref": item_details["reference"],
"ext_weight": item["calc"]["extended_weight"], "ext_weight": item_details["calc"]["extended_weight"],
"ext_value": item["calc"]["extended_value"], "ext_value": item_details["calc"]["extended_value"],
"notes": item.get("notes",""), "notes": item_details.get("notes", ""),
"equipped": item["equipped"], "equipped": item_details["equipped"],
"level": level "level": level
} }
children.append(equipment) children.append(equipment_details)
if "children" in item: if "children" in item_details:
children += get_children(item, level +1) children += get_children(item_details, level + 1)
return children return children
equipment = self.details['equipment'] equipment = self.details['equipment']
@ -388,4 +453,3 @@ class GURPSCharacter(models.Model):
except KeyError: except KeyError:
# v4 # v4
return self.details["settings"]["body_type"]["locations"] return self.details["settings"]["body_type"]["locations"]

View file

@ -0,0 +1,89 @@
{% load i18n %}
{% load bootstrap_icons %}
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
{% block head_title %}
{% endblock head_title %}
</title>
{% block extra_head %}
{% endblock extra_head %}
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
</head>
...
</head>
<body class="bg-gray-50 font-serif leading-normal tracking-normal">
{% block body %}
{% include "navbar.html" %}
{% if messages %}
<div>
<strong>{% trans "Messages:" %}</strong>
<ul>
{% for message in messages %}<li>{{ message }}</li>{% endfor %}
</ul>
</div>
{% endif %}
<div class="container mx-auto">
<section class="flex items-center justify-center h-screen">
Modified template
<strong>{% trans "Menu:" %}</strong>
<ul>
{% if user.is_authenticated %}
{% url 'account_email' as email_url %}
{% if email_url %}
<li>
<a href="{{ email_url }}">{% trans "Change Email" %}</a>
</li>
{% endif %}
{% url 'account_change_password' as change_password_url %}
{% if change_password_url %}
<li>
<a href="{{ change_password_url }}">{% trans "Change Password" %}</a>
</li>
{% endif %}
{% url 'mfa_index' as mfa_url %}
{% if mfa_url %}
<li>
<a href="{{ mfa_url }}">{% trans "Two-Factor Authentication" %}</a>
</li>
{% endif %}
{% url 'usersessions_list' as usersessions_list_url %}
{% if usersessions_list_url %}
<li>
<a href="{{ usersessions_list_url }}">{% trans "Sessions" %}</a>
</li>
{% endif %}
{% url 'account_logout' as logout_url %}
{% if logout_url %}
<li>
<a href="{{ logout_url }}">{% trans "Sign Out" %}</a>
</li>
{% endif %}
{% else %}
{% url 'account_login' as login_url %}
{% if login_url %}
<li>
<a href="{{ login_url }}">{% trans "Sign In" %}</a>
</li>
{% endif %}
{% url 'account_signup' as signup_url %}
{% if signup_url %}
<li>
<a href="{{ signup_url }}">{% trans "Sign Up" %}</a>
</li>
{% endif %}
{% endif %}
</ul>
{% block content %}
{% endblock content %}
</section>
</div>
{% endblock body %}
{% block extra_body %}
{% endblock extra_body %}
</body>
</html>

View file

@ -1,8 +1,37 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load bootstrap_icons %}
{% block content %} {% block content %}
<h3>Welcome to the character store</h3> <h3>Welcome to the character store</h3>
<p<This is a webapp for storing characters.<p> <p>This is a webapp for storing characters.</p>
{% if user.is_authenticated %}
<h1>Welcome {% if user.first_name %}{{ user.first_name }}{% else %}{{ user.username }}{% endif %}</h1>
{% if user.campaign_set.all %}
<h2>Campaigns you run</h2>
<ul>
{% for campaign in user.campaign_set.all %}
<li><a href="{% url 'campaign' campaign.id %}">{{ campaign.name }}</a></li>
{% endfor %}
</ul>
{% endif %}
<h2>Characters you play</h2>
<ul>
{% for character in user.gurpscharacter_set.all %}
<li>
{{ character.name }} in {{ character.campaign }}
<a href="{% url 'details' character.uuid %}" title="view {{ character.name }}">{% bs_icon 'eye' %}</a>
<a href="{% url 'download' character.uuid %}" title="download {{ character.name }}">{% bs_icon 'download' %}</a>
</li>
{% endfor %}
</ul>
{% else %}
<p>Please sign in to see your characters and campaigns</p>
{% endif %}
Add a character?
<p>Currently it works with GURPS, specifically characters created by GCS</p>
{% endblock %} {% endblock %}

View file

@ -1,17 +1,18 @@
<nav class="navbar navbar-expand-lg bg-body-tertiary"> <nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid"> <div class="container-fluid">
<a class="navbar-brand" href="#">Navbar</a> <a class="navbar-brand" href="/">Character Database</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
</button> </button>
<div class="collapse navbar-collapse" id="navbarSupportedContent"> <div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0"> <ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item"><a class="nav-link active" aria-current="page" href="/">Home</a></li> {% if user.is_staff %}
<li class="nav-item"><a class="nav-link active" aria-current="page" href="/gurps">GURPS</a></li> {# <li class="nav-item"><a class="nav-link active" aria-current="page" href="/gurps">GURPS</a></li>#}
<li class="nav-item"><a class="nav-link disabled" aria-current="page" href="/rq">RuneQuest</a></li> {# <li class="nav-item"><a class="nav-link disabled" aria-current="page" href="/rq">RuneQuest</a></li>#}
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="/admin">Admin</a> <a class="nav-link" href="/admin">Admin</a>
</li> </li>
{% endif %}
<!--<li class="nav-item dropdown"> <!--<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false"> <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown Dropdown
@ -36,12 +37,19 @@
</div> </div>
<div class="navbar-text float-end"> <div class="navbar-text float-end">
{% if user.is_authenticated %} {% if user.is_authenticated %}
<form method="post" action="{% url 'logout' %}"> {% url 'account_email' as email_url %}
{% csrf_token %} {% url 'socialaccount_connections' as socialaccount_url %}
<button type="submit">logout</button> {% if email_url or socialaccount_url %}
</form> <a href="{% if email_url %}{{ email_url }}{% else %}{{ socialaccount_url }}{% endif %}"
class="btn btn-secondary">Manage Account</a>
{% endif %}
<a href="{% url 'account_logout' %}" class="btn btn-danger">Sign Out </a>
{% else %} {% else %}
<a class="nav-link" href="{% url 'login' %}">Login</a> <a href="{% url 'account_login' %}" class="btn btn-outline-light">Sign In</a>
{% url 'account_signup' as signup_url %}
{% if signup_url %}
<a href="{{ signup_url }}" class="btn btn-success">Sign Up</a>
{% endif %}
{% endif %} {% endif %}
</div> </div>
</div> </div>

View file

@ -7,4 +7,6 @@ urlpatterns = [
path("details/<str:uuid>/", views.details, name="details"), path("details/<str:uuid>/", views.details, name="details"),
path("upload", views.upload_file, name="upload"), path("upload", views.upload_file, name="upload"),
path("download/<str:uuid>/", views.download, name="download"), path("download/<str:uuid>/", views.download, name="download"),
path("character/<str:uuid>/", views.character, name="character"),
path("campaign/<str:uuid>", views.campaign, name="campaign"),
] ]

View file

@ -7,6 +7,7 @@ from django.urls import reverse
from .models import GURPSCharacter from .models import GURPSCharacter
from .forms import UploadFileForm from .forms import UploadFileForm
def index(request): def index(request):
characters = GURPSCharacter.objects.all() characters = GURPSCharacter.objects.all()
context = {"characters": characters} context = {"characters": characters}
@ -22,11 +23,11 @@ def index(request):
context['form'] = form context['form'] = form
return render(request, "characters/list.html", context) return render(request, "characters/list.html", context)
def details(request, uuid): def details(request, uuid):
character = GURPSCharacter.objects.get(uuid=uuid) character = GURPSCharacter.objects.get(uuid=uuid)
context = {"character": character} context = {"character": character}
#import bpdb;bpdb.set_trace()
return render(request, "characters/embedded.html", context) return render(request, "characters/embedded.html", context)
@ -41,15 +42,14 @@ def upload_file(request):
form = UploadFileForm() form = UploadFileForm()
return render(request, "characters/upload.html", {"form": form}) return render(request, "characters/upload.html", {"form": form})
def handle_uploaded_file(f): def handle_uploaded_file(f):
import bpdb;bpdb.set_trace()
f.seek(0) # We read the file in the validator f.seek(0) # We read the file in the validator
data = json.loads(f.read()) data = json.loads(f.read())
uuid = data['id'] uuid = data['id']
name = data["profile"]["name"] name = data["profile"]["name"]
try: try:
character = GURPSCharacter.objects.get(uuid=uuid) character = GURPSCharacter.objects.get(uuid=uuid)
character.details = data character.details = data
@ -59,9 +59,20 @@ def handle_uploaded_file(f):
character = GURPSCharacter(uuid=uuid, name=name, details=data) character = GURPSCharacter(uuid=uuid, name=name, details=data)
character.save() character.save()
def download(irequest, uuid):
def download(request, uuid):
mime_type = "application/x-gcs-gcs" mime_type = "application/x-gcs-gcs"
character = GURPSCharacter.objects.get(uuid=uuid) character = GURPSCharacter.objects.get(uuid=uuid)
response = HttpResponse(json.dumps(character.details), content_type=mime_type) response = HttpResponse(json.dumps(character.details), content_type=mime_type)
response['Content-Disposition'] = "attachment; filename=%s.gcs" % character.name response['Content-Disposition'] = "attachment; filename=%s.gcs" % character.name
return response return response
def character(request, uuid):
response = HttpResponse("Charcater")
return response
def campaign(request, uuid):
response = HttpResponse("Campaign")
return response

View file

@ -2,3 +2,5 @@ django
tailwind tailwind
django_browser_reload django_browser_reload
psycopg psycopg
django-allauth[socialaccount]
django-bootstrap-icons

View file

@ -1,5 +0,0 @@
from django.apps import AppConfig
class ThemeConfig(AppConfig):
name = 'theme'

View file

@ -1,841 +0,0 @@
/*
! tailwindcss v3.4.1 | MIT License | https://tailwindcss.com
*/
/*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/
*,
::before,
::after {
box-sizing: border-box;
/* 1 */
border-width: 0;
/* 2 */
border-style: solid;
/* 2 */
border-color: #e5e7eb;
/* 2 */
}
::before,
::after {
--tw-content: '';
}
/*
1. Use a consistent sensible line-height in all browsers.
2. Prevent adjustments of font size after orientation changes in iOS.
3. Use a more readable tab size.
4. Use the user's configured `sans` font-family by default.
5. Use the user's configured `sans` font-feature-settings by default.
6. Use the user's configured `sans` font-variation-settings by default.
7. Disable tap highlights on iOS
*/
html,
:host {
line-height: 1.5;
/* 1 */
-webkit-text-size-adjust: 100%;
/* 2 */
-moz-tab-size: 4;
/* 3 */
-o-tab-size: 4;
tab-size: 4;
/* 3 */
font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
/* 4 */
font-feature-settings: normal;
/* 5 */
font-variation-settings: normal;
/* 6 */
-webkit-tap-highlight-color: transparent;
/* 7 */
}
/*
1. Remove the margin in all browsers.
2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
*/
body {
margin: 0;
/* 1 */
line-height: inherit;
/* 2 */
}
/*
1. Add the correct height in Firefox.
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
3. Ensure horizontal rules are visible by default.
*/
hr {
height: 0;
/* 1 */
color: inherit;
/* 2 */
border-top-width: 1px;
/* 3 */
}
/*
Add the correct text decoration in Chrome, Edge, and Safari.
*/
abbr:where([title]) {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
}
/*
Remove the default font size and weight for headings.
*/
h1,
h2,
h3,
h4,
h5,
h6 {
font-size: inherit;
font-weight: inherit;
}
/*
Reset links to optimize for opt-in styling instead of opt-out.
*/
a {
color: inherit;
text-decoration: inherit;
}
/*
Add the correct font weight in Edge and Safari.
*/
b,
strong {
font-weight: bolder;
}
/*
1. Use the user's configured `mono` font-family by default.
2. Use the user's configured `mono` font-feature-settings by default.
3. Use the user's configured `mono` font-variation-settings by default.
4. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp,
pre {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
/* 1 */
font-feature-settings: normal;
/* 2 */
font-variation-settings: normal;
/* 3 */
font-size: 1em;
/* 4 */
}
/*
Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/*
Prevent `sub` and `sup` elements from affecting the line height in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/*
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
3. Remove gaps between table borders by default.
*/
table {
text-indent: 0;
/* 1 */
border-color: inherit;
/* 2 */
border-collapse: collapse;
/* 3 */
}
/*
1. Change the font styles in all browsers.
2. Remove the margin in Firefox and Safari.
3. Remove default padding in all browsers.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit;
/* 1 */
font-feature-settings: inherit;
/* 1 */
font-variation-settings: inherit;
/* 1 */
font-size: 100%;
/* 1 */
font-weight: inherit;
/* 1 */
line-height: inherit;
/* 1 */
color: inherit;
/* 1 */
margin: 0;
/* 2 */
padding: 0;
/* 3 */
}
/*
Remove the inheritance of text transform in Edge and Firefox.
*/
button,
select {
text-transform: none;
}
/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Remove default button styles.
*/
button,
[type='button'],
[type='reset'],
[type='submit'] {
-webkit-appearance: button;
/* 1 */
background-color: transparent;
/* 2 */
background-image: none;
/* 2 */
}
/*
Use the modern Firefox focus style for all focusable elements.
*/
:-moz-focusring {
outline: auto;
}
/*
Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
*/
:-moz-ui-invalid {
box-shadow: none;
}
/*
Add the correct vertical alignment in Chrome and Firefox.
*/
progress {
vertical-align: baseline;
}
/*
Correct the cursor style of increment and decrement buttons in Safari.
*/
::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
height: auto;
}
/*
1. Correct the odd appearance in Chrome and Safari.
2. Correct the outline style in Safari.
*/
[type='search'] {
-webkit-appearance: textfield;
/* 1 */
outline-offset: -2px;
/* 2 */
}
/*
Remove the inner padding in Chrome and Safari on macOS.
*/
::-webkit-search-decoration {
-webkit-appearance: none;
}
/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button;
/* 1 */
font: inherit;
/* 2 */
}
/*
Add the correct display in Chrome and Safari.
*/
summary {
display: list-item;
}
/*
Removes the default spacing and border for appropriate elements.
*/
blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
margin: 0;
}
fieldset {
margin: 0;
padding: 0;
}
legend {
padding: 0;
}
ol,
ul,
menu {
list-style: none;
margin: 0;
padding: 0;
}
/*
Reset default styling for dialogs.
*/
dialog {
padding: 0;
}
/*
Prevent resizing textareas horizontally by default.
*/
textarea {
resize: vertical;
}
/*
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
2. Set the default placeholder color to the user's configured gray 400 color.
*/
input::-moz-placeholder, textarea::-moz-placeholder {
opacity: 1;
/* 1 */
color: #9ca3af;
/* 2 */
}
input::placeholder,
textarea::placeholder {
opacity: 1;
/* 1 */
color: #9ca3af;
/* 2 */
}
/*
Set the default cursor for buttons.
*/
button,
[role="button"] {
cursor: pointer;
}
/*
Make sure disabled buttons don't get the pointer cursor.
*/
:disabled {
cursor: default;
}
/*
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
This can trigger a poorly considered lint error in some tools but is included by design.
*/
img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
display: block;
/* 1 */
vertical-align: middle;
/* 2 */
}
/*
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
*/
img,
video {
max-width: 100%;
height: auto;
}
/* Make elements with the HTML hidden attribute stay hidden by default */
[hidden] {
display: none;
}
[type='text'],input:where(:not([type])),[type='email'],[type='url'],[type='password'],[type='number'],[type='date'],[type='datetime-local'],[type='month'],[type='search'],[type='tel'],[type='time'],[type='week'],[multiple],textarea,select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background-color: #fff;
border-color: #6b7280;
border-width: 1px;
border-radius: 0px;
padding-top: 0.5rem;
padding-right: 0.75rem;
padding-bottom: 0.5rem;
padding-left: 0.75rem;
font-size: 1rem;
line-height: 1.5rem;
--tw-shadow: 0 0 #0000;
}
[type='text']:focus, input:where(:not([type])):focus, [type='email']:focus, [type='url']:focus, [type='password']:focus, [type='number']:focus, [type='date']:focus, [type='datetime-local']:focus, [type='month']:focus, [type='search']:focus, [type='tel']:focus, [type='time']:focus, [type='week']:focus, [multiple]:focus, textarea:focus, select:focus {
outline: 2px solid transparent;
outline-offset: 2px;
--tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: #2563eb;
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
border-color: #2563eb;
}
input::-moz-placeholder, textarea::-moz-placeholder {
color: #6b7280;
opacity: 1;
}
input::placeholder,textarea::placeholder {
color: #6b7280;
opacity: 1;
}
::-webkit-datetime-edit-fields-wrapper {
padding: 0;
}
::-webkit-date-and-time-value {
min-height: 1.5em;
text-align: inherit;
}
::-webkit-datetime-edit {
display: inline-flex;
}
::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field {
padding-top: 0;
padding-bottom: 0;
}
select {
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
background-position: right 0.5rem center;
background-repeat: no-repeat;
background-size: 1.5em 1.5em;
padding-right: 2.5rem;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
[multiple],[size]:where(select:not([size="1"])) {
background-image: initial;
background-position: initial;
background-repeat: unset;
background-size: initial;
padding-right: 0.75rem;
-webkit-print-color-adjust: unset;
print-color-adjust: unset;
}
[type='checkbox'],[type='radio'] {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
padding: 0;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
display: inline-block;
vertical-align: middle;
background-origin: border-box;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
flex-shrink: 0;
height: 1rem;
width: 1rem;
color: #2563eb;
background-color: #fff;
border-color: #6b7280;
border-width: 1px;
--tw-shadow: 0 0 #0000;
}
[type='checkbox'] {
border-radius: 0px;
}
[type='radio'] {
border-radius: 100%;
}
[type='checkbox']:focus,[type='radio']:focus {
outline: 2px solid transparent;
outline-offset: 2px;
--tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);
--tw-ring-offset-width: 2px;
--tw-ring-offset-color: #fff;
--tw-ring-color: #2563eb;
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
}
[type='checkbox']:checked,[type='radio']:checked {
border-color: transparent;
background-color: currentColor;
background-size: 100% 100%;
background-position: center;
background-repeat: no-repeat;
}
[type='checkbox']:checked {
background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
}
@media (forced-colors: active) {
[type='checkbox']:checked {
-webkit-appearance: auto;
-moz-appearance: auto;
appearance: auto;
}
}
[type='radio']:checked {
background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");
}
@media (forced-colors: active) {
[type='radio']:checked {
-webkit-appearance: auto;
-moz-appearance: auto;
appearance: auto;
}
}
[type='checkbox']:checked:hover,[type='checkbox']:checked:focus,[type='radio']:checked:hover,[type='radio']:checked:focus {
border-color: transparent;
background-color: currentColor;
}
[type='checkbox']:indeterminate {
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");
border-color: transparent;
background-color: currentColor;
background-size: 100% 100%;
background-position: center;
background-repeat: no-repeat;
}
@media (forced-colors: active) {
[type='checkbox']:indeterminate {
-webkit-appearance: auto;
-moz-appearance: auto;
appearance: auto;
}
}
[type='checkbox']:indeterminate:hover,[type='checkbox']:indeterminate:focus {
border-color: transparent;
background-color: currentColor;
}
[type='file'] {
background: unset;
border-color: inherit;
border-width: 0;
border-radius: 0;
padding: 0;
font-size: unset;
line-height: inherit;
}
[type='file']:focus {
outline: 1px solid ButtonText;
outline: 1px auto -webkit-focus-ring-color;
}
*, ::before, ::after {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-rotate: 0;
--tw-skew-x: 0;
--tw-skew-y: 0;
--tw-scale-x: 1;
--tw-scale-y: 1;
--tw-pan-x: ;
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
--tw-gradient-from-position: ;
--tw-gradient-via-position: ;
--tw-gradient-to-position: ;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-ring-inset: ;
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: rgb(59 130 246 / 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
--tw-blur: ;
--tw-brightness: ;
--tw-contrast: ;
--tw-grayscale: ;
--tw-hue-rotate: ;
--tw-invert: ;
--tw-saturate: ;
--tw-sepia: ;
--tw-drop-shadow: ;
--tw-backdrop-blur: ;
--tw-backdrop-brightness: ;
--tw-backdrop-contrast: ;
--tw-backdrop-grayscale: ;
--tw-backdrop-hue-rotate: ;
--tw-backdrop-invert: ;
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
}
::backdrop {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-rotate: 0;
--tw-skew-x: 0;
--tw-skew-y: 0;
--tw-scale-x: 1;
--tw-scale-y: 1;
--tw-pan-x: ;
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
--tw-gradient-from-position: ;
--tw-gradient-via-position: ;
--tw-gradient-to-position: ;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-ring-inset: ;
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: rgb(59 130 246 / 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
--tw-blur: ;
--tw-brightness: ;
--tw-contrast: ;
--tw-grayscale: ;
--tw-hue-rotate: ;
--tw-invert: ;
--tw-saturate: ;
--tw-sepia: ;
--tw-drop-shadow: ;
--tw-backdrop-blur: ;
--tw-backdrop-brightness: ;
--tw-backdrop-contrast: ;
--tw-backdrop-grayscale: ;
--tw-backdrop-hue-rotate: ;
--tw-backdrop-invert: ;
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
}
.container {
width: 100%;
}
@media (min-width: 640px) {
.container {
max-width: 640px;
}
}
@media (min-width: 768px) {
.container {
max-width: 768px;
}
}
@media (min-width: 1024px) {
.container {
max-width: 1024px;
}
}
@media (min-width: 1280px) {
.container {
max-width: 1280px;
}
}
@media (min-width: 1536px) {
.container {
max-width: 1536px;
}
}
.static {
position: static;
}
.mx-auto {
margin-left: auto;
margin-right: auto;
}
.block {
display: block;
}
.inline {
display: inline;
}
.flex {
display: flex;
}
.grid {
display: grid;
}
.hidden {
display: none;
}
.h-screen {
height: 100vh;
}
.items-center {
align-items: center;
}
.justify-center {
justify-content: center;
}
.border {
border-width: 1px;
}
.bg-gray-50 {
--tw-bg-opacity: 1;
background-color: rgb(249 250 251 / var(--tw-bg-opacity));
}
.font-serif {
font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}
.text-5xl {
font-size: 3rem;
line-height: 1;
}
.leading-normal {
line-height: 1.5;
}
.tracking-normal {
letter-spacing: 0em;
}

View file

@ -1 +0,0 @@
node_modules

File diff suppressed because it is too large Load diff

View file

@ -1,28 +0,0 @@
{
"name": "theme",
"version": "3.8.0",
"description": "",
"scripts": {
"start": "npm run dev",
"build": "npm run build:clean && npm run build:tailwind",
"build:clean": "rimraf ../static/css/dist",
"build:tailwind": "cross-env NODE_ENV=production tailwindcss --postcss -i ./src/styles.css -o ../static/css/dist/styles.css --minify",
"dev": "cross-env NODE_ENV=development tailwindcss --postcss -i ./src/styles.css -o ../static/css/dist/styles.css -w",
"tailwindcss": "node ./node_modules/tailwindcss/lib/cli.js"
},
"keywords": [],
"author": "",
"license": "MIT",
"devDependencies": {
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/forms": "^0.5.7",
"@tailwindcss/typography": "^0.5.10",
"cross-env": "^7.0.3",
"postcss": "^8.4.32",
"postcss-import": "^15.1.0",
"postcss-nested": "^6.0.1",
"postcss-simple-vars": "^7.0.1",
"rimraf": "^5.0.5",
"tailwindcss": "^3.4.0"
}
}

View file

@ -1,7 +0,0 @@
module.exports = {
plugins: {
"postcss-import": {},
"postcss-simple-vars": {},
"postcss-nested": {}
},
}

View file

@ -1,3 +0,0 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

View file

@ -1,57 +0,0 @@
/**
* This is a minimal config.
*
* If you need the full config, get it from here:
* https://unpkg.com/browse/tailwindcss@latest/stubs/defaultConfig.stub.js
*/
module.exports = {
content: [
/**
* HTML. Paths to Django template files that will contain Tailwind CSS classes.
*/
/* Templates within theme app (<tailwind_app_name>/templates), e.g. base.html. */
'../templates/**/*.html',
/*
* Main templates directory of the project (BASE_DIR/templates).
* Adjust the following line to match your project structure.
*/
'../../templates/**/*.html',
/*
* Templates in other django apps (BASE_DIR/<any_app_name>/templates).
* Adjust the following line to match your project structure.
*/
'../../**/templates/**/*.html',
/**
* JS: If you use Tailwind CSS in JavaScript, uncomment the following lines and make sure
* patterns match your project structure.
*/
/* JS 1: Ignore any JavaScript in node_modules folder. */
// '!../../**/node_modules',
/* JS 2: Process all JavaScript files in the project. */
// '../../**/*.js',
/**
* Python: If you use Tailwind CSS classes in Python, uncomment the following line
* and make sure the pattern below matches your project structure.
*/
// '../../**/*.py'
],
theme: {
extend: {},
},
plugins: [
/**
* '@tailwindcss/forms' is the forms plugin that provides a minimal styling
* for forms. If you don't like it or have own styling for forms,
* comment the line below to disable '@tailwindcss/forms'.
*/
require('@tailwindcss/forms'),
require('@tailwindcss/typography'),
require('@tailwindcss/aspect-ratio'),
],
}