Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Modified badges to redirect to latest run for environment
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbal committed Oct 17, 2019
1 parent f9e5a36 commit d161385
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
{% endblocktrans %}
</p>
<span display="block" style='width: 250px;' class="common__BadgeWrapper-sc-16zh6vt-3 fagfmg">
<a href="{% url 'server_run:server-run_detail' object.uuid %}">
<a href="{% url 'server_run:server-run_latest' object.test_scenario.uuid object.environment.uuid %}">

<img id="badge" style='width:250px' alt="" src="">
</a>
Expand Down Expand Up @@ -383,10 +383,10 @@ <h5 class="card-title">HTML snippet</h5>
function setBadgeInfo() {
document.getElementById("badge-description").innerHTML = "Shown below is the badge of the most recent provider run with the environment {{ server_run.environment }} that was started by the user <b>{{ object.user }}</b>.";
document.getElementById("badge").src = "https://img.shields.io/endpoint.svg?style=for-the-badge&url={{changing_badge_url|urlencode}}";
var gitSnippet = '[![Status badge](https://img.shields.io/endpoint.svg?style=for-the-badge&url={{changing_badge_url|urlencode}})]({{changing_badge_url}})'
var gitSnippet = '[![Status badge](https://img.shields.io/endpoint.svg?style=for-the-badge&url={{changing_badge_url|urlencode}})]({{request.scheme}}://{{request.get_host}}{% url 'server_run:server-run_latest' object.test_scenario.uuid object.environment.uuid %})'

var htmlSnippet = '<span display="block" height="20px" class="common__BadgeWrapper-sc-16zh6vt-3 fagfmg">\n'
+ '<a href="{{request.scheme}}://{{request.get_host}}{% url 'server_run:server-run_detail' object.uuid %}">\n'
+ '<a href="{{request.scheme}}://{{request.get_host}}{% url 'server_run:server-run_latest' object.test_scenario.uuid object.environment.uuid %}">\n'
+ '<img style="width:100%" alt="" src="https://img.shields.io/endpoint.svg?style=for-the-badge&url={{changing_badge_url|urlencode}}"></span></a>'

// this page's own source code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<tr>
<td>
<span display="block" class="common__BadgeWrapper-sc-16zh6vt-3 fagfmg">
<a href="{% url 'server_run:server-run_list' test_scenario.uuid environment.uuid %}">
<a href="{% url 'server_run:server-run_latest' test_scenario.uuid environment.uuid %}">
<img style="height:30px" alt="" src="https://img.shields.io/endpoint.svg?style=for-the-badge&amp;url={{request.scheme}}://{{request.get_host}}{% url 'apiv1server:latest-badge' environment.uuid %}">
</a>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,5 @@
{{server_run.status_exec}}
{% endif %}
</td>
{% comment %} <td>
<span display="block" class="common__BadgeWrapper-sc-16zh6vt-3 fagfmg">
<a href="{% url 'server_run:server-run_detail' server_run.uuid %}">
<img style='height:30px ' alt="" src="https://img.shields.io/endpoint.svg?style=for-the-badge&amp;url={{request.scheme}}://{{request.get_host}}{% url 'apiv1server:api_server-run-shield' server_run.uuid %}">
</a>
</span>
</td> {% endcomment %}
</tr>
{% endspaceless %}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<td>
{% if last_run %}
<span display="block" class="common__BadgeWrapper-sc-16zh6vt-3 fagfmg">
<a href="{% url 'server_run:server-run_list' scenario.uuid environment.uuid %}">
<a href="{% url 'server_run:server-run_latest' scenario.uuid environment.uuid %}">
<img style="height:30px" alt="" src="https://img.shields.io/endpoint.svg?style=for-the-badge&amp;url={{request.scheme}}://{{request.get_host}}{% url 'apiv1server:latest-badge' environment.uuid %}">
</a>
</span>
Expand Down

0 comments on commit d161385

Please sign in to comment.