Skip to content

GNIP 2 Template refactor: Conventions and extensions

jj0hns0n edited this page Jan 7, 2012 · 1 revision

GNIP 2 - Template refactor: Conventions and extensions

Overview

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.

Proposed By

Ariel Nuñez

Assigned to Release

TBD.

State

Under Discussion

Motivation

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.

Proposal

Use Django conventions for naming templates

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.

Naming blocks to provide extension points

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 %}

Adding the template name as a keyword argument to each view.

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.

Separating maps specific templates and site specific templates.

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.

Alternatives

No alternatives yet.

Feedback

No feedback yet.

Voting

No votes yet.

Clone this wiki locally