New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed #14810 -- Added reusable blocks to the inline templates #17030
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello! Thank you for your contribution 💪
As it's your first contribution be sure to check out the patch review checklist.
If you're fixing a ticket from Trac make sure to set the "Has patch" flag and include a link to this PR in the ticket!
If you have any design or process questions then you can ask in the Django forum.
Welcome aboard ⛵️!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alfawal Thanks for this patch 👍 I doubts if this is really useful, especially for tabular.html
.
Can you start a discussion on the Django Forum to reach a wider audience and check out what other think?
Also, release notes are missing.
</thead> | ||
|
||
<tbody> | ||
{% block table-body %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH, I'm not sure that adding these blocks to tabular.html
makes sense as users still have to rewrite the entire table 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block is problematic, splitting it into blocks would be a bit inconvenient. With this split I think it would be mostly used as block.super and then extending it. I'll ask in the forum.
I've opened up a new topic in the Django Forum to see what others want! https://forum.djangoproject.com/t/adding-blocks-to-the-stacked-tabular-inline-templates/21969 |
@alfawal Thanks for this patch and all your efforts 👍 However, do to the lack of any replies on the forum, only a few replies in the ticket, and strong doubts as to whether this is really useful, I'll close the ticket as "wontfix".
|
There was no blocks in the inline templates which takes away the inheritance opportunity.
I believe that this change is going to open up a new door for developers who wish to adjust the inlines!
The added blocks:
Tabular:
title
table-headers
table-body
Stacked:
title
field-elements
I wanted to write some tests but I'm not sure if its necessary.
The scenario would be, creating a template using the blocks and testing whether the content is contained inside of the response.
ticket-14810