diff options
author | Juha Sippola <juhasippola@outlook.com> | 2015-09-21 16:25:40 +0300 |
---|---|---|
committer | Tony Sarajärvi <tony.sarajarvi@theqtcompany.com> | 2015-09-23 09:39:31 +0000 |
commit | aec98cc36adff49eb0e44b617608a961d1404d19 (patch) | |
tree | 5a90cfeb74e8284e3f721cab3dc89e04d2da8ed3 | |
parent | 0624492bcf28308982e4e3116adcfbc8da29799e (diff) |
Qt Metrics 2: (v0.28.1): Branch name formatting
Additional special characters included for branch name
formatting on admin/branches page to get the modals work.
Problem was that the Archive/Remove buttons didn't show
confirmation when pressed for 'wip_threading'.
Change-Id: Icc84dbd134ad49b60f3cb5a2c87ea9c670930f80
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
-rw-r--r-- | non-puppet/qtmetrics2/templates/admin_branches.html | 30 |
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"> |