Skip to content

Commit

Permalink
Change: put the result of every version on its own page
Browse files Browse the repository at this point in the history
  • Loading branch information
TrueBrain committed Mar 1, 2024
1 parent c121a8f commit fdaa98d
Show file tree
Hide file tree
Showing 36 changed files with 371 additions and 77 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/create-summary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,7 @@ jobs:
- name: Create summary entry
shell: bash
run: |
mkdir -p _summaries/${{ steps.dates.outputs.year }}
summary="_summaries/${{ steps.dates.outputs.year }}/wk${{ steps.dates.outputs.week }}.md"
echo "---" > ${summary}
echo "name: ${{ steps.dates.outputs.year }} - Week ${{ steps.dates.outputs.week }}" >> ${summary}
echo "title: Survey Result Summary - ${{ steps.dates.outputs.year }} - Week ${{ steps.dates.outputs.week }}"
echo "active_nav: summaries" >> ${summary}
echo "year: \"${{ steps.dates.outputs.year }}\"" >> ${summary}
echo "week: wk${{ steps.dates.outputs.week }}" >> ${summary}
echo "start_date: \"${{ steps.dates.outputs.start_date }}\"" >> ${summary}
echo "end_date: \"${{ steps.dates.outputs.end_date }}\"" >> ${summary}
echo "---" >> ${summary}
python -m create_markdown ${{ steps.dates.outputs.year }} ${{ steps.dates.outputs.week }} ${{ steps.dates.outputs.start_date }} ${{ steps.dates.outputs.end_date }}
- name: Commit and push
shell: bash
Expand Down
72 changes: 15 additions & 57 deletions _layouts/summaries.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,74 +9,32 @@ <h3>Survey Result Summary - {{ page.name }}</h3>
<div class="section-item">
<div class="content">
<p>
Below is the summary of the survey results from {{ page.start_date }} to {{ page.end_date }}.
Below are the versions with a summary of the survey results from {{ page.start_date }} to {{ page.end_date }}.
</p>

<ul>
{% for version in site.data.summaries[page.year][page.week] %}
{% if version[1] == nil %}{% continue %}{% endif %}
{% for summary in site.summaries %}
{% if summary.year != page.year or summary.week != page.week or summary.version == nil %}{% continue %}{% endif %}
<li>
<a href="#{{ version[0] }}">{{ version[0] }}</a>
<a href="{{ summary.url }}">{{ summary.version }}</a>
</li>
{% endfor %}
</ul>

<p>
The following statistics are based on "seconds played".
That is to say, if a setting was "true" for 100 seconds of play-time and "false" for 200 seconds of play-time, it would be 33% true and 66% false.
This is to avoid biasing the results towards shorter games.
<br />
Worded differently, the following statistics are not counting how often something was used, but how long it was used for.
Below are the versions of which a survey results have been seen, but not with sufficient amount of data to create a summary.
This could be due to the survey being new or not having enough responses.
To protect our users and to avoid any misinterpretation of the data, we do not create summaries under these circumstances.
</p>

<p>
Be mindful that these numbers are only based on those people willing to send us survey results.
It might not be representative of the entire OpenTTD player base.
</p>

<p>
Entries listed as "(other)" are the collection of all values lower than 0.1% of the total.
</p>
</div>
</div>

{% for version in site.data.summaries[page.year][page.week] %}
{% if version[1] == nil %}{% continue %}{% endif %}
<div class="section-header" id="{{ version[0] }}">
<h3>{{ version[0] }}</h3>
</div>
<div class="section-item">
<div class="content">
{% assign seconds = version[1].summary.seconds | times: 1.0 %}

<p>
We received surveys for a total of {{ version[1].summary.seconds | divided_by: 3600 | round: 2 }} hours of games played, over a total of {{ version[1].summary.ids }} games.
This is an average of {{ seconds | divided_by: version[1].summary.ids | divided_by: 3600 | round: 2 }} hours per game.
</p>

<table class="summary-table">
{% for summary in version[1] %}
{% if summary[0] == "summary" %}{% continue %}{% endif %}
<tr id="{{ version[0] }}-{{ summary[0] }}" class="setting">
<th colspan="3">
<a href="#{{ version[0] }}-{{ summary[0] }}">{{ summary[0] }}</a>
</th>
</tr>
{% for line in summary[1] %}
{% assign percentage = line[1] | divided_by: seconds | percentage %}
<tr>
<td style="width: 40px;"></td>
<td><pre>{{ line[0] }}</pre></td>
{% if percentage == "0.0" %}
<td style="text-align: right;">&lt;0.1%</td>
{% else %}
<td style="text-align: right;">{{ percentage }}%</td>
{% endif %}
</tr>
{% endfor %}
<ul>
{% for version in site.data.summaries[page.year][page.week] %}
{% if version[1] != nil %}{% continue %}{% endif %}
<li>
{{ version[0] }}
</li>
{% endfor %}
</table>
</div>
</ul>
</div>
{% endfor %}
</div>
</div>
65 changes: 65 additions & 0 deletions _layouts/summary.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
layout: default
---

