Add very hacky index assignment setting

This commit is contained in:
Tim Van Baak 2020-05-01 00:21:17 -07:00
parent b8239c0bc4
commit fdcac92044
2 changed files with 17 additions and 0 deletions

View File

@ -67,6 +67,8 @@
<span style="color: #ff0000">{{ error }}</span><br> <span style="color: #ff0000">{{ error }}</span><br>
{% endfor %} {% endfor %}
{{ number_setting(form.articleIndexCapacity) }} {{ number_setting(form.articleIndexCapacity) }}
{{ form.turnAssignment.label }}:<br>
{{ form.turnAssignment(class_="fullwidth", rows=10) }}
</p> </p>
<h3>Visibility and Joining</h3> <h3>Visibility and Joining</h3>

View File

@ -88,6 +88,17 @@ class IndexListTranslator(SettingTranslator):
return index_list return index_list
class TmpAsgnTranslator(SettingTranslator):
def load(self, cfg_value):
import json
print(cfg_value)
return json.dumps(cfg_value)
def save(self, field_data):
import json
return json.loads(field_data)
class Setting(): class Setting():
""" """
Represents a relation between a node in a lexicon config and a Represents a relation between a node in a lexicon config and a
@ -169,6 +180,10 @@ class Settings():
widget=NumberInput(), widget=NumberInput(),
validators=[DataRequired()])) validators=[DataRequired()]))
s_turnAssignment = Setting('turn.assignment',
TextAreaField('index assignment raw'),
translator=TmpAsgnTranslator())
s_joinPublic = Setting('join.public', s_joinPublic = Setting('join.public',
BooleanField('Show game on public pages')) BooleanField('Show game on public pages'))