mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 00:07:02 -04:00
New template button creates new template for broadcast services
This commit is contained in:
@@ -153,13 +153,19 @@
|
|||||||
return changed;
|
return changed;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.$broadcastService = (document.querySelector('div[id=add_new_template_form]')).getAttribute("data-broadcast")
|
||||||
|
|
||||||
this.actionButtonClicked = function(event) {
|
this.actionButtonClicked = function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.currentState = $(event.currentTarget).val();
|
this.currentState = $(event.currentTarget).val();
|
||||||
|
|
||||||
if (this.stateChanged()) {
|
if (event.currentTarget.value === 'add-new-template' && this.$broadcastService) {
|
||||||
this.render();
|
return window.location = "/services/" + this.$broadcastService + "/templates/add-broadcast";
|
||||||
}
|
} else {
|
||||||
|
if (this.stateChanged()) {
|
||||||
|
this.render();
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
this.selectionStatus = {
|
this.selectionStatus = {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
{{ page_footer('Add new folder', button_name='operation', button_value='add-new-folder') }}
|
{{ page_footer('Add new folder', button_name='operation', button_value='add-new-folder') }}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
<div id="add_new_template_form">
|
<div id="add_new_template_form" {% if current_service.has_permission('broadcast') %}data-broadcast="{{current_service.id}}"{% endif %}>
|
||||||
<div class="js-will-stick-at-bottom-when-scrolling">
|
<div class="js-will-stick-at-bottom-when-scrolling">
|
||||||
{{ radios(templates_and_folders_form.add_template_by_template_type) }}
|
{{ radios(templates_and_folders_form.add_template_by_template_type) }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user