summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-12-07 14:01:50 +0100
committerTor Andersson <tor@ccxvii.net>2023-12-10 18:06:33 +0100
commit80e3204596f9ab48a350a322e91d78b2a095cf33 (patch)
tree9a6c541397cc85fa30d7a0ef1c1c6dc699c4551f /views
parent277fdc3dc71de71d1996586b5f0b56bee1c60bf1 (diff)
downloadserver-80e3204596f9ab48a350a322e91d78b2a095cf33.tar.gz
Add support for random scenario selection and scenario groupings.
Diffstat (limited to 'views')
-rw-r--r--views/create.pug23
1 files changed, 18 insertions, 5 deletions
diff --git a/views/create.pug b/views/create.pug
index 717c4f0..7a8a6b8 100644
--- a/views/create.pug
+++ b/views/create.pug
@@ -14,14 +14,27 @@ html
+gamecover(title.title_id)
form(method="post" action="/create/"+title.title_id)
- if scenarios.length > 1
+ if Array.isArray(scenarios)
+ if scenarios.length > 1
+ p Scenario:
+ br
+ select(name="scenario")
+ each scenario in scenarios
+ option(value=scenario)= scenario
+ else
+ input(type="hidden" name="scenario" value=scenarios[0])
+ else
p Scenario:
br
select(name="scenario")
- each scenario in scenarios
- option(value=scenario)= scenario
- else
- input(type="hidden" name="scenario" value=scenarios[0])
+ each list, name in scenarios
+ if name === ""
+ each scenario in list
+ option(value=scenario)= scenario
+ else
+ optgroup(label=name)
+ each scenario in list
+ option(value=scenario)= scenario
| !{ title.create_html }