From aa745b1f6a0417292440ebb3642f02c99cc516de Mon Sep 17 00:00:00 2001 From: Niko Abeler Date: Sun, 11 Jun 2023 20:44:14 +0200 Subject: [PATCH] missing confirmations --- ...source_alter_player_name_resourceearned.py | 44 +++++++++++++++++++ .../guild/adventure_confirm_delete.html | 16 +++++++ .../guild/character_confirm_delete.html | 14 ++++++ .../guild/player_confirm_delete.html | 14 ++++++ 4 files changed, 88 insertions(+) create mode 100644 guild/migrations/0002_resource_alter_player_name_resourceearned.py create mode 100644 guild/templates/guild/adventure_confirm_delete.html create mode 100644 guild/templates/guild/character_confirm_delete.html create mode 100644 guild/templates/guild/player_confirm_delete.html diff --git a/guild/migrations/0002_resource_alter_player_name_resourceearned.py b/guild/migrations/0002_resource_alter_player_name_resourceearned.py new file mode 100644 index 0000000..cbe29af --- /dev/null +++ b/guild/migrations/0002_resource_alter_player_name_resourceearned.py @@ -0,0 +1,44 @@ +# Generated by Django 4.2.1 on 2023-06-11 18:43 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('guild', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Resource', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ('description', models.TextField()), + ], + options={ + 'verbose_name': 'resource', + 'verbose_name_plural': 'resources', + }, + ), + migrations.AlterField( + model_name='player', + name='name', + field=models.CharField(max_length=255, unique=True), + ), + migrations.CreateModel( + name='ResourceEarned', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('amount', models.IntegerField()), + ('character', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='guild.character', verbose_name='character')), + ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='guild.resource', verbose_name='resource')), + ], + options={ + 'verbose_name': 'resourceearned', + 'verbose_name_plural': 'resourceearneds', + }, + ), + ] diff --git a/guild/templates/guild/adventure_confirm_delete.html b/guild/templates/guild/adventure_confirm_delete.html new file mode 100644 index 0000000..40de92e --- /dev/null +++ b/guild/templates/guild/adventure_confirm_delete.html @@ -0,0 +1,16 @@ +{% extends 'base.html' %} + +{% block content %} + +

Session Delete

+ +

Are you sure you want to delete {{ adventure.name}}?

+ +

This will delete all associated sessions!

+ +
+ {% csrf_token %} + {{ form.as_p }} + +
+{% endblock content %} \ No newline at end of file diff --git a/guild/templates/guild/character_confirm_delete.html b/guild/templates/guild/character_confirm_delete.html new file mode 100644 index 0000000..2ed26de --- /dev/null +++ b/guild/templates/guild/character_confirm_delete.html @@ -0,0 +1,14 @@ +{% extends 'base.html' %} + +{% block content %} + +

Session Delete

+ +

Are you sure you want to delete {{ character.name}}?

+ +
+ {% csrf_token %} + {{ form.as_p }} + +
+{% endblock content %} \ No newline at end of file diff --git a/guild/templates/guild/player_confirm_delete.html b/guild/templates/guild/player_confirm_delete.html new file mode 100644 index 0000000..7ab4387 --- /dev/null +++ b/guild/templates/guild/player_confirm_delete.html @@ -0,0 +1,14 @@ +{% extends 'base.html' %} + +{% block content %} + +

Session Delete

+ +

Are you sure you want to delete {{ player.name}}?

+ +
+ {% csrf_token %} + {{ form.as_p }} + +
+{% endblock content %} \ No newline at end of file