Browse Source

"show usage" button next to each check

pull/64/head
Pēteris Caune 9 years ago
parent
commit
820c7b1352
4 changed files with 20 additions and 10 deletions
  1. +2
    -1
      hc/front/views.py
  2. +11
    -2
      static/css/my_checks_desktop.css
  3. +1
    -1
      static/js/checks.js
  4. +6
    -6
      templates/front/my_checks_desktop.html

+ 2
- 1
hc/front/views.py View File

@ -51,7 +51,8 @@ def my_checks(request):
"now": timezone.now(), "now": timezone.now(),
"tags": counter.most_common(), "tags": counter.most_common(),
"down_tags": down_tags, "down_tags": down_tags,
"grace_tags": grace_tags
"grace_tags": grace_tags,
"ping_endpoint": settings.PING_ENDPOINT
} }
return render(request, "front/my_checks.html", ctx) return render(request, "front/my_checks.html", ctx)


+ 11
- 2
static/css/my_checks_desktop.css View File

@ -62,18 +62,27 @@ table.table tr > th.th-name {
visibility: hidden; visibility: hidden;
} }
.show-usage {
opacity: 0
}
tr:hover .check-menu { tr:hover .check-menu {
visibility: visible; visibility: visible;
} }
#show-urls.active, #show-emails.active {
color: #333;
tr:hover .show-usage {
opacity: 1
} }
#checks-table .url-cell { #checks-table .url-cell {
white-space: nowrap; white-space: nowrap;
} }
.url-cell .base {
color: #888;
}
.my-checks-url { .my-checks-url {
font-family: "Lucida Console", Monaco, monospace; font-family: "Lucida Console", Monaco, monospace;
font-size: 11.7px; font-size: 11.7px;


+ 1
- 1
static/js/checks.js View File

@ -176,7 +176,7 @@ $(function () {
}); });
$(".my-checks-url").click(function(e) {
$(".show-usage").click(function(e) {
var a = e.target; var a = e.target;
var url = a.getAttribute("href"); var url = a.getAttribute("href");
var email = a.getAttribute("data-email"); var email = a.getAttribute("data-email");


+ 6
- 6
templates/front/my_checks_desktop.html View File

@ -1,5 +1,4 @@
{% load hc_extras humanize %} {% load hc_extras humanize %}
<table id="checks-table" class="table hidden-xs"> <table id="checks-table" class="table hidden-xs">
<tr> <tr>
<th></th> <th></th>
@ -39,13 +38,14 @@
</div> </div>
</td> </td>
<td class="url-cell"> <td class="url-cell">
<span class="my-checks-url">
<span class="base">{{ ping_endpoint }}</span>{{ check.code }}
</span>
<a <a
href="{{ check.url }}" href="{{ check.url }}"
class="my-checks-url"
title="Click to show usage examples"
data-email="{{ check.email }}"
data-toggle="tooltip">
{{ check.url }}
class="btn btn-xs btn-default show-usage hidden-sm"
data-email="{{ check.email }}">
show usage
</a> </a>
</td> </td>
<td class="timeout-cell"> <td class="timeout-cell">


Loading…
Cancel
Save