rewrite using pyramid and wtforms

This commit is contained in:
evilchili
2024-01-31 22:39:54 -08:00
parent 5faf5c97c1
commit 3444f83c91
15 changed files with 234 additions and 163 deletions
+13
View File
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<title>{{ config['project_name'] }}{% block title %}{% endblock %}</title>
<meta name="og:provider_name" content="{{ config['project_name'] }}">
<link rel='stylesheet' href="{{config['static_url']}}/styles.css" />
{% block headers %}{% endblock %}
</head>
<body>
{% block content %}{% endblock %}
{% block debug %}{% endblock %}
</body>
</html>
+27 -7
View File
@@ -1,15 +1,35 @@
<div style='float:left; max-width:20%'>
{% extends "base.html" %}
{% block content %}
<div style='float:left; max-width:20%;height: 90%'>
<ul>
{% for char in all_characters %}
<li><a href="/sheet/{{char['slug']}}/{{char['name']}}">{{ char['name'] }}</a></li>
{% endfor %}
</ul>
</div>
<div>
<h1>{{ character.name }}</h1>
{{ form.display(value=character) }}
{{ flash }}
<h1>{{ record.name }}</h1>
<pre>
{{ character }}
</pre>
<form name="character_sheet" method="post" novalidate class="form">
{{ form.csrf_token }}
{% if 'process' in form.errors %}
Error: {{ form.errors['process'] |join(',') }}
{% endif %}
<ul>
<li>{{form.name.label}}: {{ form.name }} {{form.errors['name'] | join(',') }}</li>
<li>{{form.level.label}}: {{ form.level }} {{form.errors['level'] | join(',') }}<//li>
</ul>
<button type="submit">Submit</button>
</form>
</div>
{% endblock %}
{% block debug %}
<h2>Debug</h2>
<h3>Record</h3>
<pre>{{ record }}</pre>
<h3>Config</h3>
<pre>{{ config }}</pre>
{% endblock %}