From 410f8fed7608c638ad2a51c4d323b9cd69d332ef Mon Sep 17 00:00:00 2001 From: Eric Riggs Date: Wed, 7 Mar 2018 16:26:46 -0400 Subject: [PATCH] - Fix login and authentication views by adding the html_extra_classes Link attribute and using it to avoid loading authentication clicks as partials. - Add a new base_plain template as parernt for the authentication templates. Signed-off-by: Eric Riggs --- .../appearance/static/appearance/js/base.js | 2 +- .../templates/appearance/base_plain.html | 58 +++++++++++++++++++ .../templates/authentication/login.html | 2 +- .../password_reset_complete.html | 2 +- .../password_reset_confirm.html | 2 +- .../authentication/password_reset_done.html | 2 +- .../authentication/password_reset_form.html | 2 +- .../navigation/generic_link_instance.html | 4 +- mayan/apps/authentication/links.py | 3 +- mayan/apps/navigation/classes.py | 11 +++- 10 files changed, 76 insertions(+), 12 deletions(-) create mode 100644 mayan/apps/appearance/templates/appearance/base_plain.html diff --git a/mayan/apps/appearance/static/appearance/js/base.js b/mayan/apps/appearance/static/appearance/js/base.js index aaab24e581..cadcecfe01 100644 --- a/mayan/apps/appearance/static/appearance/js/base.js +++ b/mayan/apps/appearance/static/appearance/js/base.js @@ -3,7 +3,7 @@ var app = new App(); var partialNavigation = new PartialNavigation({ initialURL: initialURL, - excludeAnchorClasses: ['fancybox', 'new_window'], + excludeAnchorClasses: ['fancybox', 'new_window', 'non-ajax'], formBeforeSerializeCallbacks: [App.MultiObjectFormProcess], }); diff --git a/mayan/apps/appearance/templates/appearance/base_plain.html b/mayan/apps/appearance/templates/appearance/base_plain.html new file mode 100644 index 0000000000..77ebb9089b --- /dev/null +++ b/mayan/apps/appearance/templates/appearance/base_plain.html @@ -0,0 +1,58 @@ +{% load i18n %} +{% load static %} + +{% load compress %} + +{% load common_tags %} +{% load navigation_tags %} + +{% spaceless %} + + + + + + + + + {% block base_title %} + {% block title %}{% endblock %} :: {% block project_name %}{% project_name %}{% endblock %} + {% endblock base_title %} + + + {% compress css %} + + + + {% block stylesheets %}{% endblock %} + {% endcompress %} + + + + {% block content_plain %}{% endblock %} + + + + + {% compress js %} + + + + {% endcompress %} + + +{% endspaceless %} diff --git a/mayan/apps/appearance/templates/authentication/login.html b/mayan/apps/appearance/templates/authentication/login.html index bc1254e2c6..9b595c81f7 100644 --- a/mayan/apps/appearance/templates/authentication/login.html +++ b/mayan/apps/appearance/templates/authentication/login.html @@ -1,4 +1,4 @@ -{% extends 'appearance/base.html' %} +{% extends 'appearance/base_plain.html' %} {% load i18n %} {% load static %} diff --git a/mayan/apps/appearance/templates/authentication/password_reset_complete.html b/mayan/apps/appearance/templates/authentication/password_reset_complete.html index 8ff6913fb8..48b778dcb7 100644 --- a/mayan/apps/appearance/templates/authentication/password_reset_complete.html +++ b/mayan/apps/appearance/templates/authentication/password_reset_complete.html @@ -1,4 +1,4 @@ -{% extends 'appearance/base.html' %} +{% extends 'appearance/base_plain.html' %} {% load i18n %} {% load static %} diff --git a/mayan/apps/appearance/templates/authentication/password_reset_confirm.html b/mayan/apps/appearance/templates/authentication/password_reset_confirm.html index 12c16ce80b..cc4a413baf 100644 --- a/mayan/apps/appearance/templates/authentication/password_reset_confirm.html +++ b/mayan/apps/appearance/templates/authentication/password_reset_confirm.html @@ -1,4 +1,4 @@ -{% extends 'appearance/base.html' %} +{% extends 'appearance/base_plain.html' %} {% load i18n %} {% load static %} diff --git a/mayan/apps/appearance/templates/authentication/password_reset_done.html b/mayan/apps/appearance/templates/authentication/password_reset_done.html index 887e7e0bba..f4619e0af8 100644 --- a/mayan/apps/appearance/templates/authentication/password_reset_done.html +++ b/mayan/apps/appearance/templates/authentication/password_reset_done.html @@ -1,4 +1,4 @@ -{% extends 'appearance/base.html' %} +{% extends 'appearance/base_plain.html' %} {% load i18n %} {% load static %} diff --git a/mayan/apps/appearance/templates/authentication/password_reset_form.html b/mayan/apps/appearance/templates/authentication/password_reset_form.html index 12c16ce80b..cc4a413baf 100644 --- a/mayan/apps/appearance/templates/authentication/password_reset_form.html +++ b/mayan/apps/appearance/templates/authentication/password_reset_form.html @@ -1,4 +1,4 @@ -{% extends 'appearance/base.html' %} +{% extends 'appearance/base_plain.html' %} {% load i18n %} {% load static %} diff --git a/mayan/apps/appearance/templates/navigation/generic_link_instance.html b/mayan/apps/appearance/templates/navigation/generic_link_instance.html index 344ec4afe1..ad4e1cbcfa 100644 --- a/mayan/apps/appearance/templates/navigation/generic_link_instance.html +++ b/mayan/apps/appearance/templates/navigation/generic_link_instance.html @@ -4,10 +4,10 @@ {% else %} {% if link.disabled %} - {% if link.icon %}{% endif %}{% if link.icon_class %}{{ link.icon_class.render }}{% endif %} {{ link.text }}{% if link.error %} - {{ link.error }}{% endif %}{% if horizontal %}{% if not forloop.last %} {% endif %}{% endif %} + {% if link.icon %}{% endif %}{% if link.icon_class %}{{ link.icon_class.render }}{% endif %} {{ link.text }}{% if link.error %} - {{ link.error }}{% endif %}{% if horizontal %}{% if not forloop.last %} {% endif %}{% endif %} {% else %}