Pass task chooser URL via data attribute instead of chooserUrls

pull/6384/head
Matt Westcott 2020-09-30 18:10:47 +01:00 zatwierdzone przez Matt Westcott
rodzic 499193d05c
commit 70242efa2c
3 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -6,7 +6,7 @@ function createTaskChooser(id) {
$('.action-choose', chooserElement).on('click', function() {
ModalWorkflow({
url: window.chooserUrls.taskChooser,
url: chooserElement.data('chooserUrl'),
onload: TASK_CHOOSER_MODAL_ONLOAD_HANDLERS,
responses: {
taskChosen: function(data) {

Wyświetl plik

@ -12,7 +12,6 @@
'emailLinkChooser': '{% url "wagtailadmin_choose_page_email_link" %}',
'phoneLinkChooser': '{% url "wagtailadmin_choose_page_phone_link" %}',
'anchorLinkChooser': '{% url "wagtailadmin_choose_page_anchor_link" %}',
'taskChooser': '{% url "wagtailadmin_workflows:task_chooser" %}',
};
window.unicodeSlugsEnabled = {% if unicode_slugs_enabled %}true{% else %}false{% endif %};
</script>

Wyświetl plik

@ -1,5 +1,6 @@
{% extends "wagtailadmin/widgets/chooser.html" %}
{% block chooser_class %}task-chooser{% endblock %}
{% block chooser_attributes %}data-chooser-url="{% url "wagtailadmin_workflows:task_chooser" %}"{% endblock %}
{% block chosen_state_view %}
<span class="name">{{ task.name }}</span>