Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
2c8a53bb
Commit
2c8a53bb
authored
4 years ago
by
Tom Teichler
Browse files
Options
Downloads
Patches
Plain Diff
Add documentation about tables in templates
parent
9f13bdd2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!333
Documentation for beta release (Documentation for first release part 1)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/dev/04_materialize_templates.rst
+15
-1
15 additions, 1 deletion
docs/dev/04_materialize_templates.rst
with
15 additions
and
1 deletion
docs/dev/04_materialize_templates.rst
+
15
−
1
View file @
2c8a53bb
...
...
@@ -37,10 +37,12 @@ The following snippet generates the form::
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{% form form=form %}{% endform %}
{% form form=
edit_person_
form %}{% endform %}
{% include "core/partials/save_button.html" %}
</form>
``edit_person_form`` is the variable name of the form in your ``context``.
``{% include "core/partials/save_button.html" %}`` includes a template snippet
from AlekSIS core. You can modify the buttons icon and translatable caption
like this::
...
...
@@ -69,5 +71,17 @@ In your ``forms.py`` you can configure the layout of the fields like in the Edit
),
)
Tables in templates
-------------------
To display tables generated by ``django-tables2`` in your template, you have to load the ``render_table`` template tag from ``django_tables2``::
{% load render_table from django_tables2 %}
After you've loaded the template tag, you can simply generate the table like this::
{% render_table persons_table %}
``persons_table`` is the variable name of the table in your ``context``.
.. _MaterializeCSS: https://materializecss.com/
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment