]> git.agnieray.net Git - galette.git/blobdiff - galette/templates/default/pages/contribution_type_form.html.twig
Monthly membership; closes #1438
[galette.git] / galette / templates / default / pages / contribution_type_form.html.twig
index 538cfacbf62f5d7008755818ce6b269664f5cce8..571ed5b76805e65e41f60fbfb1807932be7e8afd 100644 (file)
                 <label for="amount">{{ _T("Amount:") }}</label>
                 <input type="text" name="amount" id="amount" value="{{ entry.amount }}"/>
             </div>
-            <div class="ui toggle checkbox">
-                <input type="checkbox" name="cotis_extension" id="cotis_extension" value="1"{% if entry.cotis_extension == 1 %} checked="checked"{% endif %} />
-                <label for="cotis_extension">
-                    {{ _T("Extends membership?") }}
-                </label>
-            </div>
+            {% set cotisextensions = {
+                (constant("Galette\\Entity\\ContributionsTypes::DEFAULT_TYPE")): _T("Default"),
+                (constant("Galette\\Entity\\ContributionsTypes::DONATION_TYPE")): _T("No"),
+                (1): _Tn('%1$s month', '%1$s months', 1)|format(1)
+            } %}
+            {% for m in 2..11 %}
+                {% set cotisextensions = cotisextensions + {(m): _Tn('%1$s month', '%1$s months', m)|format(m)} %}
+            {% endfor %}
+            {% include "components/forms/select.html.twig" with {
+                id: 'cotis_extension',
+                value: entry.cotis_extension,
+                values: cotisextensions,
+                label: _T("Membership extension"),
+                component_class: 'field inline',
+            } %}
         </div>
 
         <input type="hidden" name="mod" id="mod" value="{{ entry.id_type_cotis }}"/>