summaryrefslogtreecommitdiffstats
path: root/non-puppet/qtmetrics2/templates/admin_data.html
diff options
context:
space:
mode:
Diffstat (limited to 'non-puppet/qtmetrics2/templates/admin_data.html')
-rw-r--r--non-puppet/qtmetrics2/templates/admin_data.html202
1 files changed, 202 insertions, 0 deletions
diff --git a/non-puppet/qtmetrics2/templates/admin_data.html b/non-puppet/qtmetrics2/templates/admin_data.html
new file mode 100644
index 0000000..b7ce7fd
--- /dev/null
+++ b/non-puppet/qtmetrics2/templates/admin_data.html
@@ -0,0 +1,202 @@
+{#
+#############################################################################
+##
+## Copyright (C) 2015 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the Quality Assurance module of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:LGPL21$
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see http://www.qt.io/terms-conditions. For further
+## information use the contact form at http://www.qt.io/contact-us.
+##
+## GNU Lesser General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU Lesser
+## General Public License version 2.1 or version 3 as published by the Free
+## Software Foundation and appearing in the file LICENSE.LGPLv21 and
+## LICENSE.LGPLv3 included in the packaging of this file. Please review the
+## following information to ensure the GNU Lesser General Public License
+## requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+##
+## As a special exception, The Qt Company gives you certain additional
+## rights. These rights are described in The Qt Company LGPL Exception
+## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+/**
+ * Admin page: Data maintenance
+ * @since 17-08-2015
+ * @author Juha Sippola
+ */
+
+#}
+
+{# Row count bar area size in px #}
+{% set BAR_AREA = 200 %}
+
+{% include "header.html" %}
+
+<ol class="breadcrumb">
+{% for link in breadcrumb %}
+<li><a href="{{ link.link }}">{{ link.name }}</a></li>
+{% endfor %}
+<li class="active">data</li>
+</ol>
+
+<div class="container-fluid">
+<div class="row">
+
+<div class="col-sm-12 col-md-12 main">
+
+{##### Title #####}
+
+<h1 class="page-header">Admin</h1>
+
+{##### Navigation #####}
+
+<ul class="nav nav-tabs">
+<li role="presentation"><a href="{{ adminRoute }}">Summary</a></li>
+<li role="presentation"><a href="{{ adminBranchesRoute }}">Branches</a></li>
+<li role="presentation" class="active"><a href="{{ adminDataRoute }}">Data maintenance</a></li>
+</ul>
+<br>
+
+{##### Project runs #####}
+
+{# Get states #}
+{% set states = [] %}
+{% for run in projectRuns %}
+{% if run.state not in states %}
+{% set states = states|merge([run.state]) %}
+{% endif %}
+{% endfor %}
+
+{# Calculate max count #}
+{% set maxCount = 1 %}
+{% for projectRun in projectRuns %}
+{% if projectRun.runCount > maxCount %}
+{% set maxCount = projectRun.runCount %}
+{% endif %}
+{% endfor %}
+
+{# Loop all the states #}
+{% for state in states %}
+
+{# Calculate run count #}
+{% set runCount = 0 %}
+{% for projectRun in projectRuns if projectRun.state == state %}
+{% set runCount = runCount + projectRun.runCount %}
+{% endfor %}
+
+<div class="panel panel-primary">
+<div class="panel-heading">
+<h4 class="panel-title bold">{{ state }} project runs ({{ runCount }})</h4>
+</div>
+<div class="panel-body">
+<div class="table-responsive">
+<table class="table table-striped">
+<thead>
+<tr>
+<th class="center">year</th>
+<th class="center">month</th>
+<th class="center">day</th>
+<th class="rightBorder"></th>
+<th class="center">runs</th>
+<th class="showInLargeDisplay"></th>
+</tr>
+</thead>
+<tbody>
+{# Print projectRuns #}
+{% for projectRun in projectRuns if projectRun.state == state %}
+<tr>
+{# year and month #}
+<td class="center">{{ projectRun.year }}</td>
+<td class="center">{{ projectRun.month }}</td>
+<td class="center">{{ projectRun.day }}</td>
+{% set monthFiller = '' %}
+{% set dayFiller = '' %}
+{% if projectRun.month < 10 %}
+{% set monthFiller = '0' %}
+{% endif %}
+{% if projectRun.day < 10 %}
+{% set dayFiller = '0' %}
+{% endif %}
+{% set tag = projectRun.state ~ "-" ~ projectRun.year ~ "-" ~ monthFiller ~ projectRun.month ~ "-" ~ dayFiller ~ projectRun.day %}
+
+{# Button (opens a confirmation modal) #}
+<td id="{{ tag }}Button" class="rightBorder"><button type="button" class="btn btn-danger btn-xs" data-toggle="modal" data-target="#{{ tag }}Modal">Remove</button></td>
+
+{# Show run count as numbers #}
+{% set runs = projectRun.runCount %}
+<td class="center">{{ runs }}</td>
+
+{# Show row count as bars (scaled to BAR_AREA px) #}
+{% set runsBar = ((BAR_AREA/maxCount) * runs)|round(0, 'floor') %}
+{% if (runs > 0) and (runsBar == 0) %}
+{% set runsBar = 1 %}
+{% endif %}
+<td class="center showInLargeDisplay">
+<div>
+<div class="floatLeft blueBackground" style="width: {{ runsBar }}px">&nbsp;</div>
+</div>
+</td>
+</tr>
+{% endfor %}{# projectRun #}
+</tbody>
+</table>
+</div> {# .table-responsive #}
+</div> {# .panel-body #}
+</div> {# .panel... #}
+{% endfor %}{# state #}
+
+{# Modals for remove confirmation #}
+{% set message = "Removing will delete all related items from the '_run' tables. This may take up to one or two minutes. THIS OPERATION CANNOT BE UNDONE!" %}
+{% for projectRun in projectRuns %}
+{% set monthFiller = '' %}
+{% set dayFiller = '' %}
+{% if projectRun.month < 10 %}
+{% set monthFiller = '0' %}
+{% endif %}
+{% if projectRun.day < 10 %}
+{% set dayFiller = '0' %}
+{% endif %}
+{% set tag = projectRun.state ~ "-" ~ projectRun.year ~ "-" ~ monthFiller ~ projectRun.month ~ "-" ~ dayFiller ~ projectRun.day %}
+{% set tagDate = projectRun.year ~ "-" ~ monthFiller ~ projectRun.month ~ "-" ~ dayFiller ~ projectRun.day %}
+<div class="modal fade" id="{{ tag }}Modal" tabindex="-1" role="dialog" aria-labelledby="{{ tag }}ModalLabel" aria-hidden="true">
+<div class="modal-dialog">
+<div class="modal-content">
+<div class="modal-header">
+<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+<h4 class="modal-title" id="{{ tag }}ModalLabel">Remove {{ tagDate }} data in "{{ projectRun.state }}"</h4>
+</div>
+<div class="modal-body">
+{{ message }}
+</div>
+<div class="modal-footer">
+<button type="button" class="btn btn-default" data-dismiss="modal" id="cancel_data_remove_{{ tag }}">Cancel</button>
+<button type="button" class="btn btn-danger remove_branch" data-dismiss="modal" id="confirm_data_remove_{{ tagDate }}" name="{{ projectRun.state }}">Remove</button>
+</div>
+</div>
+</div>
+</div> {# .modal #}
+{% endfor %}{# projectRun #}
+
+</div> {# .col... #}
+</div> {# .row #}
+</div> {# .container-fluid #}
+
+{% include "footer.html" %}
+
+{# Local scripts for this page #}
+<script src="scripts/admin.js"></script>
+
+{% include "close.html" %}