Skip to content

Commit

Permalink
Add game form descriptions #911
Browse files Browse the repository at this point in the history
  • Loading branch information
cxong committed Sep 25, 2021
1 parent 664b645 commit fb67c1c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
15 changes: 15 additions & 0 deletions schema/games.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,19 @@ schema;game:
development:
type: str
enum: ['complete', 'very active', 'active', 'sporadic', 'halted']
desc: |
Complete: development stopped but game is complete<br>
Very active: many commits within the past week<br>
Active: commits within the past month<br>
Sporadic: commits within the past year<br>
Halted: no commits within the past year
status:
type: str
enum: ['playable', 'semi-playable', 'unplayable']
desc: |
Playable: all major features working, full game can be completed<br>
Semi-playable: game runs and some parts of the game playable<br>
Unplayable: game cannot be played, e.g. can only load assets
multiplayer:
type: seq
sequence:
Expand All @@ -45,6 +55,11 @@ schema;game:
content:
type: str
enum: ['commercial', 'free', 'open', 'swappable']
desc: |
Commercial: requires data from original game, which is not free<br>
Free: game data is free or can be obtained for free<br>
Open: game data has an open source license<br>
Swappable: game data is commercial but can be swapped with open source replacements
lang:
type: seq
desc: Main programming language(s) used for the game, e.g. C++
Expand Down
3 changes: 3 additions & 0 deletions schema/originals.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ sequence:
type: seq
sequence:
- type: str
desc: Alternate names for this game
external:
required: True
type: map
mapping:
website:
type: str
desc: URL of official website
wikipedia:
type: str
desc: Title of Wikipedia article
platform:
type: seq
sequence:
Expand Down
5 changes: 5 additions & 0 deletions templates/forms/page.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,10 @@
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
<script src="{{ static_url }}/tagsinput/tagsinput.js"></script>
<script src="{{ static_url }}/main.js"></script>
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip()
})
</script>
</body>
</html>
4 changes: 3 additions & 1 deletion templates/forms/types/str.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ https://pykwalify.readthedocs.io/en/unstable/validation-rules.html#range
{% if schema.get("enum") %}
{% if schema["enum"]|length <= MAX_RADIO_BUTTONS %}
{% for s_value in schema["enum"] %}
<div class="form-check">
<div class="form-check"
{% if "desc" in schema %}data-toggle="tooltip" data-placement="left" data-html="true" title="{{ schema["desc"]|e }}"{% endif %}
>
<input
type="radio"
class="form-check-input"
Expand Down

1 comment on commit fb67c1c

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.