diff --git a/README.md b/README.md index 5dbe3c5..12fd5c7 100644 --- a/README.md +++ b/README.md @@ -14,4 +14,4 @@ Fixes/tweaks a few "issues" with the default UserFrosting installation, includin - Added 'hasRole' twig function to check if a user has a role (if a role doesn't exist, always returns false) - Added 'Auditer' role and split the activities permission away from site-admins (exclusive only) and everyone else - Made the input elements on the account settings page more in line with the other inputs (including the "hidden" and "disabled" mechanisms) -- Update the "User" form to use the partial form elements for common styling with accounts page \ No newline at end of file +- Updated all* forms to use partial form elements. \ No newline at end of file diff --git a/templates/forms/group.html.twig b/templates/forms/group.html.twig index c2f37b5..3bbcdc5 100644 --- a/templates/forms/group.html.twig +++ b/templates/forms/group.html.twig @@ -1,11 +1,19 @@ {% extends "@admin/forms/group.html.twig" %} {% block group_form %} - {% include "forms/inputs/group-name.html.twig" with { 'col_width': 'col-sm-12' } %} + {% block input_group_name %} + {% include "forms/inputs/group-name.html.twig" with { 'col_width': 'col-sm-12' } %} + {% endblock %} - {% include "forms/inputs/group-slug.html.twig" with { 'col_width': 'col-sm-12' } %} + {% block input_group_slug %} + {% include "forms/inputs/group-slug.html.twig" with { 'col_width': 'col-sm-12' } %} + {% endblock %} - {% include "forms/inputs/group-icon.html.twig" with { 'col_width': 'col-sm-12' } %} + {% block input_group_icon %} + {% include "forms/inputs/group-icon.html.twig" with { 'col_width': 'col-sm-12' } %} + {% endblock %} - {% include "forms/inputs/group-description.html.twig" with { 'col_width': 'col-sm-12' } %} + {% block input_group_description %} + {% include "forms/inputs/group-description.html.twig" with { 'col_width': 'col-sm-12' } %} + {% endblock %} {% endblock %} \ No newline at end of file diff --git a/templates/forms/inputs/group-description.html.twig b/templates/forms/inputs/group-description.html.twig index 6d712f0..fc4508d 100644 --- a/templates/forms/inputs/group-description.html.twig +++ b/templates/forms/inputs/group-description.html.twig @@ -1,9 +1,7 @@ -{% block input_group_description %} {% include "forms/inputs/abstract/description.html.twig" with { "type" : "group", "current_value" : group.description, "col_width" : col_width } -%} -{% endblock %} \ No newline at end of file +%} \ No newline at end of file diff --git a/templates/forms/inputs/group-icon.html.twig b/templates/forms/inputs/group-icon.html.twig index 53ec5fc..eed949d 100644 --- a/templates/forms/inputs/group-icon.html.twig +++ b/templates/forms/inputs/group-icon.html.twig @@ -1,4 +1,3 @@ -{% block input_group_icon %} {% include "forms/inputs/abstract/icon.html.twig" with { "type" : "group", @@ -7,5 +6,4 @@ "placeholder" : translate('GROUP.ICON_EXPLAIN'), "col_width" : col_width } -%} -{% endblock %} \ No newline at end of file +%} \ No newline at end of file diff --git a/templates/forms/inputs/group-name.html.twig b/templates/forms/inputs/group-name.html.twig index 776822a..c10e3c6 100644 --- a/templates/forms/inputs/group-name.html.twig +++ b/templates/forms/inputs/group-name.html.twig @@ -1,4 +1,3 @@ -{% block input_group_name %} {% include "forms/inputs/abstract/name.html.twig" with { "type" : "group", @@ -7,5 +6,4 @@ "placeholder" : translate('GROUP.NAME_EXPLAIN'), "col_width" : col_width } -%} -{% endblock %} \ No newline at end of file +%} \ No newline at end of file diff --git a/templates/forms/inputs/group-slug.html.twig b/templates/forms/inputs/group-slug.html.twig index db51ccc..0ff4cb1 100644 --- a/templates/forms/inputs/group-slug.html.twig +++ b/templates/forms/inputs/group-slug.html.twig @@ -1,9 +1,7 @@ -{% block input_group_slug %} {% include "forms/inputs/abstract/slug.html.twig" with { "type" : "group", "current_value" : group.slug, "col_width" : col_width } -%} -{% endblock %} \ No newline at end of file +%} \ No newline at end of file diff --git a/templates/forms/inputs/register-captcha.html.twig b/templates/forms/inputs/register-captcha.html.twig index 9d8cab5..805b4f2 100644 --- a/templates/forms/inputs/register-captcha.html.twig +++ b/templates/forms/inputs/register-captcha.html.twig @@ -1,4 +1,3 @@ -{% block input_user_locale %} {% if site.registration.captcha %} {% if col_width %}
{% endif %}
@@ -13,5 +12,4 @@
{% if col_width %}{% endif %} -{% endif %} -{% endblock %} \ No newline at end of file +{% endif %} \ No newline at end of file diff --git a/templates/forms/inputs/register-locale.html.twig b/templates/forms/inputs/register-locale.html.twig index 9f11af3..217217e 100644 --- a/templates/forms/inputs/register-locale.html.twig +++ b/templates/forms/inputs/register-locale.html.twig @@ -1,4 +1,3 @@ -{% block input_register_locale %} {% if 'locale' not in form.fields.hidden %} {% if col_width %}
{% endif %}
@@ -13,5 +12,4 @@

{{translate("LOCALE.ACCOUNT")}}.

{% if col_width %}
{% endif %} -{% endif %} -{% endblock %} \ No newline at end of file +{% endif %} \ No newline at end of file diff --git a/templates/forms/inputs/register-name_email.html.twig b/templates/forms/inputs/register-name_email.html.twig index 8e72387..be22e17 100644 --- a/templates/forms/inputs/register-name_email.html.twig +++ b/templates/forms/inputs/register-name_email.html.twig @@ -1,4 +1,3 @@ -{% block input_user_locale %} {% if 'locale' not in form.fields.hidden %} {% if col_width %}
{% endif %} @@ -24,5 +23,4 @@
{% if col_width %}{% endif %} -{% endif %} -{% endblock %} \ No newline at end of file +{% endif %} \ No newline at end of file diff --git a/templates/forms/inputs/register-password.html.twig b/templates/forms/inputs/register-password.html.twig index 86cfc09..b4960a8 100644 --- a/templates/forms/inputs/register-password.html.twig +++ b/templates/forms/inputs/register-password.html.twig @@ -1,4 +1,3 @@ -{% block input_user_password %} {% if 'password' not in form.fields.hidden %} {% if col_width %}
{% endif %}
@@ -10,5 +9,4 @@
{% if col_width %}
{% endif %} -{% endif %} -{% endblock %} \ No newline at end of file +{% endif %} \ No newline at end of file diff --git a/templates/forms/inputs/register-user_name.html.twig b/templates/forms/inputs/register-user_name.html.twig index 3f8781b..1759275 100644 --- a/templates/forms/inputs/register-user_name.html.twig +++ b/templates/forms/inputs/register-user_name.html.twig @@ -1,4 +1,3 @@ -{% block input_register_user_name %} {% if 'user_name' not in form.fields.hidden %} {% if col_width %}
{% endif %}
@@ -7,5 +6,4 @@
{% if col_width %}
{% endif %} -{% endif %} -{% endblock %} \ No newline at end of file +{% endif %} \ No newline at end of file diff --git a/templates/forms/inputs/role-description.html.twig b/templates/forms/inputs/role-description.html.twig index 5fc215a..acec5cc 100644 --- a/templates/forms/inputs/role-description.html.twig +++ b/templates/forms/inputs/role-description.html.twig @@ -1,9 +1,7 @@ -{% block input_role_description %} {% include "forms/inputs/abstract/description.html.twig" with { "type" : "role", "current_value" : role.description, "col_width" : col_width } -%} -{% endblock %} \ No newline at end of file +%} \ No newline at end of file diff --git a/templates/forms/inputs/role-name.html.twig b/templates/forms/inputs/role-name.html.twig index 984acd6..2cb3a87 100644 --- a/templates/forms/inputs/role-name.html.twig +++ b/templates/forms/inputs/role-name.html.twig @@ -1,4 +1,3 @@ -{% block input_role_name %} {% include "forms/inputs/abstract/name.html.twig" with { "type" : "role", @@ -6,5 +5,4 @@ "placeholder" : translate('ROLE.NAME_EXPLAIN'), "col_width" : col_width } -%} -{% endblock %} \ No newline at end of file +%} \ No newline at end of file diff --git a/templates/forms/inputs/role-slug.html.twig b/templates/forms/inputs/role-slug.html.twig index b1dd666..6882c26 100644 --- a/templates/forms/inputs/role-slug.html.twig +++ b/templates/forms/inputs/role-slug.html.twig @@ -1,9 +1,7 @@ -{% block input_role_slug %} {% include "forms/inputs/abstract/slug.html.twig" with { "type" : "role", "current_value" : role.slug, "col_width" : col_width } -%} -{% endblock %} \ No newline at end of file +%} \ No newline at end of file diff --git a/templates/forms/inputs/user-current_password.html.twig b/templates/forms/inputs/user-current_password.html.twig index 7e9c6d8..4a52fc2 100644 --- a/templates/forms/inputs/user-current_password.html.twig +++ b/templates/forms/inputs/user-current_password.html.twig @@ -1,4 +1,3 @@ -{% block input_user_current_password %} {% if 'password' not in form.fields.hidden %} {% if col_width %}
{% endif %}
@@ -9,5 +8,4 @@
{% if col_width %}{% endif %} -{% endif %} -{% endblock %} \ No newline at end of file +{% endif %} \ No newline at end of file diff --git a/templates/forms/inputs/user-email.html.twig b/templates/forms/inputs/user-email.html.twig index 4dd4f62..a7c2da0 100644 --- a/templates/forms/inputs/user-email.html.twig +++ b/templates/forms/inputs/user-email.html.twig @@ -1,4 +1,3 @@ -{% block input_user_email %} {% if 'email' not in form.fields.hidden %} {% if col_width %}
{% endif %}
@@ -16,5 +15,4 @@
{% if col_width %}{% endif %} -{% endif %} -{% endblock %} \ No newline at end of file +{% endif %} \ No newline at end of file diff --git a/templates/forms/inputs/user-first_name.html.twig b/templates/forms/inputs/user-first_name.html.twig index cc3c547..ffd82ce 100644 --- a/templates/forms/inputs/user-first_name.html.twig +++ b/templates/forms/inputs/user-first_name.html.twig @@ -1,4 +1,3 @@ -{% block input_user_first_name %} {% if 'first_name' not in form.fields.hidden %} {% if col_width %}
{% endif %}
@@ -9,5 +8,4 @@
{% if col_width %}{% endif %} -{% endif %} -{% endblock %} \ No newline at end of file +{% endif %} \ No newline at end of file diff --git a/templates/forms/inputs/user-group.html.twig b/templates/forms/inputs/user-group.html.twig index 306ef1a..f9b7563 100644 --- a/templates/forms/inputs/user-group.html.twig +++ b/templates/forms/inputs/user-group.html.twig @@ -1,4 +1,3 @@ -{% block input_user_group %} {% if 'group' not in form.fields.hidden %} {% if col_width %}
{% endif %}
@@ -19,5 +18,4 @@
{% if col_width %}{% endif %} -{% endif %} -{% endblock %} \ No newline at end of file +{% endif %} \ No newline at end of file diff --git a/templates/forms/inputs/user-last_name.html.twig b/templates/forms/inputs/user-last_name.html.twig index 5c92a70..1d7290d 100644 --- a/templates/forms/inputs/user-last_name.html.twig +++ b/templates/forms/inputs/user-last_name.html.twig @@ -1,4 +1,3 @@ -{% block input_user_last_name %} {% if 'last_name' not in form.fields.hidden %} {% if col_width %}
{% endif %}
@@ -9,5 +8,4 @@
{% if col_width %}{% endif %} -{% endif %} -{% endblock %} \ No newline at end of file +{% endif %} \ No newline at end of file diff --git a/templates/forms/inputs/user-locale.html.twig b/templates/forms/inputs/user-locale.html.twig index 233aa13..79590b5 100644 --- a/templates/forms/inputs/user-locale.html.twig +++ b/templates/forms/inputs/user-locale.html.twig @@ -1,4 +1,3 @@ -{% block input_user_locale %} {% if 'locale' not in form.fields.hidden %} {% if col_width %}
{% endif %}
@@ -17,5 +16,4 @@
{% if col_width %}{% endif %} -{% endif %} -{% endblock %} \ No newline at end of file +{% endif %} \ No newline at end of file diff --git a/templates/forms/inputs/user-name.html.twig b/templates/forms/inputs/user-name.html.twig index b7b1b6e..a2817fd 100644 --- a/templates/forms/inputs/user-name.html.twig +++ b/templates/forms/inputs/user-name.html.twig @@ -1,4 +1,3 @@ -{% block input_user_name %} {% if 'name' not in form.fields.hidden %} {% if col_width %}
{% endif %}
@@ -6,5 +5,4 @@ {% include "forms/inputs/user-last_name.html.twig" with { 'col_width': 'col-sm-6' } %}
{% if col_width %}
{% endif %} -{% endif %} -{% endblock %} \ No newline at end of file +{% endif %} \ No newline at end of file diff --git a/templates/forms/inputs/user-new_password.html.twig b/templates/forms/inputs/user-new_password.html.twig index f80bf49..c903d46 100644 --- a/templates/forms/inputs/user-new_password.html.twig +++ b/templates/forms/inputs/user-new_password.html.twig @@ -1,4 +1,3 @@ -{% block input_user_new_password %} {% if 'password' not in form.fields.hidden %} {% if col_width %}
{% endif %}
@@ -16,5 +15,4 @@
{% if col_width %}{% endif %} -{% endif %} -{% endblock %} \ No newline at end of file +{% endif %} \ No newline at end of file diff --git a/templates/forms/inputs/user-theme.html.twig b/templates/forms/inputs/user-theme.html.twig index 8d42f4b..0fda2ef 100644 --- a/templates/forms/inputs/user-theme.html.twig +++ b/templates/forms/inputs/user-theme.html.twig @@ -1,4 +1,3 @@ -{% block input_user_theme %} {% if 'theme' not in form.fields.hidden %} {% if col_width %}
{% endif %}
@@ -17,5 +16,4 @@
{% if col_width %}{% endif %} -{% endif %} -{% endblock %} \ No newline at end of file +{% endif %} \ No newline at end of file diff --git a/templates/forms/inputs/user-user_name.html.twig b/templates/forms/inputs/user-user_name.html.twig index 8384d35..b8d02df 100644 --- a/templates/forms/inputs/user-user_name.html.twig +++ b/templates/forms/inputs/user-user_name.html.twig @@ -1,4 +1,3 @@ -{% block input_user_user_name %} {% if 'user_name' not in form.fields.hidden %} {% if col_width %}
{% endif %}
@@ -9,5 +8,4 @@
{% if col_width %}{% endif %} -{% endif %} -{% endblock %} \ No newline at end of file +{% endif %} \ No newline at end of file diff --git a/templates/forms/register.html.twig b/templates/forms/register.html.twig index cf31822..aa03d23 100644 --- a/templates/forms/register.html.twig +++ b/templates/forms/register.html.twig @@ -5,21 +5,32 @@
{% block register_form %} - {% include "forms/inputs/register-name_email.html.twig" with { 'col_width': 'col-sm-12' } %} + {% block input_register_name_email %} + {% include "forms/inputs/register-name_email.html.twig" with { 'col_width': 'col-sm-12' } %} + {% endblock %} - {% include "forms/inputs/register-user_name.html.twig" with { 'col_width': 'col-sm-12' } %} + {% block input_register_user_name %} + {% include "forms/inputs/register-user_name.html.twig" with { 'col_width': 'col-sm-12' } %} + {% endblock %} - {% include "forms/inputs/register-password.html.twig" with { 'col_width': 'col-sm-12' } %} + {% block input_register_password %} + {% include "forms/inputs/register-password.html.twig" with { 'col_width': 'col-sm-12' } %} + {% endblock %} - {% include "forms/inputs/register-locale.html.twig" with { 'col_width': 'col-sm-12' } %} + {% block input_register_locale %} + {% include "forms/inputs/register-locale.html.twig" with { 'col_width': 'col-sm-12' } %} + {% endblock %} - {% include "forms/inputs/register-captcha.html.twig" with { 'col_width': 'col-sm-12' } %} + {% block input_register_captcha %} + {% include "forms/inputs/register-captcha.html.twig" with { 'col_width': 'col-sm-12' } %} + {% endblock %}
+ {% block tos %}

