From d00d53f3042a6a9acc32fbf5e6aec20223574639 Mon Sep 17 00:00:00 2001 From: Brandon Cornejo Date: Tue, 10 Nov 2020 23:03:01 -0600 Subject: [PATCH] Treasure generator, new heading style for all pages --- acks/npc/templates/generate_npc_party.html | 7 ++- acks/npc/templates/generate_single_npc.html | 7 ++- acks/npc/templates/spell_list.html | 7 ++- acks/templates/base.html | 42 ++++++++++--- acks/templates/handbook.html | 8 +++ acks/templates/index.html | 8 ++- acks/templates/treasure.html | 68 +++++++++++++++++++++ acks/templates/worldmap.html | 8 +++ acks/views.py | 16 +++++ 9 files changed, 159 insertions(+), 12 deletions(-) create mode 100644 acks/templates/treasure.html diff --git a/acks/npc/templates/generate_npc_party.html b/acks/npc/templates/generate_npc_party.html index 23848fe..5691e9b 100644 --- a/acks/npc/templates/generate_npc_party.html +++ b/acks/npc/templates/generate_npc_party.html @@ -4,7 +4,7 @@ {% block title %}NPC Party Generation{% endblock %} {% block content %}
-

Adventurer Conqueror King NPC Party Generator

+

Adventurer Conqueror KingNPC Party Generator

@@ -238,6 +238,11 @@ div.save-block > div > div:last-child { div.acks-npc-card { width: 400px; } +h1 strong { + display: block; + font-size: 50%; + opacity: 0.65; +} +{% endblock %} diff --git a/acks/templates/worldmap.html b/acks/templates/worldmap.html index 6d60e94..0a937da 100644 --- a/acks/templates/worldmap.html +++ b/acks/templates/worldmap.html @@ -3,6 +3,9 @@ {% block title %}World Map{% endblock %} {% block content %} +
+

Adventurer Conqueror KingWorld Map

+

@@ -11,5 +14,10 @@ {% block head %} {% endblock %} diff --git a/acks/views.py b/acks/views.py index 2f8eb57..df81ef5 100644 --- a/acks/views.py +++ b/acks/views.py @@ -1,3 +1,4 @@ +import requests from flask import current_app, Blueprint, render_template, url_for, redirect @@ -15,3 +16,18 @@ def handbook(): @default_views.route('/worldmap') def worldmap(): return render_template('worldmap.html') + +@default_views.route('/treasure') +@default_views.route('/treasure/') +def treasure(treasure_type=None): + if treasure_type is not None: + headers = {'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'} + payload = { + "treasure_type": treasure_type, + "form_id": "acks_treasure_form", + "form_build_id": "form-PqO-1VglfW4Q3x1fm7HMewhLFjst2oxY5AR_m6WOGBg" + } + response = requests.request("POST", "http://autarch.co/system/ajax", data=payload, headers=headers) + generated_treasure = response.json()[1]["data"].replace('class="form-textarea"', 'class="uk-textarea"') + return render_template('treasure.html', generated_treasure=generated_treasure, treasure_type=treasure_type) + return render_template('treasure.html')