Skip to content
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

Closed
wants to merge 6 commits into from

Conversation

alfawal
Copy link

@alfawal alfawal commented Jun 29, 2023

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

Copy link

@github-actions github-actions bot left a 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 ⛵️!

Copy link
Member

@felixxm felixxm left a 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 %}
Copy link
Member

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 🤔

Copy link
Author

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.

@alfawal
Copy link
Author

alfawal commented Jun 30, 2023

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

@felixxm
Copy link
Member

felixxm commented Nov 20, 2023

@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".

title can already be customized with verbose_name/verbose_name_plural and using field-elements/table-body/table-headers will force users to rewrite almost the entire template, so they are not very useful either.

@felixxm felixxm closed this Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants