diff --git a/hc/front/tests/test_channels.py b/hc/front/tests/test_channels.py index f09a318f..bbea7a60 100644 --- a/hc/front/tests/test_channels.py +++ b/hc/front/tests/test_channels.py @@ -32,9 +32,10 @@ class ChannelsTestCase(BaseTestCase): r = self.client.get("/integrations/") self.assertEqual(r.status_code, 200) - self.assertContains(r, "http://down.example.com") - self.assertContains(r, "http://up.example.com") - self.assertContains(r, "foobar") + # These are inside a modal: + self.assertContains(r, "http://down.example.com") + self.assertContains(r, "http://up.example.com") + self.assertContains(r, "foobar") def test_it_shows_pushover_details(self): ch = Channel(kind="po", user=self.alice) diff --git a/static/css/channels.css b/static/css/channels.css index d4e5a364..6b6516b5 100644 --- a/static/css/channels.css +++ b/static/css/channels.css @@ -193,6 +193,26 @@ table.channels-table > tbody > tr > th { font-size: 16px; } +.channel-details table { + width: 100%; +} + +.channel-details td, .channel-details th { + padding: 15px; + border-bottom: 1px solid #eee; +} + +.channel-details tr:last-child td, .channel-details tr:last-child th { + border-bottom: 0; +} + + +.channel-details .missing { + color: #999; + font-style: italic; +} + + /* Add Webhook */ .webhook-header input.form-control { diff --git a/templates/front/channels.html b/templates/front/channels.html index eb178342..f6f98b71 100644 --- a/templates/front/channels.html +++ b/templates/front/channels.html @@ -70,32 +70,19 @@ {{ ch.value }} {% endif %} {% elif ch.kind == "webhook" %} - - {% if ch.url_down %} - - - - - {% endif %} - {% if ch.url_up %} - - - - - {% endif %} - {% if ch.post_data %} - - - - - {% endif %} - {% if ch.headers %} - - - - - {% endif %} -
down {{ ch.url_down }}
up {{ ch.url_up }}
body {{ ch.post_data }}
headers {{ ch.headers }}
+ {% if ch.url_down %} + down {{ ch.url_down }} + {% endif %} + {% if ch.url_up and not ch.url_down %} + up {{ ch.url_up }} + {% endif %} + {% if ch.url_up or ch.post_data or ch.headers %} + (details) + {% endif %} + + {% elif ch.kind == "pushbullet" %} API key {{ ch.value }} @@ -329,6 +316,72 @@ +{% for ch in channels %} +{% if ch.kind == "webhook" %} + +{% endif %} +{% endfor %} + {% endblock %} {% block scripts %}