Self hosted FLOSS fitness/workout, nutrition and weight tracker
Group options in the user preferences page
Roland Geider61e00835956e
diff --git a/wger/manager/templates/mobile/user/preferences.html b/wger/manager/templates/mobile/user/preferences.htmlindex eb1098dea..15e2015e5 100644--- a/wger/manager/templates/mobile/user/preferences.html+++ b/wger/manager/templates/mobile/user/preferences.html@@ -13,28 +13,45 @@class="ym-form">{% csrf_token %}{{ form.non_field_errors }}-<table>-{% for field in form %}- {% yaml_form_field field %}-{% endfor %}-</table>+ <div data-role="collapsible-set">+ <div data-role="collapsible" data-collapsed="false">+ <h3>{% trans "Email" %}</h3>+ <table>+ {% yaml_form_field email_form.email %}+ </table>+ </div>+ <div data-role="collapsible">+ <h3>{% trans "Workout reminders" %}</h3>+ <table>+ {% yaml_form_field form.workout_reminder_active %}+ {% yaml_form_field form.workout_duration %}+ {% yaml_form_field form.workout_reminder %}+ </table>+ </div>+ <div data-role="collapsible">+ <h3>{% trans "Gym mode" %}</h3>+ <table>+ {% yaml_form_field form.timer_active %}+ {% yaml_form_field form.timer_pause %}+ </table>+ </div>+ <div data-role="collapsible">+ <h3>{% trans "Other settings" %}</h3>+ <table>+ {% yaml_form_field form.notification_language %}+ {% yaml_form_field form.show_comments %}+ {% yaml_form_field form.show_english_ingredients %}+ </table>+ </div>+ </div>-<h3>{% trans "Email" %}</h3>--{{ email_form.non_field_errors }}-<table>-{% yaml_form_field email_form.email %}- <tr>- <td colspan="2">- <a href="{% url 'index' %}"+ <a href="{% url 'index' %}"data-role="button"data-rel="back"- data-mini="true">{% trans "Cancel" %}</a>+ data-mini="true">{% trans "Save" %}</a><input type="submit" value="{% trans 'Save' %}">- </td>- </tr>-</table>+</form>diff --git a/wger/manager/templates/user/preferences.html b/wger/manager/templates/user/preferences.htmlindex a3f478ce0..4ecaa055a 100644--- a/wger/manager/templates/user/preferences.html+++ b/wger/manager/templates/user/preferences.html@@ -6,40 +6,64 @@{% block title %}{% trans "Preferences" %}{% endblock %}+{% block header %}+ <script>+$(function() {+ $("#preferences-accordion").accordion({+ heightStyle: "content"+ });+});+</script>+{% endblock %}++{% block content %}<form action="{% url 'preferences' %}"method="post"class="ym-form">- {% csrf_token %}- {{ form.non_field_errors }}-<table>-{% for field in form %}- {% if field.name in select_lists %}- {% yaml_form_field field "ym-fbox-select" %}- {% else %}- {% yaml_form_field field %}- {% endif %}-{% endfor %}-</table>+ {% csrf_token %}+ {{ form.non_field_errors }}+ <div id="preferences-accordion">+ <h3>{% trans "Email" %}</h3>+ <div>+ <table>+ {% yaml_form_field email_form.email %}+ </table>+ </div>-<h3>{% trans "Email" %}</h3>--{{ email_form.non_field_errors }}-<table>-{% yaml_form_field email_form.email %}- <tr>- <td colspan="2">- <input type="submit" value="{% trans 'Save' %}">- </td>- </tr>-</table>-</form>+ <h3>{% trans "Workout reminders" %}</h3>+ <div>+ <table>+ {% yaml_form_field form.workout_reminder_active %}+ {% yaml_form_field form.workout_duration %}+ {% yaml_form_field form.workout_reminder %}+ </table>+ </div>+ <h3>{% trans "Gym mode" %} ({% trans "mobile version only" %})</h3>+ <div>+ <table>+ {% yaml_form_field form.timer_active %}+ {% yaml_form_field form.timer_pause %}+ </table>+ </div>+ <h3>{% trans "Other settings" %}</h3>+ <div>+ <table>+ {% yaml_form_field form.notification_language "ym-fbox-select" %}+ {% yaml_form_field form.show_comments %}+ {% yaml_form_field form.show_english_ingredients %}+ </table>+ </div>+ </div>+ <input type="submit" value="{% trans 'Save' %}">+</form>{% endblock %}+{% block sidebar %}<h3>{% trans "Options" %}</h3><p>