aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilo Casagrande <milo.casagrande@linaro.org>2014-12-04 16:20:32 +0100
committerMilo Casagrande <milo.casagrande@linaro.org>2014-12-04 16:20:32 +0100
commitf511c30917184713be95fe84737e80a4f8f89d20 (patch)
treeafc082361e06985a55745ca12fa4fb67027f8538
parent56b37da7b2fcf4f1e612faedd8691aa96f90659c (diff)
Use new translate function.
Change-Id: I467766976eba5ae3f5d2aab113ac54ff31c7b34c
-rw-r--r--app/dashboard/templates/boots-id.html56
1 files changed, 4 insertions, 52 deletions
diff --git a/app/dashboard/templates/boots-id.html b/app/dashboard/templates/boots-id.html
index 03f4a42..80033bb 100644
--- a/app/dashboard/templates/boots-id.html
+++ b/app/dashboard/templates/boots-id.html
@@ -95,65 +95,17 @@
</div>
{%- include "other-bisect-content.html" %}
</div>
-<input type="hidden" id="file-server" value="{{ config['FILE_SERVER_URL'] }}">
+<input type="hidden" id="file-server" value='{{ config["FILE_SERVER_URL"] }}'>
<input type="hidden" id="board-name" value="{{ board }}">
<input type="hidden" id="job-name" value="{{ job }}">
<input type="hidden" id="kernel-name" value="{{ kernel }}">
<input type="hidden" id="defconfig-name" value="{{ defconfig }}">
<input type="hidden" id="lab-name" value="{{ lab_name }}">
-<input type="hidden" id="boot-id" value="{{ boot_id }}">
+<input type="hidden" id="boot-id" value='{{ boot_id }}'>
+{# Beware the single quotes on this variable! #}
+<input type="hidden" id="url-translation" value='{{ url_translation|tojson|safe }}'>
{%- endblock %}
{%- block scripts %}
{{ super() }}
-<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/URI.js/1.11.2/URI.min.js"></script>
-<script type="text/javascript">
-function translateCommitURL(commitURL, commitId) {
- 'use strict';
-
- var uriParser,
- hostName,
- knownGit,
- baseURL = '',
- urlPath,
- newCommitURL = '',
- translateRule,
- lenTranslate,
- i,
- urlTranslation = {{ url_translation|tojson|safe }};
-
- if (commitURL !== null && commitId !== null) {
- uriParser = new URI(commitURL);
- hostName = uriParser.hostname();
- urlPath = uriParser.path();
-
- if (urlTranslation.hasOwnProperty(hostName)) {
- knownGit = urlTranslation[hostName];
- translateRule = knownGit[3];
- lenTranslate = translateRule.length;
-
- for (i = 0; i < lenTranslate; i++) {
- urlPath = urlPath.replace(
- translateRule[i][0], translateRule[i][1]);
- }
-
- baseURL = new URI({
- protocol: knownGit[0],
- hostname: hostName,
- path: knownGit[1].replace('%s', urlPath)
- });
-
- newCommitURL = new URI({
- protocol: knownGit[0],
- hostname: hostName,
- path: knownGit[2].replace('%s', urlPath) + commitId
- });
-
- baseURL = baseURL.href();
- newCommitURL = newCommitURL.href();
- }
- }
- return [baseURL, newCommitURL];
-}
-</script>
<script type="text/javascript" src="/static/js/linaro-boots-id-1.1.3.js"></script>
{%- endblock %}