<div id="section-full">
<div class="section-header">
<h3>Survey Result Summary - {{ page.name }}</h3>
</div>
<div class="section-item">
<div class="content">
<p>
Below is the summary of the survey results from {{ page.start_date }} to {{ page.end_date }} for {{ page.version }}.
</p>

<p>
The following statistics are based on "seconds played".
That is to say, if a setting was "true" for 100 seconds of play-time and "false" for 200 seconds of play-time, it would be 33% true and 66% false.
This is to avoid biasing the results towards shorter games.
<br />
Worded differently, the following statistics are not counting how often something was used, but how long it was used for.
</p>

<p>
Be mindful that these numbers are only based on those people willing to send us survey results.
It might not be representative of the entire OpenTTD player base.
</p>

<p>
Entries listed as "(other)" are the collection of all values lower than 0.1% of the total.
</p>

{% assign versions = site.data.summaries[page.year][page.week] %}
{% assign version = versions[page.version] %}
{% assign seconds = version.summary.seconds | times: 1.0 %}

<p>
We received surveys for a total of <b>{{ version.summary.seconds | divided_by: 3600 | round: 2 }} hours</b> of games played, over a total of <b>{{ version.summary.ids }} games</b>.
This is an average of {{ seconds | divided_by: version.summary.ids | divided_by: 3600 | round: 2 }} hours per game.
</p>

