/
index.ejs
186 lines (173 loc) · 6.07 KB
/
index.ejs
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
<!DOCTYPE html>
<html lang="en" style="font-size:80%">
<head>
<meta charset="UTF-8">
<title>hqtodo</title>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans&display=swap" rel="stylesheet"/>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital@0;1&display=swap" rel="stylesheet"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@10.2.6/dist/css/autoComplete.02.min.css"/>
<link rel="stylesheet" href="<% if (process.env.MY_ENV == 'gh-pages') { %>.<% } %>/css/style.css">
</head>
<body>
<header>
<% if (tags.length) { %>
<%- include('partials/tagnav', {tags: tags, home: true }) %>
<% } %>
<h1>
<div id="hometitle">What <%= whoami %> is up to</div>
<div id="homesubtitle">from <%= startdate %> to ...</div>
</h1>
</header>
<main>
<% issues.blockers && issues.blockers.forEach( l => { %>
<div id="hk<%= l.number %>" class="hover hideme">
<%- l.hover %><% if (l.link) {%><br /><a target="_blank" href="<%= l.link %>">see link</a><%}%>
</div>
<% }); %>
<div id="ourgantt" class="mermaid">
gantt
excludes weekends
todayMarker off
<% if (issues.blockers.length) { -%>
section Blockers
<% issues.blockers.forEach(b => { -%>
<%- `${b.title.replace(/[:#]/,'-')}` %> <%= b['tagstring'] %> :<%= b['color'] %>k<%= b['number'] %>, <%= b['startdate'] %>, <%= b['est'] %>
<% }); -%>
<% } -%>
<% if (issues.milestones.length) { -%>
section Milestones
<% issues.milestones.forEach( t => { -%>
<%- `${t.title.replace(/[:#]/,'-')}` %> <%= t['tagstring'] %> :<%= t['color'] %>k<%= t['number'] %>, <%= t['startdate'] %>, <%= t['est'] %>
<% }); -%>
<% } -%>
<% if (issues.open.active.length) { -%>
section In Progress
<% issues.open.active.forEach( t => { -%>
<%- `${t.title.replace(/[:#]/,'-')}` %> <%= t['tagstring'] %> :<%= t['color'] %>k<%= t['number'] %>, <%= t['startdate'] %>, <%= t['est'] %>
<% }); -%>
<% } -%>
<% if (issues.open.pending.length) { -%>
section Backlog
<% issues.open.pending.forEach( t => { -%>
<%- `${t.title.replace(/[:#]/,'-')}` %> <%= t['tagstring'] %> :<%= t['color'] %>k<%= t['number'] %>, <%= t['startdate'] %>, <%= t['est'] %>
<% }); -%>
<% } -%>
<% issues.links && issues.links.forEach( l => { -%>
click <%= l.id %> call linkTo("<%= l.url %>")
<% }); -%>
<% issues.blockers && issues.blockers.forEach( l => { -%>
click k<%= l.number -%> call showHover("k<%= l.number -%>")
<% }); -%>
</div>
<div style="display:flex;justify-content:space-around;width:100%">
<p style="font-size:smaller">Todos with issue numbers link to GitHub.</p>
</div>
<%_ if (issues['closed'] && issues['closed'].length !== 0) { %>
<h2>Recently closed todos</h2>
<ul id="closed" style="list-style-type:none;">
<%_ issues['closed'].forEach( t => { _%>
<%- include('partials/closed_entry.ejs', {t: t} ); %>
<%_ }); _%>
<%_ } %>
</ul>
<% if (byweek.length) { %>
<h2 class="archivetitle">
<div>Archived todos</div>
<div class="pointscale"><%= spperday %> point(s) per <%= hrsperday %>hr day</div>
</h2>
<div id="chart"></div>
<input type="checkbox" id="display-toggle"/>
<label for="display-toggle" id="display-button"><span>▹ show the archive</span></label>
<label for="display-toggle" id="hide-button"><span>▿ hide the archive</span></label>
<div id="archive" style="padding-top:1rem;padding-right:2rem">
<h3>by Week</h3>
<ul>
<%_ byweek.forEach( (w, wi) => { _%>
<li id="<%= w.weekEnding %>">
<div class="divider" style="padding:1px 0 1px 6px">Week ending: <%= w.weekEnding %></div>
<ul id="<%= wi %>" style="margin-left: 0">
<%_ w.entries.forEach( e => { _%>
<%- include('partials/closed_entry', {t: e }) %>
<%_ }); _%>
</ul><span> </span>
</li>
<%_ }); _%>
</ul>
<% if (bytag.length) { %>
<h3>by Tag</h3>
<ul>
<%_ bytag.forEach( e => { _%>
<li id="<%= e.tag %>"><h4><%= e.tag %> (<%= e.points.toString() %>)</h4>
<ul>
<%_ e.items.forEach( i => { _%>
<%- include('partials/closed_entry', {t: i }) %>
<%_ }); _%>
</ul><span> </span>
</li>
<%_ }); _%>
</ul>
<% } %>
</div>
<% } %>
</main>
<%- include('partials/footer', {pageupdated: pageupdated, fileupdated: fileupdated}) %>
<script src="https://unpkg.com/mermaid@8.5.1/dist/mermaid.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@10.2.6/dist/autoComplete.min.js"></script>
<script>
var showHover = id => {
const hover = document.querySelector(`#h${id}`);
hover.classList.toggle("showme");
hover.classList.toggle("hideme");
};
var linkTo = url => window.open(url, "_blank");
mermaid.initialize({
startOnLoad: true,
securityLevel: "loose",
gantt: {
axisFormat: "%d %b",
titleTopMargin: 25,
topPadding: 60,
barGap: 4,
barheight: 75,
bottomMarginAdjust: 1
}
});
var chartOptions = {
series: [
{
name: 'Cumulative points spent on Todos',
data: <%- jsonchartdata %>
}<% if (hassupportdata) { %>,
{
name: 'Cumulative points spent in Support',
data: <%- jsonsupportdata %>
}<% } %>
],
chart: {
type: 'line',
height: 350,
events: {
selection: function (chart, e) {
console.log(new Date(e.xaxis.min))
}
},
},
stroke: {
curve: 'stepline'
},
legend: {
showForSingleSeries: true,
position: 'top',
horizontalAlign: 'left'
},
xaxis: {
type: 'datetime'
},
};
var chart = new ApexCharts(document.querySelector('#chart'), chartOptions);
chart.render();
<%- include('partials/search_script', {searchData: searchData }) %>
</script>
</body>
</html>