tmp
This commit is contained in:
parent
3a9b016320
commit
1b5ac23b77
|
@ -0,0 +1,22 @@
|
|||
from typing import Optional
|
||||
import uuid
|
||||
|
||||
from flask import Blueprint, render_template, url_for, g, flash
|
||||
from flask_login import current_user
|
||||
from werkzeug.utils import redirect
|
||||
|
||||
from amanuensis.backend import charq
|
||||
from amanuensis.db import Character
|
||||
from amanuensis.server.helpers import editor_required, lexicon_param, player_required
|
||||
|
||||
# from .forms import CharacterCreateForm
|
||||
|
||||
|
||||
bp = Blueprint("settings", __name__, url_prefix="/settings", template_folder=".")
|
||||
|
||||
|
||||
@bp.get("/")
|
||||
@lexicon_param
|
||||
@editor_required
|
||||
def page(name):
|
||||
return render_template("settings.jinja", name=name)
|
|
@ -0,0 +1,125 @@
|
|||
{% extends "lexicon.jinja" %}
|
||||
{% block title %}Edit | {{ lexicon_title }}{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<p>
|
||||
|
||||
|
||||
<p>
|
||||
Id: {{ g.lexicon.lid }}<br>
|
||||
Name: {{ g.lexicon.cfg.name }}<br>
|
||||
Created: {{ g.lexicon.cfg.time.created|asdate }}<br>
|
||||
Completed: {{ g.lexicon.cfg.time.completed|asdate }}<br>
|
||||
Players:
|
||||
{% for uid in g.lexicon.cfg.join.joined %}
|
||||
{{ uid|user_attr('username') }}{% if not loop.last %},{% endif %}
|
||||
{% endfor %}<br>
|
||||
Characters:
|
||||
{% for char in g.lexicon.cfg.character.values() %}
|
||||
{{ char.name }}{% if char.player %}
|
||||
({{ char.player|user_attr('username') }}){% endif %}
|
||||
{% if not loop.last %},{% endif %}
|
||||
{% endfor %}<br>
|
||||
</p>
|
||||
<div style="width: 100%; height: 10em; overflow-y:auto; resize: vertical;
|
||||
border: 1px solid #bbbbbb; font-size: 0.7em; padding:3px; box-sizing: border-box;">
|
||||
{% for log_entry in g.lexicon.cfg.log %}
|
||||
[{{ log_entry[0]|asdate }}] {{ log_entry[1] }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% macro number_setting(field) %}
|
||||
{{ field(autocomplete="off", class_="smallnumber") }}
|
||||
{{ field.label }}<br>
|
||||
{% for error in field.errors %}
|
||||
<span style="color: #ff0000">{{ error }}</span><br>
|
||||
{% endfor %}
|
||||
|
||||
{% endmacro %}
|
||||
{% macro flag_setting(field) %}
|
||||
{{ field() }}
|
||||
{{ field.label }}<br>
|
||||
{% endmacro %}
|
||||
|
||||
{% block settings %}
|
||||
<form id="session-settings" action="" method="post" novalidate>
|
||||
{{ form.hidden_tag() }}
|
||||
|
||||
<h3>General</h3>
|
||||
<p>
|
||||
{{ form.title.label }}:<br>
|
||||
{{ form.title(autocomplete="off", size=32, style="width:100%") }}<br>
|
||||
{{ form.editor.label }}: {{ form.editor(autocomplete="off") }}<br>
|
||||
{% for error in form.editor.errors %}
|
||||
<span style="color: #ff0000">{{ error }}</span><br>
|
||||
{% endfor %}
|
||||
{{ form.prompt.label }}: {{ form.prompt(class_="fullwidth") }}
|
||||
{% for error in form.prompt.errors %}
|
||||
<span style="color: #ff0000">{{ error }}</span><br>
|
||||
{% endfor %}
|
||||
</p>
|
||||
|
||||
<h3>Game Progress</h3>
|
||||
<p>
|
||||
{{ number_setting(form.turnCurrent) }}
|
||||
{{ number_setting(form.turnMax) }}
|
||||
{{ form.articleIndexList.label }}:<br>
|
||||
{{ form.articleIndexList(class_="fullwidth", rows=10) }}
|
||||
{% for error in form.articleIndexList.errors %}
|
||||
<span style="color: #ff0000">{{ error }}</span><br>
|
||||
{% endfor %}
|
||||
{{ number_setting(form.articleIndexCapacity) }}
|
||||
{{ form.turnAssignment.label }}:<br>
|
||||
{{ form.turnAssignment(class_="fullwidth", rows=10) }}
|
||||
</p>
|
||||
|
||||
<h3>Visibility and Joining</h3>
|
||||
<p>
|
||||
{{ flag_setting(form.joinPublic) }}
|
||||
{{ flag_setting(form.joinOpen) }}
|
||||
{{ form.joinPassword(autocomplete="off") }}
|
||||
{{ form.joinPassword.label }}<br>
|
||||
{{ number_setting(form.joinMaxPlayers) }}
|
||||
{{ number_setting(form.joinCharsPerPlayer) }}
|
||||
</p>
|
||||
|
||||
<h3>Turn Publishing</h3>
|
||||
<p>
|
||||
{{ flag_setting(form.publishNotifyEditorOnReady) }}
|
||||
{{ flag_setting(form.publishNotifyPlayerOnReject) }}
|
||||
{{ flag_setting(form.publishNotifyPlayerOnAccept) }}
|
||||
{{ form.publishDeadlines(autocomplete="off") }}
|
||||
{{ form.publishDeadlines.label }}<br>
|
||||
{{ flag_setting(form.publishAsap) }}
|
||||
{% for error in form.publishDeadlines.errors %}
|
||||
<span style="color: #ff0000">{{ error }}</span><br>
|
||||
{% endfor %}
|
||||
{{ flag_setting(form.publishBlockOnReady) }}
|
||||
{{ number_setting(form.publishQuorum) }}
|
||||
</p>
|
||||
|
||||
<h3>Article Requirements</h3>
|
||||
<p>
|
||||
{{ flag_setting(form.articleCitationAllowSelf) }}
|
||||
{{ number_setting(form.articleCitationMinExtant)}}
|
||||
{{ number_setting(form.articleCitationMaxExtant)}}
|
||||
{{ number_setting(form.articleCitationMinPhantom)}}
|
||||
{{ number_setting(form.articleCitationMaxPhantom)}}
|
||||
{{ number_setting(form.articleCitationMinTotal)}}
|
||||
{{ number_setting(form.articleCitationMaxTotal)}}
|
||||
{{ number_setting(form.articleCitationMinChars)}}
|
||||
{{ number_setting(form.articleCitationMaxChars)}}
|
||||
{{ number_setting(form.articleWordLimitSoft)}}
|
||||
{{ number_setting(form.articleWordLimitHard)}}
|
||||
{{ flag_setting(form.articleAddendumAllowed) }}
|
||||
{{ number_setting(form.articleAddendumMax) }}
|
||||
</p>
|
||||
<!--character-->
|
||||
<p>{{ form.submit() }}</p>
|
||||
</form>
|
||||
{% for message in get_flashed_messages() %}
|
||||
<span style="color: #ff0000">{{ message }}</span><br>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
{% set template_content_blocks = [self.info(), self.settings()] %}
|
Loading…
Reference in New Issue