-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #224 from orertrr/public-statistics
Add public statistics page
- Loading branch information
Showing
5 changed files
with
180 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
{% extends "base.html" %} | ||
{% block head_title %}{{project.name}} 統計資訊{% endblock %} | ||
{% block body %} | ||
<section class="section"> | ||
<div class="container"> | ||
<h1 class="title"> | ||
{{project.name}} | ||
</h1> | ||
<div class="content"> | ||
<p>{{project.desc}}</p> | ||
{% if editable %} | ||
<div class="buttons is-right"> | ||
<a class="button is-info is-light" href="/project/{{project._id}}/edit"> | ||
<span class="icon"><i class="far fa-edit"></i></span> <span>Edit</span> | ||
</a> | ||
</div> | ||
{% endif %} | ||
</div> | ||
</div> | ||
</section> | ||
<section class="section"> | ||
<div class="container"> | ||
<div class="tabs"> | ||
<ul> | ||
<li><a href="/project/{{project._id}}">組別列表</a></li> | ||
<li class="is-active"><a>統計資訊</a></li> | ||
</ul> | ||
</div> | ||
<div class="columns"> | ||
<div class="column"> | ||
<h4 class="title is-4">飲食習慣人數分布</h4> | ||
<table class="table"> | ||
<thead> | ||
<th>習慣</th> | ||
<th>人數</th> | ||
</thead> | ||
<tbody> | ||
{% for habit, count in habit_statistics.items() %} | ||
<tr> | ||
<td>{{ habit }}</td> | ||
<td>{{ count }}</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
<div class="column"> | ||
<h4 class="title is-4">衣服尺寸人數分布</h4> | ||
<table class="table"> | ||
<thead> | ||
<th>尺寸</th> | ||
<th>人數</th> | ||
</thead> | ||
<tbody> | ||
{% for clothes_size, count in clothes_statistics.items() %} | ||
<tr> | ||
<td>{{ clothes_size }}</td> | ||
<td>{{ count }}</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
<div class="column"> | ||
<h4 class="title is-4">住宿人數</h4> | ||
<table class="table"> | ||
<thead> | ||
<th>住宿選項</th> | ||
<th>人數</th> | ||
</thead> | ||
<tbody> | ||
{% for accmmodation_option, count in accommodation_statictics.items() %} | ||
{% if accmmodation_option == 'yes' %} | ||
<tr> | ||
<td>需要住宿</td> | ||
<td>{{ count }}</td> | ||
</tr> | ||
{% elif accmmodation_option == 'yes-longtraffic' %} | ||
<tr> | ||
<td>需要住宿,且通勤時間大於一小時</td> | ||
<td>{{ count }}</td> | ||
</tr> | ||
{% endif %} | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters