Dissociate default character from editor

This commit is contained in:
Tim Van Baak 2020-01-31 13:51:58 -08:00
parent bc62063ed0
commit 8a052feb3c
3 changed files with 17 additions and 5 deletions

View File

@ -74,6 +74,8 @@ def create_lexicon(name, editor):
"name": "Ersatz Scrivener", "name": "Ersatz Scrivener",
"player": None, "player": None,
}) })
with l.edit() as cfg:
cfg.character.default.player = None
return l return l

View File

@ -8,7 +8,16 @@
{% block bl_editor %} {% block bl_editor %}
<p>Editor actions</p> <p>Editor actions</p>
<ul> <ul>
<li><a href="{{ url_for('lexicon.settings', name=g.lexicon.name) }}">Edit lexicon settings</a></li> <li>
<a href="{{ url_for('lexicon.settings', name=g.lexicon.name) }}">
Edit lexicon settings
</a>
</li>
<li>
<a href="{{ url_for('lexicon.character', name=g.lexicon.name, cid='default') }}">
Edit default character
</a>
</li>
</ul> </ul>
{% endblock %} {% endblock %}
{% set template_content_blocks = template_content_blocks + [self.bl_editor()] %} {% set template_content_blocks = template_content_blocks + [self.bl_editor()] %}
@ -19,7 +28,6 @@
<span style="color: #ff0000">{{ message }}</span><br> <span style="color: #ff0000">{{ message }}</span><br>
{% endfor %} {% endfor %}
<p>Player actions</p> <p>Player actions</p>
<ul> <ul>
{% set characters = g.lexicon.get_characters_for_player(current_user.id) %} {% set characters = g.lexicon.get_characters_for_player(current_user.id) %}
{% for char in characters %} {% for char in characters %}
@ -29,7 +37,7 @@
</a> </a>
</li> </li>
{% endfor %} {% endfor %}
{% {%
if characters|count is lt(g.lexicon.join.chars_per_player) if characters|count is lt(g.lexicon.join.chars_per_player)
and not g.lexicon.turn.current and not g.lexicon.turn.current
%} %}

View File

@ -13,11 +13,13 @@
{% endfor %}<br> {% endfor %}<br>
Characters: Characters:
{% for char in g.lexicon.character.values() %} {% for char in g.lexicon.character.values() %}
{{ char.name }} ({{ char.player|user_attr('username') }}){% if not loop.last %},{% endif %} {{ char.name }}{% if char.player %}
({{ char.player|user_attr('username') }}){% endif %}
{% if not loop.last %},{% endif %}
{% endfor %}<br> {% endfor %}<br>
</p> </p>
<div style="width: 100%; height: 10em; overflow-y:auto; resize: vertical; <div style="width: 100%; height: 10em; overflow-y:auto; resize: vertical;
border: 1px solid #bbbbbb; font-size: 0.9em; padding:3px; box-sizing: border-box;"> border: 1px solid #bbbbbb; font-size: 0.7em; padding:3px; box-sizing: border-box;">
{% for log_entry in g.lexicon.log %} {% for log_entry in g.lexicon.log %}
[{{ log_entry[0]|asdate }}] {{ log_entry[1] }}<br> [{{ log_entry[0]|asdate }}] {{ log_entry[1] }}<br>
{% endfor %} {% endfor %}