Skip to content

Commit

Permalink
Merge pull request #4386 from magfest/mivs-2025
Browse files Browse the repository at this point in the history
Update MIVS form for Super 2025
  • Loading branch information
kitsuta committed Aug 1, 2024
2 parents ec4d133 + f76df2d commit 0286f06
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- id: set-matrix
run: |
echo "matrix={\"include\":$(echo "${{ vars.DOCKER_BUILDS }}" | yq -o=json -I 0 e '.branches.${{ github.ref_name }} // [{"name":"anthrocon-rams/rams:${{ github.ref_name }}", "plugins":[]}]' -)}" >> $GITHUB_OUTPUT
echo "matrix={\"include\":$(echo "${{ vars.DOCKER_BUILDS }}" | yq -o=json -I 0 e '.branches.${{ github.ref_name }} // [{"name":"magfest/ubersystem:${{ github.ref_name }}", "plugins":[]}]' -)}" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
build_downstream:
Expand Down Expand Up @@ -86,4 +86,4 @@ jobs:
build-args: BRANCH=${{ github.ref_name }}
context: "."
push: true
tags: ghcr.io/anthrocon-rams/rams:${{ github.ref_name }}
tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
"""Add player count, content warning, and photosensitivity warning to MIVS games
Revision ID: 983af01225fc
Revises: f1a8794a398f
Create Date: 2024-08-01 02:28:06.735773
"""


# revision identifiers, used by Alembic.
revision = '983af01225fc'
down_revision = 'f1a8794a398f'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
import residue


try:
is_sqlite = op.get_context().dialect.name == 'sqlite'
except Exception:
is_sqlite = False

if is_sqlite:
op.get_context().connection.execute('PRAGMA foreign_keys=ON;')
utcnow_server_default = "(datetime('now', 'utc'))"
else:
utcnow_server_default = "timezone('utc', current_timestamp)"

def sqlite_column_reflect_listener(inspector, table, column_info):
"""Adds parenthesis around SQLite datetime defaults for utcnow."""
if column_info['default'] == "datetime('now', 'utc')":
column_info['default'] = utcnow_server_default

sqlite_reflect_kwargs = {
'listeners': [('column_reflect', sqlite_column_reflect_listener)]
}

# ===========================================================================
# HOWTO: Handle alter statements in SQLite
#
# def upgrade():
# if is_sqlite:
# with op.batch_alter_table('table_name', reflect_kwargs=sqlite_reflect_kwargs) as batch_op:
# batch_op.alter_column('column_name', type_=sa.Unicode(), server_default='', nullable=False)
# else:
# op.alter_column('table_name', 'column_name', type_=sa.Unicode(), server_default='', nullable=False)
#
# ===========================================================================


def upgrade():
op.add_column('indie_game', sa.Column('is_multiplayer', sa.Boolean(), server_default='False', nullable=False))
op.add_column('indie_game', sa.Column('content_warning', sa.Boolean(), server_default='False', nullable=False))
op.add_column('indie_game', sa.Column('photosensitive_warning', sa.Boolean(), server_default='False', nullable=False))
op.add_column('indie_game', sa.Column('warning_desc', sa.Unicode(), server_default='', nullable=False))


def downgrade():
op.drop_column('indie_game', 'warning_desc')
op.drop_column('indie_game', 'content_warning')
op.drop_column('indie_game', 'photosensitive_warning')
op.drop_column('indie_game', 'is_multiplayer')
6 changes: 4 additions & 2 deletions docs/DEVELOPERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ When cloning the repository with Git (`git clone REPOURL`), your repo URL can lo
| :exclamation: If cloning a repo with non-alphanumeric characters, like hyphens, you should rename the base repo folder to convert them to underscores. E.g., `mff-rams-plugin` should be renamed to `mff_rams_plugin`. |
|---------------------------------------------------------------------------------------------------------------|

To enable your plugin, you'll follow the loading instructions below. First, though, make sure your plugin has a config override file. You can [download the file from a config repo](configuration#generated-configuration) (if applicable) or create a blank text file in the root folder of the plugin. It should be named after the plugin itself, e.g., `/magprime/magprime.ini`.
To enable your plugin, you'll follow the loading instructions below. First, though, make sure your plugin has a config override file. You can [download the file from a config repo](configuration#generated-configuration) (if applicable) or create a blank INI file in the root folder of the plugin. It should be named after the plugin itself, e.g., `/magprime/magprime.ini` for the magprime plugin.

### Loading Custom Config and Plugins
The last step for loading custom config or plugins (or both) is to tell Docker Compose to use them. There are a few ways to do this, but here we'll cover how to use environment variables defined in an `.env` file.
Expand All @@ -88,6 +88,8 @@ Instead, we have an `.env.example` file, located in the root of this repository.
- On the line `PLUGIN_NAME=yourplugin`, replace `yourplugin` with your plugin folder's name in its normal case, e.g., `magprime`.
- On the line `YOURPLUGIN_CONFIG_FILES=${PLUGIN_NAME}`, change `YOURPLUGIN` to an all-caps version of your plugin folder's name, e.g., `MAGPRIME`.

Alternatively, if you want to load custom config but no plugin, delete or use the `#` character to comment out all lines except `UBER_CONFIG_FILES=uber.ini`.

If you used these instructions to set up your config file(s) (`uber.ini` for this repository, plus `yourplugin.ini` for any custom plugins), that's all you need to change. The next time you use `docker compose up`, your plugin and custom config will be loaded!

## Enabling SAML Login
Expand Down Expand Up @@ -168,4 +170,4 @@ Once you have an `.env` file, open it and edit the line `COMPOSE_PROFILES=dev`.
|---------------------------------------------------------------------------------------------------------------|

### Invalid Cert Bypass
Since the certificate is self-signed, your browser may show a warning screen when you try to browse to https://localhost/. The exact screen varies based on the browser, but there is always a way to bypass this warning to continue to your local server. This may be hidden behind an extra link, like "Advanced options."
Since the certificate is self-signed, your browser may show a warning screen when you try to browse to https://localhost/. The exact screen varies based on the browser, but there is always a way to bypass this warning to continue to your local server. This may be hidden behind an extra link, like "Advanced options."
5 changes: 5 additions & 0 deletions uber/models/mivs.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,13 @@ class IndieGame(MagModel, ReviewMixin):
title = Column(UnicodeText)
brief_description = Column(UnicodeText) # 140 max
genres = Column(MultiChoice(c.MIVS_INDIE_GENRE_OPTS))
is_multiplayer = Column(Boolean, default=False)
player_count = Column(UnicodeText)
platforms = Column(MultiChoice(c.MIVS_INDIE_PLATFORM_OPTS))
platforms_text = Column(UnicodeText)
content_warning = Column(Boolean, default=False)
warning_desc = Column(UnicodeText)
photosensitive_warning = Column(Boolean, default=False)
description = Column(UnicodeText) # 500 max
how_to_play = Column(UnicodeText) # 1000 max
link_to_video = Column(UnicodeText)
Expand Down
42 changes: 42 additions & 0 deletions uber/templates/mivs/game.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,23 @@ <h2>{% if game.is_new %}Register a Game{% else %}Edit Game Information{% endif %
</div>
</div>

<div class="form-group">
<label class="col-sm-3 control-label">Multiplayer?</label>
<div class="col-sm-6 checkbox">
{{ macros.toggle_checkbox(
'.player_count',
'This is a multiplayer game.',
suffix='_player_count',
name='is_multiplayer',
required_selector='.player_count',
hide_on_checked=False,
checked=game.is_multiplayer) }}
</div>
<div class="col-sm-6 col-sm-offset-3 player_count">
<input type="text" class="form-control" name="player_count" placeholder="Number of players (e.g., 1-4)" value="{{ game.player_count }}" />
</div>
</div>

<div class="form-group">
<label class="col-sm-3 control-label">Platforms</label>
<div class="col-sm-6">
Expand Down Expand Up @@ -71,6 +88,31 @@ <h2>{% if game.is_new %}Register a Game{% else %}Edit Game Information{% endif %
</div>
{% endif %}

<div class="form-group">
<label class="col-sm-3 control-label">Content/Trigger Warning</label>
<div class="col-sm-6 checkbox">
{{ macros.toggle_checkbox(
'.warning_desc',
'I would like to add a content or trigger warning for my game.',
suffix='_warning_desc',
name='content_warning',
required_selector='.warning_desc',
hide_on_checked=False,
checked=game.content_warning) }}
</div>
<div class="col-sm-6 col-sm-offset-3 warning_desc">
<br/><p class="help-block">Please enter the content/trigger warning below.</p>
<textarea class="form-control" name="warning_desc" rows="4">{{ game.warning_desc }}</textarea>
</div>
</div>

<div class="form-group">
<label class="col-sm-3 control-label">Photosensitivity Warning</label>
<div class="col-sm-6 checkbox">
{{ macros.checkbox(game, 'photosensitive_warning', label_class="optional-field", label="My game may trigger photosensitivity issues.") }}
</div>
</div>

<div class="form-group">
<label class="col-sm-3 control-label">Full Description</label>
<div class="col-sm-6">
Expand Down
11 changes: 6 additions & 5 deletions uber/templates/mivs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ <h3>Games</h3>
{% set game_edit_link %}[<a href="game?id={{ game.id }}">Edit</a>]{% endset %}
<h4>
{{ game.title }}
{% if c.HAS_MIVS_ADMIN_ACCESS or not game.submitted %}{{ game_edit_link }}{% endif %}
{% if c.HAS_MIVS_ADMIN_ACCESS or c.MIVS_SUBMISSIONS_OPEN %}{{ game_edit_link }}{% endif %}
</h4>

{% if game.status in c.FINAL_MIVS_GAME_STATUSES %}
Expand All @@ -95,6 +95,7 @@ <h4>
{% else %}You have already filled out this game's show information, but you can edit it{% endif %}
<a href="show_info?id={{ game.id }}">here</a>.{% endif %}
{% else %}
{% if game.submitted %}{% endif %}
{% set needs_screenshots = game.screenshots|length < 2 %}
{% set can_delete_screenshots = not game.submitted or game.screenshots|length > 2%}
<div class="game-container">
Expand Down Expand Up @@ -147,10 +148,10 @@ <h4>Game Submission</h4>
{% endfor %}
</ul>
{% else %}
You've met all the prerequisites to submit this game for consideration. After submitting you may no longer
edit the game details unless the judges kick the game back to you and requests edits. You will still be able
to manage your game's video, screenshots, and the game build information, such as build status and link,
after submitting. Our judges will not look at your game until you officially submit it by clicking this button:
You've met all the prerequisites to submit this game for consideration. This lets us know that your game
is ready for judging. <strong>You must submit your game by {{ c.MIVS_DEADLINE|datetime_local }}</strong>.
You may edit your game details after you submit it.
<br/><br/>
<form method="post" action="submit_game" class="form-horizontal">
{{ csrf_token() }}
<input type="hidden" name="id" value="{{ game.id }}" />
Expand Down

0 comments on commit 0286f06

Please sign in to comment.