summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--non-puppet/qtmetrics2/templates/admin_branches.html30
1 files changed, 21 insertions, 9 deletions
diff --git a/non-puppet/qtmetrics2/templates/admin_branches.html b/non-puppet/qtmetrics2/templates/admin_branches.html
index 6c718d1..28a9dcb 100644
--- a/non-puppet/qtmetrics2/templates/admin_branches.html
+++ b/non-puppet/qtmetrics2/templates/admin_branches.html
@@ -34,7 +34,7 @@
/**
* Admin page: Branches
- * @since 17-09-2015
+ * @since 18-09-2015
* @author Juha Sippola
*/
@@ -104,19 +104,25 @@
{% for branch in branches %}
<tr>
{# Branch name #}
-{% if branch.archived %}
+{% if branch.archived %}
<td><span class="glyphicon glyphicon-eye-close gray"></span> <span class="gray">{{ branch.name }}</span></td>
-{% else %}
+{% else %}
<td><span class="glyphicon glyphicon-eye-open"></span> {{ branch.name }}</td>
-{% endif %}
-{% set branchTag = branch.name|replace({'.': '-'}) %}{# '.' not allowed in id #}
+{% endif %}
+{% set branchTag = branch.name %}
+{% set branchTag = branchTag|replace({'.': '--'}) %} {# '.' reserved in jQuery #}
+{% set branchTag = branchTag|replace({':': '---'}) %} {# ':' reserved in jQuery #}
+{% set branchTag = branchTag|replace({',': '----'}) %} {# '.' reserved in jQuery #}
+{% set branchTag = branchTag|replace({'[': '-----'}) %} {# '.' reserved in jQuery #}
+{% set branchTag = branchTag|replace({']': '------'}) %} {# '.' reserved in jQuery #}
+{% set branchTag = branchTag|replace({'_': '-------'}) %} {# '_' used as separator for modal confirmations #}
{# Archive button (opens a confirmation modal) #}
-{% if branch.archived %}
+{% if branch.archived %}
<td id="{{ branchTag }}ArchiveButton"><button type="button" class="btn btn-default btn-xs" data-toggle="modal" data-target="#{{ branchTag }}RestoreModal">Restore</button></td>
-{% else %}
+{% else %}
<td id="{{ branchTag }}ArchiveButton"><button type="button" class="btn btn-primary btn-xs" data-toggle="modal" data-target="#{{ branchTag }}ArchiveModal">Archive</button></td>
-{% endif %}
+{% endif %}
{# Remove button (opens a confirmation modal) #}
<td id="{{ branchTag }}RemoveButton" class="rightBorder"><button type="button" class="btn btn-danger btn-xs" data-toggle="modal" data-target="#{{ branchTag }}RemoveModal">Remove</button></td>
@@ -151,7 +157,13 @@
{% set archiveMessage = "Archiving the branch will tag it so that it will not show up on the views. This will NOT delete the branch nor its related items from the database. Archived branch can be restored or removed." %}
{% set restoreMessage = "Restoring the branch will clear the archived tag so that the branch will show up on the views again." %}
{% for branch in branches %}
-{% set branchTag = branch.name|replace({'.': '-'}) %}{# '.' not allowed in id #}
+{% set branchTag = branch.name %}
+{% set branchTag = branchTag|replace({'.': '--'}) %} {# '.' reserved in jQuery #}
+{% set branchTag = branchTag|replace({':': '---'}) %} {# ':' reserved in jQuery #}
+{% set branchTag = branchTag|replace({',': '----'}) %} {# '.' reserved in jQuery #}
+{% set branchTag = branchTag|replace({'[': '-----'}) %} {# '.' reserved in jQuery #}
+{% set branchTag = branchTag|replace({']': '------'}) %} {# '.' reserved in jQuery #}
+{% set branchTag = branchTag|replace({'_': '-------'}) %} {# '_' used as separator for modal confirmations #}
{# Remove confirmation #}
<div class="modal fade" id="{{ branchTag }}RemoveModal" tabindex="-1" role="dialog" aria-labelledby="{{ branchTag }}RemoveModalLabel" aria-hidden="true">