{{translate('TOS_AGREEMENT', { @@ -28,6 +39,7 @@ }) | raw}}

+ {% endblock %} {% endblock %}
diff --git a/templates/forms/role.html.twig b/templates/forms/role.html.twig index 6adc274..ef50c8d 100644 --- a/templates/forms/role.html.twig +++ b/templates/forms/role.html.twig @@ -4,11 +4,17 @@
{% block role_form %} - {% include "forms/inputs/role-name.html.twig" with { 'col_width': 'col-sm-12' } %} + {% block input_role_name %} + {% include "forms/inputs/role-name.html.twig" with { 'col_width': 'col-sm-12' } %} + {% endblock %} - {% include "forms/inputs/role-slug.html.twig" with { 'col_width': 'col-sm-12' } %} + {% block input_role_slug %} + {% include "forms/inputs/role-slug.html.twig" with { 'col_width': 'col-sm-12' } %} + {% endblock %} - {% include "forms/inputs/role-description.html.twig" with { 'col_width': 'col-sm-12' } %} + {% block input_role_description %} + {% include "forms/inputs/role-description.html.twig" with { 'col_width': 'col-sm-12' } %} + {% endblock %} {% endblock %}

diff --git a/templates/forms/settings-account.html.twig b/templates/forms/settings-account.html.twig index 6a7e494..69e5017 100644 --- a/templates/forms/settings-account.html.twig +++ b/templates/forms/settings-account.html.twig @@ -10,11 +10,15 @@ {% block settings_account %}
- {% include "forms/inputs/user-email.html.twig" with { 'col_width': 'col-sm-12' } %} + {% block input_user_email %} + {% include "forms/inputs/user-email.html.twig" with { 'col_width': 'col-sm-12' } %} + {% endblock %}
- {% include "forms/inputs/user-new_password.html.twig" with { 'col_width': 'col-sm-12' } %} + {% block input_user_new_password %} + {% include "forms/inputs/user-new_password.html.twig" with { 'col_width': 'col-sm-12' } %} + {% endblock %}
{% if 'password' not in form.fields.hidden %} @@ -22,7 +26,9 @@ {% endif %}
- {% include "forms/inputs/user-current_password.html.twig" with { 'col_width': 'col-sm-12' } %} + {% block input_user_current_password %} + {% include "forms/inputs/user-current_password.html.twig" with { 'col_width': 'col-sm-12' } %} + {% endblock %}
{% endblock %}
diff --git a/templates/forms/settings-profile.html.twig b/templates/forms/settings-profile.html.twig index 869e86e..a6a12ee 100644 --- a/templates/forms/settings-profile.html.twig +++ b/templates/forms/settings-profile.html.twig @@ -7,11 +7,15 @@ {% block settings_profile %}
- {% include "forms/inputs/user-name.html.twig" with { 'col_width': 'col-sm-12' } %} + {% block input_user_name %} + {% include "forms/inputs/user-name.html.twig" with { 'col_width': 'col-sm-12' } %} + {% endblock %}
- {% include "forms/inputs/user-locale.html.twig" with { 'col_width': 'col-sm-12' } %} + {% block input_user_locale %} + {% include "forms/inputs/user-locale.html.twig" with { 'col_width': 'col-sm-12' } %} + {% endblock %}
{% endblock %} diff --git a/templates/forms/user.html.twig b/templates/forms/user.html.twig index 78f0c42..623e560 100644 --- a/templates/forms/user.html.twig +++ b/templates/forms/user.html.twig @@ -1,19 +1,33 @@ {% extends "@admin/forms/user.html.twig" %} {% block user_form %} - {% include "forms/inputs/user-user_name.html.twig" with { 'col_width': 'col-sm-6' } %} + {% block input_user_user_name %} + {% include "forms/inputs/user-user_name.html.twig" with { 'col_width': 'col-sm-6' } %} + {% endblock %} - {% include "forms/inputs/user-group.html.twig" with { 'col_width': 'col-sm-6' } %} + {% block input_user_group %} + {% include "forms/inputs/user-group.html.twig" with { 'col_width': 'col-sm-6' } %} + {% endblock %} - {% include "forms/inputs/user-name.html.twig" with { 'col_width': 'col-sm-12' } %} + {% block input_user_name %} + {% include "forms/inputs/user-name.html.twig" with { 'col_width': 'col-sm-12' } %} + {% endblock %} - {% include "forms/inputs/user-email.html.twig" with { 'col_width': 'col-sm-6' } %} + {% block input_user_email %} + {% include "forms/inputs/user-email.html.twig" with { 'col_width': 'col-sm-6' } %} + {% endblock %} - {% include "forms/inputs/user-theme.html.twig" with { 'col_width': 'col-sm-6' } %} + {% block input_user_theme %} + {% include "forms/inputs/user-theme.html.twig" with { 'col_width': 'col-sm-6' } %} + {% endblock %} - {% include "forms/inputs/user-locale.html.twig" with { 'col_width': 'col-sm-6' } %} + {% block input_user_locale %} + {% include "forms/inputs/user-locale.html.twig" with { 'col_width': 'col-sm-6' } %} + {% endblock %} - {% if 'password' not in form.fields.hidden %} - {% include "forms/partials/user-set-password.html.twig" %} - {% endif %} + {% block input_user_description %} + {% if 'password' not in form.fields.hidden %} + {% include "forms/partials/user-set-password.html.twig" %} + {% endif %} + {% endblock %} {% endblock %} \ No newline at end of file