kopia lustrzana https://github.com/wagtail/wagtail
Pass task chooser URL via data attribute instead of chooserUrls
rodzic
499193d05c
commit
70242efa2c
|
@ -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) {
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Ładowanie…
Reference in New Issue