Added a new diagnostics tab under the tools menu
This commit is contained in:
@@ -11,12 +11,14 @@ from filesystem_serving import filesystem_serving_recreate_all_links
|
||||
from main.conf.settings import SIDE_BAR_SEARCH
|
||||
|
||||
check_settings = {'text':_(u'settings'), 'view':'check_settings', 'famfam':'cog'}
|
||||
statistics = {'text':_(u'statistics'), 'view':'statistics', 'famfam':'table'}
|
||||
diagnostics = {'text':_(u'diagnostics'), 'view':'diagnostics', 'famfam':'pill'}
|
||||
|
||||
main_menu = [
|
||||
{'text':_(u'home'), 'view':'home', 'famfam':'house', 'position':0},
|
||||
{'text':_(u'tools'), 'view':'tools_menu', 'links': [
|
||||
document_find_all_duplicates, filesystem_serving_recreate_all_links,
|
||||
{'text':_(u'statistics'), 'view':'statistics', 'famfam':'table'}
|
||||
statistics, diagnostics,
|
||||
],'famfam':'wrench', 'name':'tools','position':7},
|
||||
|
||||
{'text':_(u'setup'), 'view':'check_settings', 'links': [
|
||||
|
||||
7
apps/main/api.py
Normal file
7
apps/main/api.py
Normal file
@@ -0,0 +1,7 @@
|
||||
diagnostics = {}
|
||||
|
||||
def register_diagnostic(namespace, title, link):
|
||||
namespace_dict = diagnostics.get(namespace, {'title':None, 'links':[]})
|
||||
namespace_dict['title'] = title
|
||||
namespace_dict['links'].append(link)
|
||||
diagnostics[namespace] = namespace_dict
|
||||
20
apps/main/templates/diagnostics.html
Normal file
20
apps/main/templates/diagnostics.html
Normal file
@@ -0,0 +1,20 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %} :: {{ title|capfirst }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% for key, value in blocks.items %}
|
||||
<div class="content">
|
||||
<h2 class="title">{{ value.title|capfirst }}</h2>
|
||||
<div class="inner">
|
||||
<p>
|
||||
<ul>
|
||||
{% with value.links as object_navigation_links %}
|
||||
{% include "generic_navigation.html" %}
|
||||
{% endwith %}
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
</div></div>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
@@ -6,4 +6,5 @@ urlpatterns = patterns('main.views',
|
||||
url(r'^check_settings/$', 'check_settings', (), 'check_settings'),
|
||||
url(r'^tools_menu/$', 'blank_menu', (), 'tools_menu'),
|
||||
url(r'^statistics/$', 'statistics', (), 'statistics'),
|
||||
url(r'^diagnostics/$', 'diagnostics_view', (), 'diagnostics'),
|
||||
)
|
||||
|
||||
@@ -15,6 +15,7 @@ from ocr.statistics import get_statistics as ocr_statistics
|
||||
from filesystem_serving.conf import settings as filesystem_serving_settings
|
||||
from dynamic_search.conf import settings as search_settings
|
||||
|
||||
from main.api import diagnostics
|
||||
|
||||
def home(request):
|
||||
return render_to_response('home.html', {},
|
||||
@@ -136,3 +137,8 @@ def statistics(request):
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
|
||||
def diagnostics_view(request):
|
||||
return render_to_response('diagnostics.html', {
|
||||
'blocks':diagnostics,
|
||||
'title':_(u'Diagnostics') },
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
Reference in New Issue
Block a user