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 installations to 2024 sub-path #1710

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/installations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@
Pages under /installations - the Installations programme
"""

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("/installations")
def yearly_installation_redirection():
return redirect(url_for('.installations', year=event_year()))

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

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

@base.route("/installations/<int:year>")
def installations(year: int):
return render_template(f"installations/{year}/main.html")
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{% extends "installations/template.html" %}
{% block title %}Installations{% endblock %}
{% extends "installations/2024/template.html" %}
{% block title %}2024 Installations{% endblock %}
{% block body %}
<div id="installations-page">
<h1>Electromagnetic Field Installations</h1>
<h1>Electromagnetic Field Installations - 2024</h1>
<p>There are dozens of installations around the site contributed by attendees, including artworks, games and restored machines.</p>

<p>The ones we know about are listed here by where to find them, but keep your eyes peeled as you move around the site as there will be lots more around the camping areas that we don't know about!</p>
Expand Down
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.installations_page' and page_name==target_page }}">
<a href="{{url_for('base.installations_page', page_name=target_page)}}">{{title}}</a>
<a href="{{url_for('base.installations_page', page_name=target_page, year=2024)}}">{{title}}</a>
</li>
{%- endmacro %}
{% extends "base.html" %}
Expand Down