-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
149 lines (141 loc) · 7.75 KB
/
index.html
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
---
---
{% comment %}Shorter variable names for readability{% endcomment %}
{% assign tenure = site.data.info.tenure %}
{% assign goals = site.data.goals %}
{% comment %}Count different goals{% endcomment %}
{% for goal in goals.unfinished %}
{% if forloop.last == true %}
{% assign num_unfinished = forloop.length %}
{% endif %}
{% endfor %}
{% for goal in goals.wip %}
{% if forloop.last == true %}
{% assign num_wip = forloop.length %}
{% endif %}
{% endfor %}
{% for goal in goals.achieved %}
{% if forloop.last == true %}
{% assign num_achieved = forloop.length %}
{% endif %}
{% endfor %}
{% for goal in goals.failed %}
{% if forloop.last == true %}
{% assign num_failed = forloop.length %}
{% endif %}
{% endfor %}
{% capture num_total %}{{ num_unfinished | plus:num_wip | plus:num_achieved | plus:num_failed }}{% endcapture %}
{% capture ratio_unfinished %}{{ num_unfinished | times:100.0 | divided_by:num_total | round }}{% endcapture %}
{% capture ratio_wip %}{{ num_wip | times:100.0 | divided_by:num_total | round }}{% endcapture %}
{% capture ratio_achieved %}{{ num_achieved | times:100.0 | divided_by:num_total | round }}{% endcapture %}
{% capture ratio_failed %}{{ num_failed | times:100.0 | divided_by:num_total | round }}{% endcapture %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
<meta name="description" content="{{ site.description }}" />
<meta name="og:description" content="{{ site.description }}" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!--
<link rel="shortcut icon" href="{{ site.baseurl }}/favicon.ico" />
-->
<link rel="canonical" href="{{ page.url }}" />
{% if site.minify == true %}
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/static/css/normalize+skeleton.min.css" media="all" />
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/static/css/style.css" media="all" />
{% else %}
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/static/css/normalize.css" media="all" />
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/static/css/skeleton.css" media="all" />
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/static/css/style.css" media="all" />
{% endif %}
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/static/typefaces/css/fonts.css" media="deferred" onload="if(media!='all')media='all'" />
<noscript><link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/static/typefaces/css/fonts.css" media="all" /></noscript>
<!--[if lt IE 9]>
<script type="text/javascript" src="{{ site.baseurl }}/static/js/html5shiv.min.js?v=3.7.3-pre"></script>
<script type="text/javascript" src="{{ site.baseurl }}/static/js/html5shiv-printshiv.min.js?v=3.7.3-pre"></script>
<![endif]-->
</head>
<body>
<main class="container" role="main">
<header role="banner">
<h1>{{ site.title }}</h1>
</header>
<div class="row">
<section class="six columns" role="region">
<ul id="goal-overview" class="u-max-full-width">
{% capture now %}{{ site.time | date:"%s" }}{% endcapture %}
{% if tenure.start != "" and tenure.end != "" %}
{% capture tenure_start %}{{ tenure.start | date:"%s" }}{% endcapture %}
{% capture tenure_end %}{{ tenure.end | date:"%s" }}{% endcapture %}
{% capture tenure_served %}{{ now | minus:tenure_start | divided_by:86400 }}{% endcapture %}
{% capture tenure_ending %}{{ tenure_end | minus:tenure_start | divided_by:86400 }}{% endcapture %}
{% if tenure_start > now %}
{% assign ratio_tenure = 0 %}
{% else %}
{% capture ratio_tenure %}{{ tenure_served | times:100.0 | divided_by:tenure_ending | round }}{% endcapture %}
{% endif %}
<li class="tenure"><a title="{{ ratio_tenure }}% of the tenure ending {{ tenure.end }} has been served"><em>{{ tenure_served }} of {{ tenure_ending }} days</em> Days in office</a><span style="width:{{ ratio_tenure }}%">{{ ratio_tenure }}%</span></li>
{% else %}
{% if tenure.end == "" %}
{% capture tenure_start %}{{ tenure.start | date:"%s" }}{% endcapture %}
{% capture tenure_served %}{{ now | minus:tenure_start | divided_by:86400 }}{% endcapture %}
{% else %}
{% assign tenure_served = "?" %}
{% endif %}
<li class="tenure"><a><em>{{ tenure_served }} of ? days</em> Days in office</a><span style="width:0%">0%</span></li>
{% endif %}
<li class="unfinished"><a title="Unfinished goals make up {{ ratio_unfinished }}%"><em>{{ num_unfinished }} of {{ num_total }}</em> Unfinished</a><span style="width:{{ ratio_unfinished }}%">{{ ratio_unfinished }}%</span></li>
<li class="wip"><a title="Goals in progress make up {{ ratio_wip }}%"><em>{{ num_wip }} of {{ num_total }}</em> In progress</a><span style="width:{{ ratio_wip }}%">{{ ratio_wip }}</span></li>
<li class="achieved"><a title="Achieved goals make up {{ ratio_achieved }}%"><em>{{ num_achieved }} of {{ num_total }}</em> Achieved</a><span style="width:{{ ratio_achieved }}%">{{ ratio_achieved }}</span></li>
<li class="failed"><a title="Failed goals make up {{ ratio_failed }}%"><em>{{ num_failed }} of {{ num_total }}</em> Failed</a><span style="width:{{ ratio_failed }}%">{{ ratio_failed }}</span></li>
</ul>
</section>
</div>
<div class="row">
<section class="twelve columns" role="region">
{% for topic in site.topics %}
<h2>{{ topic }}</h2>
<table class="goal-table u-full-width">
<thead>
<tr>
<th scope="col">Goal</th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody>
{% for type in site.goal_types %}
{% for goal in goals[type] %}{% if goal.topic == topic %}
<tr class="{{ type }}">
<td>{{ goal.short }}</td>
<td>{{ type }}</td>
</tr>
{% endif %}{% endfor %}
{% endfor %}
</tbody>
</table>
{% endfor %}
</section>
</div>
</main>
<footer class="row" role="contentinfo" style="display:none">
<div class="twelve columns">
<p>Last updated <strong>{{ site.time | date: "%B %-d, %Y" }}</strong>. The “Days in office” counter only updates, when the site does.</p>
<p>This site was created with <a href="https://github.com/ndarville/goal-tracker/tree/gh-pages">Goal Tracker</a>.</p>
</div>
</footer>
<script type="text/javascript" src="{{ site.baseurl }}/static/js/fontfaceobserver.js"></script>
<script type="text/javascript">
var raleway300 = new FontFaceObserver("Raleway", {"weight": 300}),
raleway400 = new FontFaceObserver("Raleway", {"weight": 400}),
raleway600 = new FontFaceObserver("Raleway", {"weight": 600});
Promise.all([
raleway300.check(),
raleway400.check(),
raleway600.check()
]).then(function() {
document.documentElement.className += "fonts-loaded";
});
</script>
</body>
</html>