Changeset 65b6daf9 in trunk


Ignore:
Timestamp:
2020-04-27T20:44:06Z (5 years ago)
Author:
Sajith Sasidharan <sajith@…>
Branches:
master
Children:
c86d434
Parents:
110528f5
git-author:
Sajith Sasidharan <sajith@…> (2020-04-27 20:43:47)
git-committer:
Sajith Sasidharan <sajith@…> (2020-04-27 20:44:06)
Message:

Rewrite incident button using twisted tags

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/allmydata/web/root.py

    r110528f5 r65b6daf9  
    568568        return T.div[form]
    569569
    570     def render_incident_button(self, ctx, data):
     570    @renderer
     571    def incident_button(self, req, tag):
    571572        # this button triggers a foolscap-logging "incident"
    572         form = T.form(action="report_incident", method="post",
    573                       enctype="multipart/form-data")[
    574             T.fieldset[
    575             T.input(type="hidden", name="t", value="report-incident"),
    576             "What went wrong?"+SPACE,
    577             T.input(type="text", name="details"), SPACE,
    578             T.input(type="submit", value=u"Save \u00BB"),
    579             ]]
    580         return T.div[form]
     573        form = tags.form(
     574            tags.fieldset(
     575                tags.input(type="hidden", name="t", value="report-incident"),
     576                "What went wrong?"+SPACE,
     577                tags.input(type="text", name="details"), SPACE,
     578                tags.input(type="submit", value=u"Save \u00BB"),
     579            ),
     580            action="report_incident",
     581            method="post",
     582            enctype="multipart/form-data"
     583        )
     584        return tags.div(form)
Note: See TracChangeset for help on using the changeset viewer.