Skip to content

Commit

Permalink
Move installations to 2024 sub-path
Browse files Browse the repository at this point in the history
we'll want to be able to reuse these paths in other years
  • Loading branch information
SamLR authored and russss committed May 31, 2024
1 parent 0b62692 commit 6e02c86
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 12 deletions.
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")
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 "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
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.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

0 comments on commit 6e02c86

Please sign in to comment.