summaryrefslogtreecommitdiffstats
path: root/non-puppet/qtmetrics2
diff options
context:
space:
mode:
authorJuha Sippola <juhasippola@outlook.com>2015-08-05 11:32:30 +0300
committerTony Sarajärvi <tony.sarajarvi@theqtcompany.com>2015-09-16 07:34:36 +0000
commita99be616162ea0706ebf4c01ae9e983a2cb04fb3 (patch)
tree058f9370a5b0adc93cde1da5d573e386b849fea9 /non-puppet/qtmetrics2
parent18f934238b78b7c8bdb9f4965f7fd5fef2fed218 (diff)
Qt Metrics 2 (v0.18): Url encoding
Added url encoding for platform, testset and project links (if not already used). This solves html validator errors e.g. for testsets that have a space in their name. Change-Id: I98bd724df5e732d40f6e0e7e9d990487b4128cb2 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
Diffstat (limited to 'non-puppet/qtmetrics2')
-rw-r--r--non-puppet/qtmetrics2/index.php4
-rw-r--r--non-puppet/qtmetrics2/templates/about.html2
-rw-r--r--non-puppet/qtmetrics2/templates/build_project.html2
-rw-r--r--non-puppet/qtmetrics2/templates/conf.html4
-rw-r--r--non-puppet/qtmetrics2/templates/home.html5
-rw-r--r--non-puppet/qtmetrics2/templates/overview.html2
-rw-r--r--non-puppet/qtmetrics2/templates/testset.html4
-rw-r--r--non-puppet/qtmetrics2/templates/testsets_flaky.html5
-rw-r--r--non-puppet/qtmetrics2/templates/testsets_top.html5
9 files changed, 15 insertions, 18 deletions
diff --git a/non-puppet/qtmetrics2/index.php b/non-puppet/qtmetrics2/index.php
index 367650d..909e1c0 100644
--- a/non-puppet/qtmetrics2/index.php
+++ b/non-puppet/qtmetrics2/index.php
@@ -457,7 +457,7 @@ if (isset($_POST["projectInputSubmit"])) {
}
if (isset($_POST["projectInputValue"])) {
$project = htmlspecialchars($_POST['projectInputValue']);
- header('Location: ' . Slim\Slim::getInstance()->urlFor('root') . 'testsetproject/' . $project);
+ header('Location: ' . Slim\Slim::getInstance()->urlFor('root') . 'testsetproject/' . urlencode($project));
exit();
}
}
@@ -475,7 +475,7 @@ if (isset($_POST["testsetInputSubmit"])) {
$string = explode(' (in ', htmlspecialchars($_POST['testsetInputValue'])); // the separator must match with that used in testset_search.php
$testset = $string[0];
$project = str_replace(')', '', $string[1]);
- header('Location: ' . Slim\Slim::getInstance()->urlFor('root') . 'testset/' . $testset . '/' . $project);
+ header('Location: ' . Slim\Slim::getInstance()->urlFor('root') . 'testset/' . urlencode($testset) . '/' . urlencode($project));
exit();
}
}
diff --git a/non-puppet/qtmetrics2/templates/about.html b/non-puppet/qtmetrics2/templates/about.html
index 1849b32..c15320d 100644
--- a/non-puppet/qtmetrics2/templates/about.html
+++ b/non-puppet/qtmetrics2/templates/about.html
@@ -43,4 +43,4 @@
<p>This is Qt Metrics revision 2 with redesigned UI and database.</p>
<p>These pages are still <strong>under construction</strong> and therefore the views and functionality is limited.</p>
<p>See the <a href="https://wiki.qt.io/Qt_Metrics_2_Backlog" target="_blank">backlog</a> for development items currently identified or in progress.</p>
-<p><small>Version 0.17 (03-Aug-2015)</small></p>
+<p><small>Version 0.18 (03-Aug-2015)</small></p>
diff --git a/non-puppet/qtmetrics2/templates/build_project.html b/non-puppet/qtmetrics2/templates/build_project.html
index 5f51f0c..70f0b2e 100644
--- a/non-puppet/qtmetrics2/templates/build_project.html
+++ b/non-puppet/qtmetrics2/templates/build_project.html
@@ -96,7 +96,7 @@
{% set buttonStyle = 'btn-default' %}
{% endif %}
<div class="btn-group">
-<a class="btn {{ buttonStyle }} btn-xs" href="{{ buildPlatformRoute }}/{{ platform.os }}" role="button">{{ platform.os }}</a>
+<a class="btn {{ buttonStyle }} btn-xs" href="{{ buildPlatformRoute }}/{{ platform.os|url_encode }}" role="button">{{ platform.os }}</a>
</div>
{% endfor %}
</div>
diff --git a/non-puppet/qtmetrics2/templates/conf.html b/non-puppet/qtmetrics2/templates/conf.html
index 63d3d3d..cf96dd8 100644
--- a/non-puppet/qtmetrics2/templates/conf.html
+++ b/non-puppet/qtmetrics2/templates/conf.html
@@ -499,8 +499,8 @@ title="<table>
{% endif %}
<tr>
{# Testset and project name #}
-<td><a href="{{ testsetRoute }}/{{ run.getName }}/{{ run.getTestsetProjectName }}"><small>{{ run.getName }}</small></a></td>
-<td><a href="{{ testsetProjectRoute }}/{{ run.getTestsetProjectName }}"><small>{{ run.getTestsetProjectName }}</small></a></td>
+<td><a href="{{ testsetRoute }}/{{ run.getName|url_encode }}/{{ run.getTestsetProjectName|url_encode }}"><small>{{ run.getName }}</small></a></td>
+<td><a href="{{ testsetProjectRoute }}/{{ run.getTestsetProjectName|url_encode }}"><small>{{ run.getTestsetProjectName }}</small></a></td>
{# Flags for the latest build #}
<td class="center rightBorder">
{% if run.getInsignificant %}
diff --git a/non-puppet/qtmetrics2/templates/home.html b/non-puppet/qtmetrics2/templates/home.html
index 3ece3b6..00e3828 100644
--- a/non-puppet/qtmetrics2/templates/home.html
+++ b/non-puppet/qtmetrics2/templates/home.html
@@ -34,8 +34,7 @@
/**
* Home page
- * @version 0.6
- * @since 10-07-2015
+ * @since 03-08-2015
* @author Juha Sippola
*/
@@ -81,7 +80,7 @@
<div>
{% for platform in platforms %}
<div class="btn-group">
-<a class="btn btn-primary btn-xs" href="{{ platformRoute }}/{{ platform.os }}" role="button">{{ platform.os }}</a>
+<a class="btn btn-primary btn-xs" href="{{ platformRoute }}/{{ platform.os|url_encode }}" role="button">{{ platform.os }}</a>
</div>
{% endfor %}
</div>
diff --git a/non-puppet/qtmetrics2/templates/overview.html b/non-puppet/qtmetrics2/templates/overview.html
index a7907c8..913fc2a 100644
--- a/non-puppet/qtmetrics2/templates/overview.html
+++ b/non-puppet/qtmetrics2/templates/overview.html
@@ -177,7 +177,7 @@ title="<table>
{% for project in projects %}
<tr>
{# Project name #}
-<td class="rightBorder"><a href="{{ testsetProjectRoute }}/{{ project }}">{{ project }}</a></td>
+<td class="rightBorder"><a href="{{ testsetProjectRoute }}/{{ project|url_encode }}">{{ project }}</a></td>
{# Result (by branch) #}
{% for branch in branches %}
diff --git a/non-puppet/qtmetrics2/templates/testset.html b/non-puppet/qtmetrics2/templates/testset.html
index c4a0462..932846b 100644
--- a/non-puppet/qtmetrics2/templates/testset.html
+++ b/non-puppet/qtmetrics2/templates/testset.html
@@ -152,7 +152,7 @@ and their configuration on <strong>{{ masterProject }} {{ masterState }}</strong
{# Print summary #}
<tr>
{# Project name #}
-<td><a href="{{ testsetProjectRoute }}/{{ testset.getProjectName }}">{{ testset.getProjectName }}</a></td>
+<td><a href="{{ testsetProjectRoute }}/{{ testset.getProjectName|url_encode }}">{{ testset.getProjectName }}</a></td>
{# Testset status according to the latest build results #}
{% if testset.getStatus == constant('TestsetRun::RESULT_SUCCESS') %}
@@ -292,7 +292,7 @@ and their configuration on <strong>{{ masterProject }} {{ masterState }}</strong
</tr>
{% endif %}
<tr>
-{% set link = confProjectRoute ~ '/' ~ run.getConfName|url_encode ~ '/' ~ testset.getProjectName %}
+{% set link = confProjectRoute ~ '/' ~ run.getConfName|url_encode ~ '/' ~ testset.getProjectName|url_encode %}
<td class="rightBorder"><a href="{{ link }}"><small>{{ run.getConfName }}</small></a></td>
{# Flags for the latest build #}
<td class="center rightBorder">
diff --git a/non-puppet/qtmetrics2/templates/testsets_flaky.html b/non-puppet/qtmetrics2/templates/testsets_flaky.html
index d54c9eb..45d3ccf 100644
--- a/non-puppet/qtmetrics2/templates/testsets_flaky.html
+++ b/non-puppet/qtmetrics2/templates/testsets_flaky.html
@@ -34,8 +34,7 @@
/**
* Flaky testsets page
- * @version 0.4
- * @since 10-07-2015
+ * @since 03-08-2015
* @author Juha Sippola
*/
@@ -117,7 +116,7 @@ the testset is flaky (during the last {{ lastDays }} days).</li>
{% for testset in testsets %}
<tr>
{# Testset name #}
-<td><a href="{{ testsetRoute }}/{{ testset.getName }}/{{ testset.getProjectName }}">{{ testset.getName }}</a></td>
+<td><a href="{{ testsetRoute }}/{{ testset.getName|url_encode }}/{{ testset.getProjectName|url_encode }}">{{ testset.getName }}</a></td>
{# Project name #}
<td>{{ testset.getProjectName }}</td>
diff --git a/non-puppet/qtmetrics2/templates/testsets_top.html b/non-puppet/qtmetrics2/templates/testsets_top.html
index 3b95a9b..dde9f3e 100644
--- a/non-puppet/qtmetrics2/templates/testsets_top.html
+++ b/non-puppet/qtmetrics2/templates/testsets_top.html
@@ -34,8 +34,7 @@
/**
* Top failures (testsets) page
- * @version 0.5
- * @since 10-07-2015
+ * @since 03-08-2015
* @author Juha Sippola
*/
@@ -120,7 +119,7 @@ builds where it failed during the last {{ lastDays }} days.</li>
{% for testset in testsets %}
<tr>
{# Testset name #}
-<td><a href="{{ testsetRoute }}/{{ testset.getName }}/{{ testset.getProjectName }}">{{ testset.getName }}</a></td>
+<td><a href="{{ testsetRoute }}/{{ testset.getName|url_encode }}/{{ testset.getProjectName|url_encode }}">{{ testset.getName }}</a></td>
{# Project name #}
<td class="showInLargeDisplay">{{ testset.getProjectName }}</td>