Implement partial refresh of the main menu.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -123,6 +123,7 @@
|
||||
- Add link to view a specific page's OCR content.
|
||||
- Remove the duplicated setting pdftotext_path from the OCR path.
|
||||
This is now handled by the document parsing app.
|
||||
- Implement partial refresh of the main menu.
|
||||
|
||||
3.0.3 (2018-08-17)
|
||||
==================
|
||||
|
||||
@@ -105,6 +105,19 @@ class MayanApp {
|
||||
});
|
||||
}
|
||||
|
||||
doRefreshMainMenu () {
|
||||
console.log('doRefreshMainMenu');
|
||||
$.ajax({
|
||||
complete: function() {
|
||||
setTimeout(app.doRefreshMainMenu, 5000);
|
||||
},
|
||||
success: function(data) {
|
||||
$('#main-menu').html(data);
|
||||
},
|
||||
url: '/main_menu',
|
||||
});
|
||||
}
|
||||
|
||||
doToastrMessages () {
|
||||
toastr.options = {
|
||||
'closeButton': true,
|
||||
@@ -183,6 +196,7 @@ class MayanApp {
|
||||
this.setupItemsSelector();
|
||||
this.setupNavbarCollapse();
|
||||
this.setupNewWindowAnchor();
|
||||
this.doRefreshMainMenu();
|
||||
partialNavigation.initialize();
|
||||
}
|
||||
|
||||
|
||||
38
mayan/apps/appearance/templates/appearance/main_menu.html
Normal file
38
mayan/apps/appearance/templates/appearance/main_menu.html
Normal file
@@ -0,0 +1,38 @@
|
||||
{% load i18n %}
|
||||
|
||||
{% load navigation_tags %}
|
||||
{% load smart_settings_tags %}
|
||||
|
||||
<nav class="navbar navbar-default navbar-fixed-top">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
|
||||
<span class="sr-only">{% trans 'Toggle navigation' %}</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="{% url home_view %}">{% smart_setting 'COMMON_PROJECT_TITLE' %}</a>
|
||||
</div>
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
{% get_menu_links 'main menu' as menu_links %}
|
||||
{% for link_set in menu_links %}
|
||||
{% for link in link_set %}
|
||||
{% with 'true' as as_li %}
|
||||
{% with 'true' as hide_active_anchor %}
|
||||
{% with 'active' as li_class_active %}
|
||||
{% with 'first' as li_class_first %}
|
||||
{% with ' ' as link_classes %}
|
||||
{% include 'navigation/generic_subnavigation.html' %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -33,40 +33,9 @@
|
||||
{% if appearance_type == 'plain' %}
|
||||
{% block content_plain %}{% endblock %}
|
||||
{% else %}
|
||||
<nav class="navbar navbar-default navbar-fixed-top">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
|
||||
<span class="sr-only">{% trans 'Toggle navigation' %}</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="{% url home_view %}">{% smart_setting 'COMMON_PROJECT_TITLE' %}</a>
|
||||
</div>
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
{% get_menu_links 'main menu' as menu_links %}
|
||||
{% for link_set in menu_links %}
|
||||
{% for link in link_set %}
|
||||
{% with 'true' as as_li %}
|
||||
{% with 'true' as hide_active_anchor %}
|
||||
{% with 'active' as li_class_active %}
|
||||
{% with 'first' as li_class_first %}
|
||||
{% with ' ' as link_classes %}
|
||||
{% include 'navigation/generic_subnavigation.html' %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div id="main-menu">
|
||||
{% include 'appearance/main_menu.html' %}
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
|
||||
@@ -7,9 +7,10 @@ from .api_views import APIContentTypeList
|
||||
from .views import (
|
||||
AboutView, CheckVersionView, CurrentUserDetailsView, CurrentUserEditView,
|
||||
CurrentUserLocaleProfileDetailsView, CurrentUserLocaleProfileEditView,
|
||||
FaviconRedirectView, HomeView, LicenseView, ObjectErrorLogEntryListClearView,
|
||||
ObjectErrorLogEntryListView, PackagesLicensesView, RootView, SetupListView,
|
||||
ToolsListView, multi_object_action_view
|
||||
FaviconRedirectView, HomeView, LicenseView, MainMenuView,
|
||||
ObjectErrorLogEntryListClearView, ObjectErrorLogEntryListView,
|
||||
PackagesLicensesView, RootView, SetupListView, ToolsListView,
|
||||
multi_object_action_view
|
||||
)
|
||||
|
||||
urlpatterns = [
|
||||
@@ -21,6 +22,7 @@ urlpatterns = [
|
||||
name='check_version_view'
|
||||
),
|
||||
url(r'^license/$', LicenseView.as_view(), name='license_view'),
|
||||
url(r'^main_menu/$', MainMenuView.as_view(), name='main_menu_view'),
|
||||
url(
|
||||
r'^packages/licenses/$', PackagesLicensesView.as_view(),
|
||||
name='packages_licenses_view'
|
||||
|
||||
@@ -168,6 +168,11 @@ class LicenseView(SimpleView):
|
||||
template_name = 'appearance/generic_form.html'
|
||||
|
||||
|
||||
class MainMenuView(SimpleView):
|
||||
extra_context = {'home_view': settings.HOME_VIEW}
|
||||
template_name = 'appearance/main_menu.html'
|
||||
|
||||
|
||||
class ObjectErrorLogEntryListClearView(ConfirmView):
|
||||
def get_extra_context(self):
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user