- 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 <ericriggs42@gmail.com>
This commit is contained in:
committed by
Roberto Rosario
parent
5b3285c006
commit
410f8fed76
@@ -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],
|
||||
});
|
||||
|
||||
|
||||
58
mayan/apps/appearance/templates/appearance/base_plain.html
Normal file
58
mayan/apps/appearance/templates/appearance/base_plain.html
Normal file
@@ -0,0 +1,58 @@
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
{% load compress %}
|
||||
|
||||
{% load common_tags %}
|
||||
{% load navigation_tags %}
|
||||
|
||||
{% spaceless %}
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="Content-Language" content="{{ LANGUAGE_CODE }}" />
|
||||
<title>
|
||||
{% block base_title %}
|
||||
{% block title %}{% endblock %} :: {% block project_name %}{% project_name %}{% endblock %}
|
||||
{% endblock base_title %}
|
||||
</title>
|
||||
|
||||
{% compress css %}
|
||||
<link href="{% static 'appearance/vendors/fontawesome-free-5.0.8/svg-with-js/css/fa-svg-with-js.css' %}" media="screen" rel="stylesheet" type="text/css" />
|
||||
<link href="{% static 'appearance/packages/bootswatch.com/flatly/bootstrap.css' %}" media="screen" rel="stylesheet" type="text/css" />
|
||||
<link href="{% static 'appearance/css/base.css' %}" media="screen" rel="stylesheet" type="text/css" />
|
||||
{% block stylesheets %}{% endblock %}
|
||||
{% endcompress %}
|
||||
<script>
|
||||
function waitForJQuery(func) {
|
||||
if (window.jQuery) {
|
||||
func();
|
||||
} else {
|
||||
setTimeout(function() {
|
||||
waitForJQuery(func)
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
{% block content_plain %}{% endblock %}
|
||||
|
||||
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
{% compress js %}
|
||||
<script src="{% static 'appearance/packages/jquery-2.1.4.min.js' %}" type="text/javascript"></script>
|
||||
<script src="{% static 'appearance/packages/bootstrap-3.3.4-dist/js/bootstrap.min.js' %}" type="text/javascript"></script>
|
||||
<script src="{% static 'appearance/vendors/fontawesome-free-5.0.8/svg-with-js/js/fontawesome-all.min.js' %}" type="text/javascript"></script>
|
||||
{% endcompress %}
|
||||
</body>
|
||||
</html>
|
||||
{% endspaceless %}
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends 'appearance/base.html' %}
|
||||
{% extends 'appearance/base_plain.html' %}
|
||||
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends 'appearance/base.html' %}
|
||||
{% extends 'appearance/base_plain.html' %}
|
||||
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends 'appearance/base.html' %}
|
||||
{% extends 'appearance/base_plain.html' %}
|
||||
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends 'appearance/base.html' %}
|
||||
{% extends 'appearance/base_plain.html' %}
|
||||
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends 'appearance/base.html' %}
|
||||
{% extends 'appearance/base_plain.html' %}
|
||||
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
<li class="text-center link-text-span" >{{ link.text }}</li>
|
||||
{% else %}
|
||||
{% if link.disabled %}
|
||||
<a class="{% if link_classes %}{{ link_classes }} {% else %}btn {% if 'dangerous' in link.tags %}btn-danger{% else %}btn-primary{% endif %} btn-xs{% endif %} {% if link.active %}{{ link_class_active }}{% endif %} {% if 'new_window' in link.tags %}new_window{% endif %} disabled" disabled='disabled' style="cursor: default;" href="#">{% if link.icon %}<i class="hidden-xs hidden-sm hidden-md {{ link.icon }}"></i>{% endif %}{% if link.icon_class %}{{ link.icon_class.render }}{% endif %} {{ link.text }}{% if link.error %} - {{ link.error }}{% endif %}</a>{% if horizontal %}{% if not forloop.last %} {% endif %}{% endif %}
|
||||
<a class="{{ link.html_extra_classes }} {% if link_classes %}{{ link_classes }} {% else %}btn {% if 'dangerous' in link.tags %}btn-danger{% else %}btn-primary{% endif %} btn-xs{% endif %} {% if link.active %}{{ link_class_active }}{% endif %} {% if 'new_window' in link.tags %}new_window{% endif %} disabled" disabled='disabled' style="cursor: default;" href="#">{% if link.icon %}<i class="hidden-xs hidden-sm hidden-md {{ link.icon }}"></i>{% endif %}{% if link.icon_class %}{{ link.icon_class.render }}{% endif %} {{ link.text }}{% if link.error %} - {{ link.error }}{% endif %}</a>{% if horizontal %}{% if not forloop.last %} {% endif %}{% endif %}
|
||||
{% else %}
|
||||
<a
|
||||
class="{% if link_classes %}{{ link_classes }} {% else %}btn {% if 'dangerous' in link.tags %}btn-danger{% else %}btn-primary{% endif %} btn-xs{% endif %} {% if link.active %}{{ link_class_active }}{% endif %} {% if 'new_window' in link.tags %}new_window{% endif %}"
|
||||
class="{{ link.html_extra_classes }} {% if link_classes %}{{ link_classes }} {% else %}btn {% if 'dangerous' in link.tags %}btn-danger{% else %}btn-primary{% endif %} btn-xs{% endif %} {% if link.active %}{{ link_class_active }}{% endif %} {% if 'new_window' in link.tags %}new_window{% endif %}"
|
||||
{% for key,value in link.html_data.items %}
|
||||
data-{{ key }}={{ value }}
|
||||
{% endfor %}
|
||||
|
||||
@@ -10,7 +10,8 @@ def has_usable_password(context):
|
||||
|
||||
|
||||
link_logout = Link(
|
||||
icon='fa fa-sign-out-alt', text=_('Logout'), view='authentication:logout_view'
|
||||
html_extra_classes='non-ajax', icon='fa fa-sign-out-alt',
|
||||
text=_('Logout'), view='authentication:logout_view'
|
||||
)
|
||||
link_password_change = Link(
|
||||
condition=has_usable_password, icon='fa fa-key', text=_('Change password'),
|
||||
|
||||
@@ -41,6 +41,10 @@ class ResolvedLink(object):
|
||||
def html_data(self):
|
||||
return self.link.html_data
|
||||
|
||||
@property
|
||||
def html_extra_classes(self):
|
||||
return self.link.html_extra_classes
|
||||
|
||||
@property
|
||||
def icon(self):
|
||||
return self.link.icon
|
||||
@@ -249,9 +253,9 @@ class Menu(object):
|
||||
class Link(object):
|
||||
def __init__(self, text, view=None, args=None, condition=None,
|
||||
conditional_disable=None, description=None, html_data=None,
|
||||
icon=None, icon_class=None, keep_query=False, kwargs=None,
|
||||
permissions=None, permissions_related=None,
|
||||
remove_from_query=None, tags=None,
|
||||
html_extra_classes=None, icon=None, icon_class=None,
|
||||
keep_query=False, kwargs=None, permissions=None,
|
||||
permissions_related=None, remove_from_query=None, tags=None,
|
||||
url=None):
|
||||
|
||||
self.args = args or []
|
||||
@@ -259,6 +263,7 @@ class Link(object):
|
||||
self.conditional_disable = conditional_disable
|
||||
self.description = description
|
||||
self.html_data = html_data
|
||||
self.html_extra_classes = html_extra_classes
|
||||
self.icon = icon
|
||||
self.icon_class = icon_class
|
||||
self.keep_query = keep_query
|
||||
|
||||
Reference in New Issue
Block a user