Pēteris Caune
5 years ago
No known key found for this signature in database
GPG Key ID: E28D7679E9A9EDE2
8 changed files with 122 additions and 12 deletions
-
1CHANGELOG.md
-
18hc/front/tests/test_copy.py
-
1hc/front/urls.py
-
22hc/front/views.py
-
22static/css/details.css
-
32templates/front/copy_modal.html
-
32templates/front/details.html
-
6templates/front/remove_check_modal.html
@ -0,0 +1,18 @@ |
|||
from hc.api.models import Channel, Check |
|||
from hc.test import BaseTestCase |
|||
|
|||
|
|||
class CopyCheckTestCase(BaseTestCase): |
|||
def setUp(self): |
|||
super(CopyCheckTestCase, self).setUp() |
|||
self.check = Check(project=self.project) |
|||
self.check.name = "Foo" |
|||
self.check.save() |
|||
|
|||
self.copy_url = "/checks/%s/copy/" % self.check.code |
|||
|
|||
def test_it_works(self): |
|||
self.client.login(username="alice@example.org", password="password") |
|||
r = self.client.post(self.copy_url, follow=True) |
|||
self.assertContains(r, "This is a brand new check") |
|||
self.assertContains(r, "Foo (copy)") |
@ -0,0 +1,32 @@ |
|||
<div id="copy-modal" class="modal"> |
|||
<div class="modal-dialog"> |
|||
<form action="{% url 'hc-copy' check.code %}" method="post"> |
|||
{% csrf_token %} |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
<button type="button" class="close" data-dismiss="modal">×</button> |
|||
<h4>Create a Copy of This Check</h4> |
|||
</div> |
|||
<div class="modal-body"> |
|||
<p>You are about to <strong>create a new check based on this |
|||
check's configuration</strong>. The following items will |
|||
get copied:</p> |
|||
<ul class="checkmarks"> |
|||
<li>Name, tags and description</li> |
|||
<li>Schedule</li> |
|||
<li>Assigned notification methods</li> |
|||
</ul> |
|||
<p>The following items <em>will not</em> be copied:</p> |
|||
<ul class="crosses"> |
|||
<li>Its URL (a new URL will be generated)</li> |
|||
<li>The log of already received pings</li> |
|||
</ul> |
|||
</div> |
|||
<div class="modal-footer"> |
|||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> |
|||
<button type="submit" class="btn btn-primary">Create a Copy</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue