30 Constructor |
30 Constructor |
31 |
31 |
32 @param ui reference to the user interface object (UI.UserInterface) |
32 @param ui reference to the user interface object (UI.UserInterface) |
33 @param parent reference to the parent object (QObject) |
33 @param parent reference to the parent object (QObject) |
34 """ |
34 """ |
35 super(DjangoTagsMenuHandler, self).__init__(parent) |
35 super().__init__(parent) |
36 self.__ui = ui |
36 self.__ui = ui |
37 |
37 |
38 self.__findDialog = None |
38 self.__findDialog = None |
39 |
39 |
40 def closeAllWindows(self): |
40 def closeAllWindows(self): |
724 ["block_name"]) |
724 ["block_name"]) |
725 if ok: |
725 if ok: |
726 templateText = "{{% block {0} %}} {1} {{% endblock %}}".format( |
726 templateText = "{{% block {0} %}} {1} {{% endblock %}}".format( |
727 data[0], selectedText) |
727 data[0], selectedText) |
728 replace = True |
728 replace = True |
729 elif tag == "comment": |
|
730 templateText = "{{% comment %}} {0} {{% endcomment %}}".format( |
|
731 selectedText) |
|
732 replace = True |
|
733 elif tag == "csrf_token": |
729 elif tag == "csrf_token": |
734 templateText = "{% csrf_token %}" |
730 templateText = "{% csrf_token %}" |
735 elif tag == "cycle": |
731 elif tag == "cycle": |
736 data, ok = DjangoTagInputDialog.getText( |
732 data, ok = DjangoTagInputDialog.getText( |
737 None, |
733 None, |
1344 |
1340 |
1345 #################################################### |
1341 #################################################### |
1346 ## Comments ## |
1342 ## Comments ## |
1347 #################################################### |
1343 #################################################### |
1348 |
1344 |
|
1345 elif tag in ("comment", "multilinecommentselect"): |
|
1346 templateText = "{{% comment %}} {0} {{% endcomment %}}".format( |
|
1347 selectedText) |
|
1348 replace = True |
1349 elif tag == "singlelinecommentselect": |
1349 elif tag == "singlelinecommentselect": |
1350 templateText = '{{# {0} #}}'.format(selectedText) |
1350 templateText = '{{# {0} #}}'.format(selectedText) |
1351 replace = True |
|
1352 elif tag == "multilinecommentselect": |
|
1353 templateText = '{{% comment %}} {0} {{% endcomment %}}'.format( |
|
1354 selectedText) |
|
1355 replace = True |
1351 replace = True |
1356 elif tag == "singlelinecommentdialog": |
1352 elif tag == "singlelinecommentdialog": |
1357 data, ok = DjangoTagInputDialog.getText( |
1353 data, ok = DjangoTagInputDialog.getText( |
1358 None, |
1354 None, |
1359 self.tr("Single Line Comment"), |
1355 self.tr("Single Line Comment"), |