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

Feature/more sponsor template customisation #705

Merged

Conversation

drnlm
Copy link
Member

@drnlm drnlm commented Mar 6, 2024

The current display of packages and sponsors is hard to customise as the templates are monolithic, leading to issues like PyConZA/pyconza2023#5

This adds a few more blocks to those templates to resolve that

@drnlm
Copy link
Member Author

drnlm commented Mar 6, 2024

Diff ignoring whitespace changes, as easier to review

diff --git a/wafer/sponsors/templates/wafer.sponsors/packages.html b/wafer/sponsors/templates/wafer.sponsors/packages.html
index 117ca73..a86d36b 100644
--- a/wafer/sponsors/templates/wafer.sponsors/packages.html
+++ b/wafer/sponsors/templates/wafer.sponsors/packages.html
@@ -2,9 +2,14 @@
 {% load i18n %}
 {% block content %}
 <section class="wafer wafer-sponsorship-packages">
+  {% block page_title %}
   <h1>{% trans 'Sponsorship Packages' %}</h1>
+  {% endblock %}
+  {% block pre_package_list %}{% endblock %}
+  {% block package_list %}
     <div class="wafer list">
       {% for package in sponsorshippackage_list %}
+        {% block package_display %}
           <section class="wafer wafer-sponsorship-package
                           wafer-sponsor-{{ package.name.lower }}">
             <div class="card">
@@ -24,9 +29,12 @@
               </div>
             </div>
           </section>
+        {% endblock package_display %}
       {% empty %}
         <p>{% trans 'No sponsorship packages available yet.' %}</p>
       {% endfor %}
     </div>
+  {% endblock package_list %}
+  {% block post_package_list %}{% endblock %}
 </section>
-{% endblock %}
+{% endblock content %}
diff --git a/wafer/sponsors/templates/wafer.sponsors/sponsors.html b/wafer/sponsors/templates/wafer.sponsors/sponsors.html
index 9cd4978..4dd22d6 100644
--- a/wafer/sponsors/templates/wafer.sponsors/sponsors.html
+++ b/wafer/sponsors/templates/wafer.sponsors/sponsors.html
@@ -4,9 +4,14 @@
 {% block title %}{% trans "Sponsors" %} - {{ WAFER_CONFERENCE_NAME }}{% endblock %}
 {% block content %}
 <section class="wafer wafer-sponsors">
+  {% block page_title %}
   <h1>{% trans 'Sponsors' %}</h1>
+  {% endblock %}
+  {% block pre_sponsor_list %}{% endblock %}
+  {% block sponsor_list %}
     <div class="wafer list">
       {% for sponsor in sponsor_list %}
+        {% block sponsor_details %}
           <section class="wafer wafer-sponsor
                           wafer-sponsor-{{ sponsor.packages.first.name.lower }}">
             <div class="card">
@@ -35,9 +40,12 @@
             </div>
             <hr>
           </section>
+        {% endblock sponsor_details %}
       {% empty %}
         <p>{% trans 'No sponsors yet.' %}</p>
       {% endfor %}
     </div>
+  {% endblock sponsor_list %}
+  {% block post_sponsor_list %}{% endblock %}
 </section>
-{% endblock %}
+{% endblock content %}
```

Copy link
Member

@hodgestar hodgestar left a comment

Choose a reason for hiding this comment

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

Thank you for the nice diff. The extra blocks look good to me.

@drnlm drnlm merged commit 9d3f5cf into CTPUG:master Mar 7, 2024
41 of 43 checks passed
@drnlm drnlm deleted the feature/more_sponsor_template_customisation branch March 8, 2024 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants