forked from vjosset/ktdash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dashboard_old_202302231009.php
executable file
·222 lines (202 loc) · 8.6 KB
/
dashboard_old_202302231009.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
require_once $root . '/include.php';
global $dbcon;
$me = Session::CurrentUser();
if ($me == null) {
// Not logged in, send them to login page
header("Location: /login.htm");
exit;
}
$uid = Session::CurrentUser()->userid;
$rid = getIfSet($_REQUEST['r'], '');
if ($rid == null || $rid == '') {
$rid = getIfSet($_REQUEST['rid']);
}
if ($rid == null || $rid == '') {
$rid = getIfSet($_REQUEST['rosterid']);
}
?>
<!DOCTYPE html>
<html>
<head>
<?php
include "header.shtml";
$pagetitle = "Dashboard";
$pagedesc = "KillTeam Game Dashboard";
$pagekeywords = "Dashboard, track, VP, CP, TP";
$pageimg = "https://ktdash.app/img/dashboard.png";
$pageurl = "https://ktdash.app/dashboard";
include "og.php";
?>
<style>
<?php include "css/styles.css"; ?>
</style>
</head>
<body ng-app="kt" ng-controller="ktCtrl" ng-init="initDashboard('<?php echo $rid ?>')">
<!-- style="
background-color: rgba(32, 32, 32, 0.9);
background-attachment:fixed;
background-image: url(/api/rosterportrait.php?rid={{ dashboardroster.rosterid }});
background-position: top center;
background-size: cover;
background-blend-mode: multiply;"-->
<?php
include "topnav.shtml";
include "templates/dialogs.shtml";
?>
<script type="text/javascript">
// Pre-load current user
document.body.setAttribute("currentuser", JSON.stringify(<?php echo json_encode($me) ?>));
</script>
<!-- loadWaiter -->
<h3 class="center" ng-show="loading">
<div>
<i class="fas fa-undo-alt fa-fw rotate" ></i>
<br />
Loading...
</div>
</h3>
<div class="ng-cloak" ng-hide="loading">
<!-- Header/Title - Team selection and CP/VP/TP tracker -->
<div class="container-fluid orange">
<div class="row">
<div class="col-11">
<!-- Roster Selector -->
<h1>
<div class="dropdown">
<div ng-if="dashboardroster == null || dashboardroster.rostername == ''">Select a Team</div>
<button class="btn dropdown-toggle orange form-control text-start" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" data-bs-target="#rosterselect">
<h3 class="d-inline">{{ dashboardroster.rostername }}</h3>
</button>
<div class="dropdown-menu dropdown-menu-dark" id="rosterselect">
<a class="dropdown-item" type="button" ng-repeat="roster in currentuser.rosters track by $index" ng-click="selectDashboardRoster(roster);">
{{ roster.rostername }}
</a>
</div>
</div>
</h1>
</div>
<div class="col-1 m-0 p-0 align-text-top text-end">
<div class="btn-group">
<a role="button" id="dashactions" data-bs-toggle="dropdown" aria-expanded="false">
<i class="fas fa-ellipsis-h fa-fw"></i>
</a>
<ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="dashactions">
<li><a class="pointer dropdown-item p-1 navloader" href="/r/{{ dashboardroster.rosterid }}"><i class="fas fa-users fa-fw"></i> Go To Roster</a></li>
<li><a class="pointer dropdown-item p-1" ng-click="initSelectRosterOps(dashboardroster);"><i class="fas fa-edit fa-fw"></i> Select Operatives</a></li>
<li><a class="pointer dropdown-item p-1 navloader" href="/r/{{ dashboardroster.rosterid }}/g" data-bs-toggle="tooltip" data-bs-placement="top" title="Gallery"><i class="fas fa-images fa-fw"></i> Roster Gallery</a></li>
<li><a class="pointer dropdown-item p-1" ng-click=" resetDash(dashboardroster);"><i class="fas fa-undo-alt fa-fw"></i> Reset Dashboard</a></li>
</ul>
</div>
</div>
</div>
<!-- Trackers -->
<center class="container">
<div class="row">
<h3 class="col-4">
CP
</h3>
<h3 class="col-4">
Turn
</h3>
<h3 class="col-4">
VP
</h3>
</div>
<div class="row">
<h3 class="col-4">
<span class="pointer small" ng-click="updateCP(-1, dashboardroster);"><i class="far fa-minus-square fa-fw"></i></span>
<span ng-bind="dashboardroster.CP"></span>
<span class="pointer small" ng-click="updateCP(1, dashboardroster);"><i class="far fa-plus-square fa-fw"></i></span>
</h3>
<h3 class="col-4">
<span class="pointer small" ng-click="updateTP(-1, dashboardroster);"><i class="far fa-minus-square fa-fw"></i></span>
<span ng-bind="dashboardroster.TP"></span>
<span class="pointer small" ng-click="updateTP(1, dashboardroster);"><i class="far fa-plus-square fa-fw"></i></span>
</h3>
<h3 class="col-4">
<span class="pointer small" ng-click="updateVP(-1, dashboardroster);"><i class="far fa-minus-square fa-fw"></i></span>
<span ng-bind="dashboardroster.VP"></span>
<span class="pointer small" ng-click="updateVP(1, dashboardroster);"><i class="far fa-plus-square fa-fw"></i></span>
</h3>
</div>
</center>
</div>
<!-- Resource Point tracker -->
<div class="container-fluid" ng-if="RPLabels[dashboardroster.factionid][dashboardroster.killteamid]">
<div class="h5 cinzel">
{{ RPLabels[dashboardroster.factionid][dashboardroster.killteamid]["Label"] }}
<span class="small" ng-click="updateRP(-1, dashboardroster);"><i class="far fa-minus-square fa-fw"></i></span>
<span ng-bind="dashboardroster.RP"></span>
<span class="small" ng-click="updateRP(1, dashboardroster);"><i class="far fa-plus-square fa-fw"></i></span>
</div>
</div>
<ul class="nav nav-tabs" id="mytabs" role="tablist">
<li class="nav-item m-0 p-0 dark" role="presentation">
<a class="nav-link active dark" id="op-tab" data-bs-toggle="tab" data-bs-target="#ops" type="button" role="tab" aria-controls="ops" aria-selected="true">
Operatives
</a>
</li>
<li class="nav-item m-0 p-0 dark" role="presentation">
<a class="nav-link dark" id="ploy-tab" data-bs-toggle="tab" data-bs-target="#ploys" type="button" role="tab" aria-controls="ploys" aria-selected="false">
Ploys
</a>
</li>
<li class="nav-item m-0 p-0 dark" role="presentation">
<a class="nav-link dark" id="eq-tab" data-bs-toggle="tab" data-bs-target="#eqs" type="button" role="tab" aria-controls="eqs" aria-selected="false">
Equip
</a>
</li>
</ul>
<div class="tab-content p-0 m-0">
<div class="tab-pane show active" id="ops" role="tabpanel">
<!-- Archetype -->
<h6 class="d-inline">Archetype</h6>: <small ng-bind="getRosterArchetype(dashboardroster)"></small>
<!-- Operatives -->
<div class="row p-0 m-0">
<div ng-if="!operative.hidden" class="col-12 col-md-6 col-xl-4 m-0 p-0" ng-repeat="operative in dashboardroster.operatives track by $index">
<?php include "templates/op_card.shtml" ?>
</div>
</div>
</div>
<div class="tab-pane m-0 p-0" id="ploys" role="tabpanel">
<div class="row container-fluid m-0 p-0">
<div class="col-xs-12 col-md-6">
<!-- Strategic Ploys -->
<h3>Strategic Ploys</h3>
<ANY ng-repeat="ploy in dashboardroster.killteam.ploys.strat track by $index">
<?php include "templates/ploy.shtml" ?>
</ANY>
</div>
<div class="col-xs-12 col-md-6">
<!-- Tactical Ploys -->
<h3>Tactical Ploys</h3>
<ANY ng-repeat="ploy in dashboardroster.killteam.ploys.tac track by $index">
<?php include "templates/ploy.shtml" ?>
</ANY>
</div>
</div>
</div>
<div class="tab-pane" id="eqs" role="tabpanel">
<!-- Equipment -->
<div class="row p-0 m-0">
<div ng-repeat="eq in dashboardroster.killteam.equipments track by $index" class="col-12 col-lg-6 col-xl-4">
<h4 class="text-center line-top-light" ng-if="$index > 0 && dashboardroster.killteam.equipments[$index].eqcategory != dashboardroster.killteam.equipments[$index - 1].eqcategory">
{{ eq.eqcategory }}
</h4>
<div class="line-top-light">
<h5 class="d-inline">{{ eq.eqname }}</h5>
<h5 class="d-inline float-end text-end" ng-if="eq.eqpts > '0'">{{ eq.eqpts }} EP </h5>
<em class="d-inline float-end text-end" ng-if="eq.eqpts == '0'">{{ eq.eqcategory }} </em>
</div>
<p class="oswald p-1" style="text-align: justify;" ng-bind-html="eq.eqdescription"></p>
</div>
</div>
</div>
</div>
</div>
<?php include "footer.shtml" ?>
</body>
</html>