]> git.agnieray.net Git - galette.git/commitdiff
Use toogles instead of checkboxes when possible
authorGuillaume AGNIERAY <dev@agnieray.net>
Thu, 26 Jan 2023 12:39:38 +0000 (13:39 +0100)
committerJohan Cwiklinski <johan@x-tnd.be>
Sat, 28 Jan 2023 06:41:23 +0000 (07:41 +0100)
galette/templates/default/components/dynamic_fields.html.twig
galette/templates/default/pages/admintools.html.twig
galette/templates/default/pages/reminder.html.twig

index 655fe4fd5b96d44f4bca7da5c44984b952953c33..334f2021c3b0aac58d491c0d842b31d1305ac89e 100644 (file)
         />
         <span class="exemple">{{ _T("(yyyy-mm-dd format)") }}</span>
     {% elseif get_class(field) == 'Galette\\DynamicFields\\Boolean' %}
-        <input type="checkbox" name="info_field_{{ field.getId() }}_{{ loop }}" id="info_field_{{ field.getId() }}_{{ loop }}" value="1"
-            {% if valuedata == 1%} checked="checked"{% endif %}
-            {% if field.isRepeatable() %} data-maxrepeat="{{ field.getRepeat() }}"{% endif %}
-        {% if not masschange %}
-            {% if field.isRequired() %} required="required"{% endif %}
-        {% endif %}
-            {% if disabled %} disabled="disabled"{% endif %}
-        />
+        <div class="ui toggle checkbox">
+            <input type="checkbox" name="info_field_{{ field.getId() }}_{{ loop }}" id="info_field_{{ field.getId() }}_{{ loop }}" value="1"
+                {% if valuedata == 1%} checked="checked"{% endif %}
+                {% if field.isRepeatable() %} data-maxrepeat="{{ field.getRepeat() }}"{% endif %}
+            {% if not masschange %}
+                {% if field.isRequired() %} required="required"{% endif %}
+            {% endif %}
+                {% if disabled %} disabled="disabled"{% endif %}
+            />
+        </div>
     {% elseif get_class(field) == 'Galette\\DynamicFields\\File' %}
         {% if object.id %}
         <label class="labelalign" for="info_field_{{ field.getId() }}_{{ loop }}_new">{{ _T("new") }}</label>
index 8e997e416d8db365259fa8249539f05a9040595a..fff3389f1b0d18b49323c1cf960273680f2ee9ec 100644 (file)
@@ -9,28 +9,43 @@
         <div class="ui bottom attached accordion-styled segment">
             <div class="active content field">
                 <div class="field inline">
-                    <label for="inittexts" title="{{ _T('Reset all emails contents to their default values') }}">{{ _T('Reset emails contents') }}</label>
-                    <input type="checkbox" name="inittexts" id="inittexts"/>
-                    <i class="circular inverted primary small icon info tooltip" title="{{ _T('Reset all emails contents to their default values') }}"></i>
-                    <span class="exemple">{{ _T('(all existing values will be removed)') }}</span>
+                    <div class="ui toggle checkbox">
+                        <input type="checkbox" name="inittexts" id="inittexts"/>
+                        <label for="inittexts" title="{{ _T('Reset all emails contents to their default values') }}">
+                            {{ _T('Reset emails contents') }}
+                            <i class="circular inverted primary small icon info tooltip" title="{{ _T('Reset all emails contents to their default values') }}"></i>
+                            <span class="exemple">{{ _T('(all existing values will be removed)') }}</span>
+                        </label>
+                    </div>
                 </div>
                 <div class="field inline">
-                    <label for="initfields" title="{{ _T('Reset all emails contents to their default values') }}">{{ _T('Reset fields configuration') }}</label>
-                    <input type="checkbox" name="initfields" id="initfields"/>
-                    <i class="circular inverted primary small icon info tooltip" title="{{ _T('Reset all emails contents to their default values') }}<br/>{{ _T('This includes fields positions, order, visibility, access levels and mandatory marks.') }}"></i>
-                    <span class="exemple">{{ _T('(all existing values will be removed)') }}</span>
+                    <div class="ui toggle checkbox">
+                        <input type="checkbox" name="initfields" id="initfields"/>
+                        <label for="initfields" title="{{ _T('Reset all emails contents to their default values') }}">
+                            {{ _T('Reset fields configuration') }}
+                            <i class="circular inverted primary small icon info tooltip" title="{{ _T('Reset all emails contents to their default values') }}<br/>{{ _T('This includes fields positions, order, visibility, access levels and mandatory marks.') }}"></i>
+                            <span class="exemple">{{ _T('(all existing values will be removed)') }}</span>
+                        </label>
+                    </div>
                 </div>
                 <div class="field inline">
