Add js-page-model-attrs-items block to model attributes

Review Request #10979 — Created March 27, 2020 and submitted

hxqlin
Review Board
master
10873
b21a9e2...
reviewboard

This patch adds a js-page-model-attrs-items block to the js-page-model-attrs
block used to pass model attributes from the Django template to JavaScript views.
Admin views that add attributes to this block have been updated to override this
block with their own attributes as the super block is currently empty. This change
will allow for the Django template to pass attributes to the view for the future
admin setup banner.

Manual verification that admin pages still render correctly.

Description From Last Updated

The nice thing about spaceless is that we can add newlines and such. Let's put the block/endblock on their own ...

daviddavid

No need for the endblock name when it's immediately after a start block. Seems inconsistent, but the main reason we ...

chipx86chipx86

This shouldn't be needed in this change, since it's just redefining the same empty block from the parent template.

chipx86chipx86
david
  1. 
      
  2. reviewboard/templates/base.html (Diff revision 1)
     
     
     
     

    The nice thing about spaceless is that we can add newlines and such. Let's put the block/endblock on their own lines to make this more readable.

  3. 
      
hxqlin
chipx86
  1. This is looking great! Only one tiny thing stood out to me.

  2. No need for the endblock name when it's immediately after a start block.

    Seems inconsistent, but the main reason we go for a name in endblock is to avoid issues when there's content within, since that content may end up introducing some new blocks that confuse things. The rule isn't so useful in these very simplistic cases.

  3. 
      
hxqlin
chipx86
  1. 
      
  2. reviewboard/templates/admin/base_site.html (Diff revision 3)
     
     
     

    This shouldn't be needed in this change, since it's just redefining the same empty block from the parent template.

  3. 
      
hxqlin
chipx86
  1. Ship It!
  2. 
      
hxqlin
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-4.0.x (445af1c)
Loading...