major improvements
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Samuel Philipp 2021-06-13 01:09:52 +02:00
parent 848289cdc0
commit 8d2492e6c8
Signed by: samuel-p
GPG key ID: 2AD495D17760CB4E
13 changed files with 25 additions and 27 deletions

View file

@ -1,10 +1,6 @@
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation"); const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
module.exports = function (eleventyConfig) { module.exports = function (eleventyConfig) {
eleventyConfig.setLiquidOptions({
dynamicPartials: true,
// strict_filters: true,
});
eleventyConfig.addWatchTarget("./src/scss/"); eleventyConfig.addWatchTarget("./src/scss/");
eleventyConfig.addPlugin(eleventyNavigationPlugin); eleventyConfig.addPlugin(eleventyNavigationPlugin);
@ -27,8 +23,9 @@ module.exports = function (eleventyConfig) {
return value.map(d => d.amount).reduce((a, b) => a + b); return value.map(d => d.amount).reduce((a, b) => a + b);
}); });
eleventyConfig.addFilter("amount", function (value, locale) { eleventyConfig.addFilter("amount", function (value) {
return value.toLocaleString(locale, {minimumFractionDigits: 2}); // TODO update language dynamically
return value.toLocaleString('de', {minimumFractionDigits: 2});
}); });
eleventyConfig.addFilter("banktransfers", function (donations) { eleventyConfig.addFilter("banktransfers", function (donations) {

View file

@ -19,7 +19,7 @@
"browser-sync": "^2.26.14" "browser-sync": "^2.26.14"
}, },
"devDependencies": { "devDependencies": {
"@11ty/eleventy": "^0.12.1", "@11ty/eleventy": "^1.0.0-canary.32",
"@11ty/eleventy-navigation": "^0.2.0", "@11ty/eleventy-navigation": "^0.2.0",
"cpx": "^1.5.0", "cpx": "^1.5.0",
"node-sass": "^6.0.0", "node-sass": "^6.0.0",

View file

@ -1,3 +1,4 @@
{{locale}}
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
@ -21,14 +22,14 @@
{% else %} {% else %}
<td>***</td> <td>***</td>
{% endif %} {% endif %}
<td>{{donation.amount | amount(locale)}} €</td> <td>{{donation.amount | amount}} €</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<th colspan="3">{{strings.total[locale]}}</th> <th colspan="3">{{strings.total[locale]}}</th>
<th>{{donations[0].donations | sum | amount(locale)}} €</th> <th>{{donations[0].donations | sum | amount}} €</th>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>

View file

@ -24,14 +24,14 @@
{% else %} {% else %}
<td>***</td> <td>***</td>
{% endif %} {% endif %}
<td>{{donation.amount | amount(locale)}} €</td> <td>{{donation.amount | amount}} €</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<th colspan="3">{{strings.total[locale]}}</th> <th colspan="3">{{strings.total[locale]}}</th>
<th>{{year.donations | sum | amount(locale)}} €</th> <th>{{year.donations | sum | amount}} €</th>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>

View file

@ -18,16 +18,16 @@
{% endif %} {% endif %}
<td>{{expense.type}}</td> <td>{{expense.type}}</td>
<td>{{expense.provider}}</td> <td>{{expense.provider}}</td>
<td>{{expense.amount | amount(locale)}} €</td> <td>{{expense.amount | amount}} €</td>
<td>{{expense.amount | year | amount(locale)}} €</td> <td>{{expense.amount | year | amount}} €</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<th colspan="3">{{strings.total[locale]}}</th> <th colspan="3">{{strings.total[locale]}}</th>
<th>{{expenses | sum | amount(locale)}} €</th> <th>{{expenses | sum | amount}} €</th>
<th>{{expenses | sum | year | amount(locale)}} €</th> <th>{{expenses | sum | year | amount}} €</th>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>

View file

@ -7,4 +7,4 @@ title: Unterstützen
<p><a href="/{{locale}}/donate/">&#10132; Unterstützen</a></p> <p><a href="/{{locale}}/donate/">&#10132; Unterstützen</a></p>
{% include "donations.html" %} {% include donations.html %}

View file

@ -73,10 +73,10 @@ eleventyNavigation:
</div> </div>
<h2>Aktuelle Ausgaben</h2> <h2>Aktuelle Ausgaben</h2>
{% include "expenses-current.html" %} {% include expenses-current.html %}
<h2>Spenden {{donations[0].year}}</h2> <h2>Spenden {{donations[0].year}}</h2>
{% include "donations-current.html" %} {% include donations-current.html %}
<p><a href="/{{locale}}/all-donations/">&#10132; Alle Spenden</a></p> <p><a href="/{{locale}}/all-donations/">&#10132; Alle Spenden</a></p>

View file

@ -28,5 +28,5 @@ title: Impressum
<div class="mb-3 pt-4 border-top"> <div class="mb-3 pt-4 border-top">
<h2>Lizenzen</h2> <h2>Lizenzen</h2>
<p>Diese Webseite nutzt die folgenden Bibliotheken mit ihren entsprechenden Lizenzen:</p> <p>Diese Webseite nutzt die folgenden Bibliotheken mit ihren entsprechenden Lizenzen:</p>
{% include "licenses.html" %} {% include licenses.html %}
</div> </div>

View file

@ -31,7 +31,7 @@ eleventyNavigation:
href="https://social.sp-codes.de/@sp_codes">@sp_codes@social.sp-codes.de</a></strong> href="https://social.sp-codes.de/@sp_codes">@sp_codes@social.sp-codes.de</a></strong>
</p> </p>
<div class="row justify-content-center"> <div class="row justify-content-center">
{% include "services-simple.html" %} {% include services-simple.html %}
</div> </div>
</div> </div>
</div> </div>
@ -44,4 +44,4 @@ eleventyNavigation:
</p> </p>
</div> </div>
</div> </div>
{% include "profiles.html" %} {% include profiles.html %}

View file

@ -7,4 +7,4 @@ title: Unterstützen
<p><a href="/{{locale}}/donate/">&#10132; Donate</a></p> <p><a href="/{{locale}}/donate/">&#10132; Donate</a></p>
{% include "donations.html" %} {% include donations.html %}

View file

@ -71,10 +71,10 @@ eleventyNavigation:
</div> </div>
<h2>Current Expenses</h2> <h2>Current Expenses</h2>
{% include "expenses-current.html" %} {% include expenses-current.html %}
<h2>Donations {{donations[0].year}}</h2> <h2>Donations {{donations[0].year}}</h2>
{% include "donations-current.html" %} {% include donations-current.html %}
<p><a href="/{{locale}}/all-donations/">&#10132; All Donations</a></p> <p><a href="/{{locale}}/all-donations/">&#10132; All Donations</a></p>

View file

@ -28,5 +28,5 @@ title: sp-codes
<div class="mb-3 pt-4 border-top"> <div class="mb-3 pt-4 border-top">
<h2>Licenses</h2> <h2>Licenses</h2>
<p>This Website uses the following libraries with their respective licenses:</p> <p>This Website uses the following libraries with their respective licenses:</p>
{% include "licenses.html" %} {% include licenses.html %}
</div> </div>

View file

@ -30,7 +30,7 @@ eleventyNavigation:
href="https://social.sp-codes.de/@sp_codes">@sp_codes@social.sp-codes.de</a></strong> href="https://social.sp-codes.de/@sp_codes">@sp_codes@social.sp-codes.de</a></strong>
</p> </p>
<div class="row justify-content-center"> <div class="row justify-content-center">
{% include "services-simple.html" %} {% include services-simple.html %}
</div> </div>
</div> </div>
</div> </div>
@ -44,4 +44,4 @@ eleventyNavigation:
</div> </div>
</div> </div>
{% include "profiles.html" %} {% include profiles.html %}