-                    <label for="initpdfmodels" title="{{ _T('Reset all PDF models to their default values') }}">{{ _T('Reinitialize PDF models') }}</label>
-                    <span class="tip"></span>
-                    <input type="checkbox" name="initpdfmodels" id="initpdfmodels"/>
-                    <i class="circular inverted primary small icon info tooltip" title="{{ _T('Reset all PDF models to their default values') }}"></i>
-                    <span class="exemple">{{ _T('(all existing values will be removed)') }}</span>
+                    <div class="ui toggle checkbox">
+                        <input type="checkbox" name="initpdfmodels" id="initpdfmodels"/>
+                        <label for="initpdfmodels" title="{{ _T('Reset all PDF models to their default values') }}">
+                            {{ _T('Reinitialize PDF models') }}
+                            <i class="circular inverted primary small icon info tooltip" title="{{ _T('Reset all PDF models to their default values') }}"></i>
+                            <span class="exemple">{{ _T('(all existing values will be removed)') }}</span>
+                        </label>
+                    </div>
                 </div>
                 <div class="field inline">
-                    <label for="emptylogins" title="{{ _T('Fill all empty login and passwords') }}">{{ _T('Generate empty logins and passwords') }}</label>
-                    <input type="checkbox" name="emptylogins" id="emptylogins"/>
-                    <i class="circular inverted primary small icon info tooltip" title="{{ _T('Fill all empty login and passwords') }}"></i>
+                    <div class="ui toggle checkbox">
+                        <input type="checkbox" name="emptylogins" id="emptylogins"/>
+                        <label for="emptylogins" title="{{ _T('Fill all empty login and passwords') }}">
+                            {{ _T('Generate empty logins and passwords') }}
+                            <i class="circular inverted primary small icon info tooltip" title="{{ _T('Fill all empty login and passwords') }}"></i>
+                        </label>
+                    </div>
                 </div>
             </div>
         </div>
index 093c2554d243df4d65e893b9695570a16a5e48e0..33ddd51d1077b24c694f839be1eb3722d759469d 100644 (file)
@@ -8,22 +8,28 @@
             <div class="ui bottom attached accordion-styled segment">
                 <div class="active content field">
                     <div class="inline field{% if count_impending == 0 and count_impending_nomail == 0 %} disabled{% endif %}">
-                        <input type="checkbox" name="reminders[]" id="reminder_impending" value="{{ constant("Galette\\Entity\\Reminder::IMPENDING") }}"{% if count_impending == 0 and count_impending_nomail == 0 %} disabled="disabled"{% endif %}/>
-                        <label for="reminder_impending">{{ _T("Impending due date") }}</label>
+                        <div class="ui toggle checkbox">
+                            <input type="checkbox" name="reminders[]" id="reminder_impending" value="{{ constant("Galette\\Entity\\Reminder::IMPENDING") }}"{% if count_impending == 0 and count_impending_nomail == 0 %} disabled="disabled"{% endif %}/>
+                            <label for="reminder_impending">{{ _T("Impending due date") }}</label>
+                        </div>
                         <a class="show_previews" id="impending" href="#impending_preview">({{ _T("preview") }})</a> -
                         <a href="{{ path_for("reminders-filter", {"membership": "nearly", "mail": "withmail"}) }}">{{ _T("%s members with an email address")|replace({"%s": count_impending}) }}</a>
                         <a href="{{ path_for("reminders-filter", {"membership": "nearly", "mail": "withoutmail"}) }}">{{ _T("%s members without email address")|replace({"%s": count_impending_nomail}) }}</a>
                     </div>
                     <div class="inline field{% if count_late == 0 and count_late_nomail == 0 %} disabled{% endif %}">
-                        <input type="checkbox" name="reminders[]" id="reminder_late" value="{{ constant("Galette\\Entity\\Reminder::LATE") }}"{% if count_late == 0 and count_late_nomail == 0 %} disabled="disabled"{% endif %}/>
-                        <label for="reminder_late">{{ _T("Late") }}</label>
+                        <div class="ui toggle checkbox">
+                            <input type="checkbox" name="reminders[]" id="reminder_late" value="{{ constant("Galette\\Entity\\Reminder::LATE") }}"{% if count_late == 0 and count_late_nomail == 0 %} disabled="disabled"{% endif %}/>
+                            <label for="reminder_late">{{ _T("Late") }}</label>
+                        </div>
                         <a class="show_previews" id="late" href="#impending_preview">({{ _T("preview") }})</a> -
                         <a href="{{ path_for("reminders-filter", {"membership": "late", "mail": "withmail"}) }}">{{ _T("%s members with an email address")|replace({"%s": count_late}) }}</a>
                         <a href="{{ path_for("reminders-filter", {"membership": "late", "mail": "withoutmail"}) }}">{{ _T("%s members without email address")|replace({"%s": count_late_nomail}) }}</a>
                     </div>
                     <div class="inline field{% if count_impending_nomail == 0 and count_late_nomail == 0 %} disabled{% endif %}">
-                        <input type="checkbox" name="reminder_wo_mail" id="reminder_wo_mail" value="1"{% if count_impending_nomail == 0 and count_late_nomail == 0 %} disabled="disabled"{% endif %}/>
-                        <label for="reminder_wo_mail">{{ _T("Generate labels for members without email address") }}</label>
+                        <div class="ui toggle checkbox">
+                            <input type="checkbox" name="reminder_wo_mail" id="reminder_wo_mail" value="1"{% if count_impending_nomail == 0 and count_late_nomail == 0 %} disabled="disabled"{% endif %}/>
+                            <label for="reminder_wo_mail">{{ _T("Generate labels for members without email address") }}</label>
+                        </div>
                     </div>
                 </div>
             </div>