-
Notifications
You must be signed in to change notification settings - Fork 1.1k
GNIP 2 Template refactor: Conventions and extensions
Reorganize template structure to separate maps templates to site wide ones and add extension points like template name as a keyword argument in the views and named blocks in the body, header and side bars of maps / layers and upload templates.
Ariel Nuñez
TBD.
Under Discussion
As part of the GeoNode extensions that are being created (events app and cartography app) a need has arisen to modify some of the layer, map and upload templates. Using Django conventions for template names and separating the maps templates and the site wide templates would make it easier to restructure the repo in new versions of GeoNode.
base.html, /_list.html and />_detail.html
This would make it easier to integrate third party apps and more understandable for Django devs trying to use GeoNode.
This should be an ongoing job but a good start can be done in the maps_detail, layer_detail and layer_upload views for all the important parts, specifically ways to change or extend what is shown in the main bar and sidebar. Many of these extension points will be blank by default, like: {% block extra_header %}{ % endblock %}
Instead of hard coding them inside the view, they would be something like:
def map(request, template_name="maps/map_detail.html): ...
With this change, another template can be selected just by overriding urls.py and passing another template_name to the view.
This would allow a future separation of the maps application and the sample GeoNode website, just like it was done with the media during the media refactor.
No alternatives yet.
No feedback yet.
No votes yet.