]> git.ipfire.org Git - thirdparty/patchwork.git/commit
templatetags: add utils template filters and tags
authorRaxel Gutierrez <raxel@google.com>
Fri, 20 Aug 2021 04:50:24 +0000 (04:50 +0000)
committerDaniel Axtens <dja@axtens.net>
Mon, 23 Aug 2021 08:53:11 +0000 (18:53 +1000)
commit4a7c3f163a9493f9f5f3ea3497fbfd677abd0cee
tree715f744aaf36deeacd20c88d0346524b5200bf9d
parent38959bac4abb362ad577ca1da33cbca57fcd17a4
templatetags: add utils template filters and tags

Add utils.py file to create template filters and tags that can be used
by most if not all objects in Patchwork. In particular, add a template
filter to get the plural verbose name of a model and add a template tag
that returns whether an object is editable by the current user. These
utilities will be used in an upcoming patch that adds the `addressed`
status label to patch and cover comments.

Signed-off-by: Raxel Gutierrez <raxel@google.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Daniel Axtens <dja@axtens.net>
patchwork/templatetags/utils.py [new file with mode: 0644]