WebHost: fix sample yamls that have no options.
WebHost: hide hidden games from templates listing
This commit is contained in:
parent
88c5ebdd2f
commit
a6a859b272
|
@ -73,9 +73,9 @@ def download_slot_file(room_id, player_id: int):
|
||||||
@app.route("/templates")
|
@app.route("/templates")
|
||||||
@cache.cached()
|
@cache.cached()
|
||||||
def list_yaml_templates():
|
def list_yaml_templates():
|
||||||
import os
|
|
||||||
files = []
|
files = []
|
||||||
for file in os.scandir(os.path.join(app.static_folder, "generated")):
|
from worlds.AutoWorld import AutoWorldRegister
|
||||||
if file.is_file() and file.name.endswith(".yaml"):
|
for world_name, world in AutoWorldRegister.world_types.items():
|
||||||
files.append(file.name)
|
if not world.hidden:
|
||||||
|
files.append(world_name)
|
||||||
return render_template("templates.html", files=files)
|
return render_template("templates.html", files=files)
|
|
@ -68,4 +68,5 @@ progression_balancing:
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{{ yaml_dump(option.default) | indent(4, first=False) }}
|
{{ yaml_dump(option.default) | indent(4, first=False) }}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
|
{% if not options %}{}{% endif %}
|
|
@ -14,7 +14,7 @@
|
||||||
<h1>Option Templates (YAML)</h1>
|
<h1>Option Templates (YAML)</h1>
|
||||||
<ul>
|
<ul>
|
||||||
{% for file in files %}
|
{% for file in files %}
|
||||||
<li><a href="{{ url_for('static', filename="generated/"+file) }}">{{ file }}</a></li>
|
<li><a href="{{ url_for('static', filename="generated/"+file+".yaml") }}">{{ file }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue