Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move arcade things to a year folder #1711

Merged
merged 1 commit into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions apps/base/arcade.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,22 @@
Pages under /arcade - the arcade program.
"""

from flask import render_template
from flask import render_template, redirect, url_for

from . import base
from models import event_year
from apps.common import render_markdown


@base.route("/arcade/<page_name>")
def arcade_page(page_name: str):
return render_markdown(f"arcade/{page_name}", template="arcade/template.html", page_name=page_name)

@base.route("/arcade")
def arcade():
return render_template("arcade/index.html")
def yearly_arcade_redirection():
return redirect(url_for('.arcade', year=event_year()))

@base.route("/arcade/<int:year>/<page_name>")
def arcade_page(year: int, page_name: str):
return render_markdown(f"arcade/{year}/{page_name}", template=f"arcade/{year}/template.html", page_name=page_name)

@base.route("/arcade/<int:year>")
def arcade(year: int):
return render_template(f"arcade/{year}/main.html")

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{% extends "arcade/template.html" %}
{% block title %}About{% endblock %}
{% extends "arcade/2024/template.html" %}
{% block title %}Electromagnetic Field Arcade - 2024{% endblock %}
{% block body %}
<div id="arcade-page">
<h1>Electromagnetic Field Arcade</h1>
<h1>Electromagnetic Field Arcade - 2024</h1>
<p>Welcome to the Electromagnetic Field Arcade!</p>
<p>Thanks to the incredible variety of cool creative people that attend and surround EMF, this year we’ve created a homemade arcade to showcase some of their fantastic work. We’re extremely grateful to the developers, publishers, and engineers who have allowed us to feature their creations for our entertainment this weekend.</p>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{% macro view(title, view_name) -%}
<li class="{{ 'active' if request.endpoint == view_name }}">
<a href="{{url_for(view_name)}}">{{title}}</a>
<a href="{{url_for(view_name, year=2024)}}">{{title}}</a>
</li>
{%- endmacro %}
{% macro page(title, target_page) -%}
<li class="{{ 'active' if request.endpoint == 'base.arcade_page' and page_name==target_page }}">
<a href="{{url_for('base.arcade_page', page_name=target_page)}}">{{title}}</a>
<a href="{{url_for('base.arcade_page', page_name=target_page, year=2024)}}">{{title}}</a>
</li>
{%- endmacro %}
{% extends "base.html" %}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.