<table class="summary-table">
{% for summary in version %}
{% if summary[0] == "summary" %}{% continue %}{% endif %}
<tr id="{{ summary[0] }}" class="setting">
<th colspan="3">
<a href="#{{ summary[0] }}">{{ summary[0] }}</a>
</th>
</tr>
{% for line in summary[1] %}
{% assign percentage = line[1] | divided_by: seconds | percentage %}
<tr>
<td style="width: 40px;"></td>
<td><pre>{{ line[0] }}</pre></td>
{% if percentage == "0.0" %}
<td style="text-align: right;">&lt;0.1%</td>
{% else %}
<td style="text-align: right;">{{ percentage }}%</td>
{% endif %}
</tr>
{% endfor %}
{% endfor %}
</table>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion _summaries/2024/wk01.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: 2024 - Week 01
active_nav: summaries
year: "2024"
week: wk01
week: "wk01"
start_date: "2024-01-01"
end_date: "2024-01-07"
---
10 changes: 10 additions & 0 deletions _summaries/2024/wk01/jgrpp-0.56.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 2024 - Week 01 - jgrpp-0.56.2
active_nav: summaries
year: "2024"
week: "wk01"
version: "jgrpp-0.56.2"
start_date: "2024-01-01"
end_date: "2024-01-07"
layout: "summary"
---
2 changes: 1 addition & 1 deletion _summaries/2024/wk02.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: 2024 - Week 02
active_nav: summaries
year: "2024"
week: wk02
week: "wk02"
start_date: "2024-01-08"
end_date: "2024-01-14"
---
10 changes: 10 additions & 0 deletions _summaries/2024/wk02/jgrpp-0.56.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 2024 - Week 02 - jgrpp-0.56.2
active_nav: summaries
year: "2024"
week: "wk02"
version: "jgrpp-0.56.2"
start_date: "2024-01-08"
end_date: "2024-01-14"
layout: "summary"
---
2 changes: 1 addition & 1 deletion _summaries/2024/wk03.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: 2024 - Week 03
active_nav: summaries
year: "2024"
week: wk03
week: "wk03"
start_date: "2024-01-15"
end_date: "2024-01-21"
---
10 changes: 10 additions & 0 deletions _summaries/2024/wk03/jgrpp-0.56.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 2024 - Week 03 - jgrpp-0.56.2
active_nav: summaries
year: "2024"
week: "wk03"
version: "jgrpp-0.56.2"
start_date: "2024-01-15"
end_date: "2024-01-21"
layout: "summary"
---
10 changes: 10 additions & 0 deletions _summaries/2024/wk03/vanilla-master.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 2024 - Week 03 - vanilla-master
active_nav: summaries
year: "2024"
week: "wk03"
version: "vanilla-master"
start_date: "2024-01-15"
end_date: "2024-01-21"
layout: "summary"
---
2 changes: 1 addition & 1 deletion _summaries/2024/wk04.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: 2024 - Week 04
active_nav: summaries
year: "2024"
week: wk04
week: "wk04"
start_date: "2024-01-22"
end_date: "2024-01-28"
---
10 changes: 10 additions & 0 deletions _summaries/2024/wk04/jgrpp-0.56.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 2024 - Week 04 - jgrpp-0.56.2
active_nav: summaries
year: "2024"
week: "wk04"
version: "jgrpp-0.56.2"
start_date: "2024-01-22"
end_date: "2024-01-28"
layout: "summary"
---
10 changes: 10 additions & 0 deletions _summaries/2024/wk04/vanilla-master.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 2024 - Week 04 - vanilla-master
active_nav: summaries
year: "2024"
week: "wk04"
version: "vanilla-master"
start_date: "2024-01-22"
end_date: "2024-01-28"
layout: "summary"
---
2 changes: 1 addition & 1 deletion _summaries/2024/wk05.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: 2024 - Week 05
active_nav: summaries
year: "2024"
week: wk05
week: "wk05"
start_date: "2024-01-29"
end_date: "2024-02-04"
---
10 changes: 10 additions & 0 deletions _summaries/2024/wk05/14.0-beta1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 2024 - Week 05 - 14.0-beta1
active_nav: summaries
year: "2024"
week: "wk05"
version: "14.0-beta1"
start_date: "2024-01-29"
end_date: "2024-02-04"
layout: "summary"
---
10 changes: 10 additions & 0 deletions _summaries/2024/wk05/jgrpp-0.56.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 2024 - Week 05 - jgrpp-0.56.2
active_nav: summaries
year: "2024"
week: "wk05"
version: "jgrpp-0.56.2"
start_date: "2024-01-29"
end_date: "2024-02-04"
layout: "summary"
---
10 changes: 10 additions & 0 deletions _summaries/2024/wk05/vanilla-master.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 2024 - Week 05 - vanilla-master
active_nav: summaries
year: "2024"
week: "wk05"
version: "vanilla-master"
start_date: "2024-01-29"
end_date: "2024-02-04"
layout: "summary"
---
2 changes: 1 addition & 1 deletion _summaries/2024/wk06.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: 2024 - Week 06
active_nav: summaries
year: "2024"
week: wk06
week: "wk06"
start_date: "2024-02-05"
end_date: "2024-02-11"
---
10 changes: 10 additions & 0 deletions _summaries/2024/wk06/14.0-beta2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 2024 - Week 06 - 14.0-beta2
active_nav: summaries
year: "2024"
week: "wk06"
version: "14.0-beta2"
start_date: "2024-02-05"
end_date: "2024-02-11"
layout: "summary"
---
10 changes: 10 additions & 0 deletions _summaries/2024/wk06/14.0-beta3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 2024 - Week 06 - 14.0-beta3
active_nav: summaries
year: "2024"
week: "wk06"
version: "14.0-beta3"
start_date: "2024-02-05"
end_date: "2024-02-11"
layout: "summary"
---
10 changes: 10 additions & 0 deletions _summaries/2024/wk06/jgrpp-0.56.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 2024 - Week 06 - jgrpp-0.56.2
active_nav: summaries
year: "2024"
week: "wk06"
version: "jgrpp-0.56.2"
start_date: "2024-02-05"
end_date: "2024-02-11"
layout: "summary"
---
10 changes: 10 additions & 0 deletions _summaries/2024/wk06/jgrpp-0.57.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 2024 - Week 06 - jgrpp-0.57.1
active_nav: summaries
year: "2024"
week: "wk06"
version: "jgrpp-0.57.1"
start_date: "2024-02-05"
end_date: "2024-02-11"
layout: "summary"
---
10 changes: 10 additions & 0 deletions _summaries/2024/wk06/vanilla-master.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 2024 - Week 06 - vanilla-master
active_nav: summaries
year: "2024"
week: "wk06"
version: "vanilla-master"
start_date: "2024-02-05"
end_date: "2024-02-11"
layout: "summary"
---
2 changes: 1 addition & 1 deletion _summaries/2024/wk07.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: 2024 - Week 07
active_nav: summaries
year: "2024"
week: wk07
week: "wk07"
start_date: "2024-02-12"
end_date: "2024-02-18"
---
Loading

0 comments on commit fdaa98d

Please sign in to comment.