Skip to content

Commit

Permalink
update templates to use blueprints
Browse files Browse the repository at this point in the history
  • Loading branch information
thepsalmist committed Mar 25, 2024
1 parent cb48a10 commit 9d6a088
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 16 deletions.
5 changes: 3 additions & 2 deletions ckanext/openafrica/blueprint.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from flask import Blueprint
from ckan.plugins.toolkit import render

openafrica = Blueprint('datapusher', __name__)
openafrica = Blueprint('openafrica', __name__)

def toc():
return render('home/about/toc.html')
Expand Down Expand Up @@ -33,7 +33,8 @@ def atlas():
("/about/code-of-conduct", "coc", coc),
("/about/moderation-policy", "moderation", moderation),
("/about/faq", "faq", faq),
("/about/privacy", "privacy", privacy)
("/about/privacy", "privacy", privacy),
("/about/contact", "contact", contact)
]

for rule in rules:
Expand Down
5 changes: 2 additions & 3 deletions ckanext/openafrica/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class OpenAfricaPlugin(plugins.SingletonPlugin):
u"""
openAFRICA templating plugin.
"""
plugins.implements(plugins.IConfigurer)
plugins.implements(plugins.ITemplateHelpers)
plugins.implements(plugins.IConfigurer, inherit=True)
plugins.implements(plugins.ITemplateHelpers, inherit=True)
plugins.implements(plugins.IBlueprint)

def update_config(self, config):
Expand All @@ -43,7 +43,6 @@ def update_config(self, config):
"""
toolkit.add_template_directory(config, 'templates')
toolkit.add_public_directory(config, 'public')
# toolkit.add_resource('fanstatic', 'openafrica')
toolkit.add_resource('assets', 'openafrica')

# IBlueprint
Expand Down
2 changes: 1 addition & 1 deletion ckanext/openafrica/templates/dataset-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{% block flash %}
<div class="flash-messages">
{% block flash_inner %}
{% for message in h.flash.pop_messages() | list %}
{% for message in h.flash.pop_messages | list %}
<div class="alert fade in {{ message.category }}">
{{ h.literal(message) }}
</div>
Expand Down
4 changes: 2 additions & 2 deletions ckanext/openafrica/templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<!-- Be sure to leave the brand out there if you want it shown -->
{% block header_logo %}
{% if g.site_logo %}
<a class="logo brand" href="{{ h.url('home') }}"><img src="{{ g.site_logo }}" alt="{{ g.site_title }}"
<a class="logo brand" href="{{ h.url_for('home.index') }}"><img src="{{ g.site_logo }}" alt="{{ g.site_title }}"
title="{{ g.site_title }}" /></a>
{% else %}
<a class="brand" href="{{ h.url('home') }}"><img
<a class="brand" href="{{ h.url_for('home.index') }}"><img
src="https://cloud.githubusercontent.com/assets/877919/14067805/7e3ff5ae-f476-11e5-88eb-059d88816232.png"
alt="{{ g.site_title }}" title="{{ g.site_title }}" /></a>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion ckanext/openafrica/templates/home/about/accessibility.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{% block breadcrumb_content %}
<li >{% link_for _('About'), controller='home', action='about' %}</li>
<li class="active">{% link_for _('Accessibility'), controller='ckanext.openafrica.controller:CustomPageController', action='accessibility' %}</li>
<li class="active">{% link_for _('Accessibility'), named_route='openafrica.accessibility' %}</li>
{% endblock %}

{% block primary %}
Expand Down
2 changes: 1 addition & 1 deletion ckanext/openafrica/templates/home/about/coc.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{% block breadcrumb_content %}
<li >{% link_for _('About'), controller='home', action='about' %}</li>
<li class="active">{% link_for _('Code of Conduct'), controller='ckanext.openafrica.controller:CustomPageController', action='coc' %}</li>
<li class="active">{% link_for _('Code of Conduct'), named_route='openafrica.coc' %}</li>
{% endblock %}

{% block primary %}
Expand Down
2 changes: 1 addition & 1 deletion ckanext/openafrica/templates/home/about/contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{% block breadcrumb_content %}
<li >{% link_for _('About'), controller='home', action='about' %}</li>
<li class="active">{% link_for _('Contact Us'), controller='ckanext.openafrica.controller:CustomPageController', action='contact' %}</li>
<li class="active">{% link_for _('Contact Us'), named_route='openafrica.contact' %}</li>
{% endblock %}

{% block primary %}
Expand Down
2 changes: 1 addition & 1 deletion ckanext/openafrica/templates/home/about/faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{% block breadcrumb_content %}
<li >{% link_for _('About'), controller='home', action='about' %}</li>
<li class="active">{% link_for _('FAQs'), controller='ckanext.openafrica.controller:CustomPageController', action='faq' %}</li>
<li class="active">{% link_for _('FAQs'), named_route='openafrica.faq' %}</li>
{% endblock %}

{% block primary %}
Expand Down
2 changes: 1 addition & 1 deletion ckanext/openafrica/templates/home/about/moderation.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{% block breadcrumb_content %}
<li >{% link_for _('About'), controller='home', action='about' %}</li>
<li class="active">{% link_for _('Moderation Policy'), controller='ckanext.openafrica.controller:CustomPageController', action='moderation' %}</li>
<li class="active">{% link_for _('Moderation Policy'), named_route='openafrica.moderation' %}</li>
{% endblock %}

{% block primary %}
Expand Down
2 changes: 1 addition & 1 deletion ckanext/openafrica/templates/home/about/privacy.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{% block breadcrumb_content %}
<li >{% link_for _('About'), controller='home', action='about' %}</li>
<li class="active">{% link_for _('Privacy'), controller='ckanext.openafrica.controller:CustomPageController', action='privacy' %}</li>
<li class="active">{% link_for _('Privacy'), named_route='openafrica.privacy' %}</li>
{% endblock %}

{% block primary %}
Expand Down
2 changes: 1 addition & 1 deletion ckanext/openafrica/templates/home/about/toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{% block breadcrumb_content %}
<li >{% link_for _('About'), controller='home', action='about' %}</li>
<li class="active">{% link_for _('Terms & Conditions'), controller='ckanext.openafrica.controller:CustomPageController', action='toc' %}</li>
<li class="active">{% link_for _('Terms & Conditions'), named_route='openafrica.toc' %}</li>
{% endblock %}

{% block primary %}
Expand Down
2 changes: 1 addition & 1 deletion ckanext/openafrica/templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{% block flash %}
<div class="flash-messages">
{% block flash_inner %}
{% for message in h.flash.pop_messages() | list %}
{% for message in h.flash.pop_messages | list %}
<div class="alert fade in {{ message.category }}">
{{ h.literal(message) }}
</div>
Expand Down

0 comments on commit 9d6a088

Please sign in to comment.