Skip to content

Commit

Permalink
Template development (#2)
Browse files Browse the repository at this point in the history
* Templates for timeline reports
* Cleaned up templates for project reports
* Just minor tweaks to index template
  • Loading branch information
rerobins authored Nov 17, 2017
1 parent be56d2d commit 37eea5a
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 54 deletions.
45 changes: 25 additions & 20 deletions autology_templates/index/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,29 @@


{% block body %}
<h1>Reports</h1>

<ul>
{% for report in reports %}
<li><a href="{{report.url}}">{{report.name}}</a></li>
{% endfor %}
</ul>

<h1>Stats</h1>

<ul>
<li>Execution Time: {{stats.execution_time}}</li>
<li>
Files Processed: {{stats.processed_files}} {{stats.processed_files/stats.num_days}} files/day
{{stats.processed_files/stats.execution_time}} files/sec
</li>
<li>Days Processed: {{stats.num_days}}</li>
</ul>

<p>Generated: {{stats.generated_date}}</p>
<div class="container">
<h1>{{ site.title }} <small>{{ stats.generated_date.strftime('%Y-%m-%d') }}</small></h1>

<h2>Reports</h2>

<ul>
{% for report in reports %}
<li><a href="{{report.url}}">{{report.name}}</a></li>
{% endfor %}
</ul>

<h2>Stats</h2>

<ul>
<li>Execution Time: {{stats.execution_time}}</li>
<li>
Files Processed: {{stats.processed_files}} {{ (stats.processed_files/stats.num_days) | round(2)}} files/day
{{ (stats.processed_files/stats.execution_time) | round(2)}} files/sec
</li>
<li>Days Processed: {{stats.num_days}}</li>
</ul>

<p><small>Generated: {{stats.generated_date}}</small></p>

</div>
{% endblock %}
40 changes: 22 additions & 18 deletions autology_templates/project/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,30 @@
{% block subtitle %}Project Reporting{% endblock %}

{% block body %}
<h1>Projects</h1>
<ul>

{% for organization in organizations %}
<li>{{organization.name}}</li>
<ul>
{% for project in organization.projects %}
<li><a href="{{project.url | autology_url }}">{{project.name}}</a> {{ project.duration }}</li>
{% endfor %}
</ul>
{% endfor %}
<div class="container">
<h1>Projects</h1>
<ul>

{% if orphaned_projects %}
<li>Orphaned Projects</li>
<ul>
{% for project in orphaned_projects %}
<li>{{project.name}}
{% for organization in organizations %}
<li>{{organization.name}}</li>
<ul>
{% for project in organization.projects %}
<li><a href="{{project.url | autology_url }}">{{project.name}}</a> {{ project.duration }}</li>
{% endfor %}
</ul>
{% endfor %}
</ul>
{% endif %}

</ul>
{% if orphaned_projects %}
<li>Orphaned Projects</li>
<ul>
{% for project in orphaned_projects %}
<li>{{project.name}}
{% endfor %}
</ul>
{% endif %}

</ul>

</div>
{% endblock %}
16 changes: 15 additions & 1 deletion autology_templates/project/project.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,19 @@
{% block subtitle %}{{ project.name }}{% endblock %}

{% block body %}
<h1>{{project.name}}</h1>

<div class="container">
<h1>{{project.name}}</h1>

{% if project.description %}<p>{{ project.description }}</p>{% endif %}

{% for value in project.log | reverse %}
<div class="col-md-12">
<h2>{{ value.metadata.time.strftime('%x %X') }} <small>{{ value.duration }}</small></h2>

{{ value.content|markdown|safe }}
</div>
{% endfor %}
</div>

{% endblock %}
63 changes: 59 additions & 4 deletions autology_templates/timeline/day.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,66 @@
{% block subtitle %}{{ date.strftime('%x') }}{% endblock %}

{% block body %}
{% for value in entries %}

<h2>{{ value.metadata.time.strftime('%X') }}</h2>
<div class="container">

{{ value.content|markdown|safe }}
<div class="col-md-12">
<h1>Daily Log</h1>
</div>

{% endfor %}
<div class="col-md-1">

<div style="position: relative; height: 25px; width: 10px"></div>

<div class="col-md-12">
<div id="currentDayChart"></div>
</div>
</div>

<div class="col-md-11">

{% for value in entries %}

<div class="col-md-12">
<h2>{{ value.metadata.time.strftime('%X') }}</h2>

{{ value.content|markdown|safe }}
</div>
{% endfor %}
</div>
</div>
{% endblock %}

{% block extrahead %}
<link rel="stylesheet" href="http://cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.css" />

{% endblock %}

{% block extrascripts %}

<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
<script type="text/javascript" src="http://cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.min.js"></script>
<script type="text/javascript">
(function() {

var data = { {% for entry in entries %}"{{ entry.metadata.time.timestamp() }}": 1 {% if not loop.last %},{% endif %}{% endfor %} };

var legend = [1, 2, 3, 4];

new CalHeatMap().init({
cellSize: 14,
itemSelector: '#currentDayChart',
start: new Date({{ date.year }}, {{ date.month - 1 }}, {{ date.day }}),
data: data,
domain: 'day',
subdomain: 'hour',
tooltip: true,
highlight: 'now',
legend: legend,
displayLegend: false,
range: 1
});

})();
</script>
{% endblock %}
24 changes: 13 additions & 11 deletions autology_templates/timeline/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,18 @@

<h1>Timeline Index</h1>

{% for year in range(max_year, min_year-1, -1) %}
<div class="col-md-12">
<h2>2017</h2>
<div id="cal-2017"></div>
</div>

<div class="col-md-12">
<h2>2016</h2>
<div id="cal-2016"></div>
<h2>{{year}}</h2>
<div id="cal-{{year}}"></div>
</div>
{% endfor %}

</div>
{% endblock %}

{% block extrahead %}
<link rel="stylesheet" href="//cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.css" />
<link rel="stylesheet" href="http://cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.css" />

{% endblock %}

Expand All @@ -42,7 +39,11 @@ <h2>2016</h2>
}

};
var legend = {{legend}};
var legend = [];
var max_value = {{ max_entries }};
for (var i=1; i < 5; ++i) {
legend.push(Math.ceil(max_value / 4) * i);
}

var buildInitializationObject = function(year) {
return {
Expand All @@ -60,8 +61,9 @@ <h2>2016</h2>
}
};

new CalHeatMap().init(buildInitializationObject(2017));
new CalHeatMap().init(buildInitializationObject(2016));
{% for year in range(min_year, max_year+1) %}
new CalHeatMap().init(buildInitializationObject({{year}}));
{% endfor %}

})();
</script>
Expand Down

0 comments on commit 37eea5a

Please sign in to comment.