Templates
In django templates can be overwritten and modified by other apps.
Juntagrico provides template snippets or template blocks, that allow you to modify parts of certain templates, e.g., descriptive text or menu entries.
Note
Templates or template blocks that are not documented in this reference may change in future versions without notice. Changing undocumented and will increase your maintenance work.
If you think the changes you want to make could also benefit other juntagrico users, consider opening an issue, suggesting your changes to juntagrico directly. If you need your changes quickly, you may still want to override the templates as described here.
Hint
Some texts, e.g. of forms, do not appear in the template. To change these see below
Set up Template Overrides
The instructions for overriding templates in django can be found in the the official documentation. Roughly these are the steps:
In the
settings.pyeither enable theapp_directoriestemplate loader or setAPP_DIRSto True on theTEMPLATESsetting. And make sure that the app with the template overrides is somewhere above'juntagrico'in theINSTALLED_APPSAlternatively, you can set
DIRSto yourTEMPLATESsettings to the folder where you will place the template overrides.
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True, # Option 1: This is needed for addons that override templates
'DIRS': [os.path.join(BASE_DIR, 'templates')], # Option 2: location of your overriding templates
# ...
},
]
Create a template file in your templates folder (in your app or in the project root, depending on the above setting) with the same path as the template file in juntagrico, that you want to override.
The project will now use your copy of the template instead of the original. If you only want to modify certain blocks on that template, extend the original template and modify the block(s) like this:
{% extends "path/to/this/template.html" %}
{% block block_to_override %}
{{ block.super }} {#% insert the original content of this block, if you want %#}
{#% add your own block content %#}
{% endblock %}
Email Templates
Email Templates can be overridden in the same way as every other template. Read the Notification reference to see which email templates exist.
Signup Templates
All signup pages have these 2 blocks to override:
title: Text of the titleintro: Text after the title
The signup templates are located in the folder createsubscription.
Some pages have additional blocks listed below.
juntagrico/signup/member.html
intro_1: First part of introintro_with_shares: Part of intro, about sharesintro_2Last part of introread_instructions: Text on documents that should be read
juntagrico/form/layout/category_container.html
Defines the structure to display subscription categories in the subscription/part order and change forms
Blocks:
head: Name and description of categoryfields: Nested fields
juntagrico/form/layout/bundle_container.html
Defines the structure to display subscription bundles in the subscription/part order and change forms.
Has the same blocks as category_container.html.
juntagrico/subscription/create/form/no_subscription_field.html
description: Textlabel on signup option without subscriptionbase_fee: Base fee description on signup option without subscription
juntagrico/subscription/create/select_depot.html
label: of depot selection field
juntagrico/subscription/create/select_start_date.html
label: Label of date selection fieldhint: text below selection field
juntagrico/subscription/create/summary.html
Each section has a block:
profilesubscriptiondepotstart_dateco_memberactivity_areassharescomment
Subscription Templates
juntagrico/my/subscription/single.html|extend
Add content to the subscription overview page, for members that have a subscription.
juntagrico/my/subscription/none.html|extend
Add content to the subscription overview page, for members that have no subscription.
Depot Templates
juntagrico/my/depot/show.html
Each section has a block to overwrite or extend it:
addresspickupcontactdescriptionaccess_informationmap
Activity Area Templates
juntagrico/my/area/snippets/intro.html
Intro text on the activity area overview page
all: Use this block if you want to append or prepend text
juntagrico/my/area/list.html
intro: Intro including structure. To just change the text, overridesnippets/intro.html. See above.list: Entire list of activity areassection_head: Title above area list. If core areas exist separate titles are shown for core and non-core areas.area_list: List structure of activity areasarea: Display of activity area in list elementcoordinated_areas: List of areas coordinated by this user
juntagrico/my/area/show.html
join: Slider to join activity areadescription: Full description structuredescription_text: Description Textcontacts: List of activity area contactsmembers: Count and link to member list for adminsupcoming: List of upcoming jobs in activity area
Membership Templates
juntagrico/my/membership/cancel.html
intro: Text after title
juntagrico/my/membership/profile.html
Blocks exist for the text in the info banner on top and for the buttons
info_canceledinfo_activebutton_change_passwordbutton_cancel_membership
Widget Templates
juntagrico/widgets/assignment_progress.html|progress
Change appearance of the assignment progress widget in menu.
E.g. to use the bean icon indicators of previous juntagrico versions do:
{% extends 'juntagrico/widgets/assignment_progress.html' %}
{% load juntagrico.widgets %}
{% block progress %}
{% assignment_progress request.user.member future=False as assignments %}
{% include "./assignment_progress/classic.html" %}
{% endblock %}
The future argument on assignment_progress specifies if planned future assignments are counted as well:
None: Count future assignments
False: Don’t count future assignments
True: Count future assignments separately. This is not supported by the classic assignments widget.