Fixed mod page function call, minor template fixes

This commit is contained in:
towards-a-new-leftypol 2023-08-03 18:43:25 -04:00
parent 0aa7417c09
commit 4156c2465c
3 changed files with 4 additions and 4 deletions

View File

@ -198,7 +198,7 @@ foreach ($pages as $uri => $handler) {
} elseif (is_callable("mod_page_$handler")) {
call_user_func_array("mod_page_$handler", $matches);
} elseif (is_callable("mod_$handler")) {
call_user_func_array("mod_$handler", $matches);
call_user_func_array("mod_$handler", array_slice($matches, 0, 2));
} else {
error("Mod page '$handler' not found!");
}

View File

@ -32,10 +32,10 @@
<th>{% trans 'Group' %}</th>
<td>
<ul style="padding:5px 8px;list-style:none">
{% for group_value, group_name in config.mod.groups if group_name != 'Disabled' %}
{% for group_value, group_name in config.mod.groups|filter((group_value, group_name) => group_name != 'Disabled') %}
<li>
<input type="radio" name="type" id="group_{{ group_name }}" value="{{ group_value }}">
<label for="group_{{ group_name }}">{% trans group_name %}</label>
<label for="group_{{ group_name }}">{{ group_name|trans }}</label>
</li>
{% endfor %}
</ul>

View File

@ -2,7 +2,7 @@
<fieldset id="notes">
<legend>
{% set notes_on_record = 'note' ~ (notes|count != 1 ? 's' : '') ~ ' on record' %}
<legend>{{ notes|count }} {% trans notes_on_record %}</legend>
<legend>{{ notes|count }} {{ notes_on_record|trans }}</legend>
</legend>
{% if notes and notes|length > 0 %}