Roundup Tracker - Issues

Message6712

Author garth
Recipients garth, schlatterbeck
Date 2019-10-07.19:06:28
Message-id <1570475189.22.0.498722733914.issue2551065@roundup.psfhosted.org>
In-reply-to
I'm trying use Bootstrap to give my tracker a responsive interface.  
It works mostly through specifying designated class attributes on 
html tags.   

One place I'm running into the problem is on the button for 
submitting changes when editing an issue.  This button is generated 
in issues.item.html by  the tag: <span tal:replace="structure 
context/submit">submit button</span>.  The context/submit part 
returns the submit button and the associated @action and @csrf 
hidden fields:

<input type="hidden" name="@csrf" 
value="afeeb2035b1440efd94c85cda88e322c29f83d531e030785bdd53fdf89a8e
52b">
<input type="hidden" name="@action" value="edit">
<input type="submit" name="submit_button" value="Submit Changes">

To make the button styled per Bootstrap, I need to attach the 
attribute `class="btn btn-primary"` to the last input tag.  The only 
hope I have for doing that is by using tal:attributes on the 
original tag as follows:  

<span>tal:replace="structure context/submit" tal:attributes="class 
string:btn btn-primary">submit button</span>.  

Of course it didn't work originally because the class attribute gets 
attached to the first tag, which isn't the submit button.

context/submit gets delegated to either the HTMLClass.submit or 
_HTMLItem.submit methods in templating.py.  I went ahead and changed 
the order of tags returned by those methods, and that seemed to do 
the trick.  The patch file is attached.
History
Date User Action Args
2019-10-07 19:06:29garthsetmessageid: <1570475189.22.0.498722733914.issue2551065@roundup.psfhosted.org>
2019-10-07 19:06:29garthsetrecipients: + garth, schlatterbeck
2019-10-07 19:06:29garthlinkissue2551065 messages
2019-10-07 19:06:29garthcreate