-
-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33909 from dimagi/mk/3235-edit-banner
Add ability to edit domain banners / alerts
- Loading branch information
Showing
7 changed files
with
205 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
hqDefine("domain/js/manage_alerts",[ | ||
'jquery', | ||
'knockout', | ||
'underscore', | ||
'hqwebapp/js/initial_page_data', | ||
], function ($, initialPageData) { | ||
], function ($, ko, _, initialPageData) { | ||
|
||
var domainAlert = function (options) { | ||
var self = ko.mapping.fromJS(options); | ||
self.editUrl = initialPageData.reverse('domain_edit_alert', self.id()); | ||
return self; | ||
}; | ||
|
||
$(function () { | ||
$('#ko-alert-container').koApplyBindings({ | ||
'alerts': initialPageData.get('alerts'), | ||
'alerts': _.map(initialPageData.get('alerts'), domainAlert), | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{% extends "hqwebapp/bootstrap3/base_section.html" %} | ||
{% load crispy_forms_tags %} | ||
{% load i18n %} | ||
|
||
{% block page_content %} | ||
<form class="form form-horizontal" method="post"> | ||
<fieldset> | ||
<legend>{% trans 'Edit Alert' %}</legend> | ||
{% crispy form %} | ||
</fieldset> | ||
</form> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters