Add very hacky index assignment setting
This commit is contained in:
parent
b8239c0bc4
commit
fdcac92044
|
@ -67,6 +67,8 @@
|
|||
<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>
|
||||
|
|
|
@ -88,6 +88,17 @@ class IndexListTranslator(SettingTranslator):
|
|||
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():
|
||||
"""
|
||||
Represents a relation between a node in a lexicon config and a
|
||||
|
@ -169,6 +180,10 @@ class Settings():
|
|||
widget=NumberInput(),
|
||||
validators=[DataRequired()]))
|
||||
|
||||
s_turnAssignment = Setting('turn.assignment',
|
||||
TextAreaField('index assignment raw'),
|
||||
translator=TmpAsgnTranslator())
|
||||
|
||||
s_joinPublic = Setting('join.public',
|
||||
BooleanField('Show game on public pages'))
|
||||
|
||||
|
|
Loading…
Reference in New Issue