Main app updates
This commit is contained in:
@@ -4,7 +4,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link, register_top_menu
|
||||
|
||||
from .conf.settings import SIDE_BAR_SEARCH, DISABLE_HOME_VIEW
|
||||
#from .conf.settings import SIDE_BAR_SEARCH, DISABLE_HOME_VIEW
|
||||
|
||||
__author__ = 'Roberto Rosario'
|
||||
__copyright__ = 'Copyright 2011 Roberto Rosario'
|
||||
@@ -16,7 +16,7 @@ __status__ = 'Production'
|
||||
|
||||
__version_info__ = {
|
||||
'major': 0,
|
||||
'minor': 13,
|
||||
'minor': 1,
|
||||
'micro': 0,
|
||||
'releaselevel': 'alpha',
|
||||
'serial': 0
|
||||
@@ -37,7 +37,9 @@ def get_version():
|
||||
|
||||
|
||||
__version__ = get_version()
|
||||
if not DISABLE_HOME_VIEW:
|
||||
register_top_menu('home', link=Link(text=_(u'home'), view='home', sprite='house'), position=0)
|
||||
if not SIDE_BAR_SEARCH:
|
||||
register_top_menu('search', link=Link(text=_(u'search'), view='search', sprite='zoom', children_url_regex=[r'^search/']))
|
||||
|
||||
# TODO: fix these settings
|
||||
#if not DISABLE_HOME_VIEW:
|
||||
register_top_menu('home', link=Link(text=_(u'home'), view='home', sprite='house'), position=0)
|
||||
#if not SIDE_BAR_SEARCH:
|
||||
# register_top_menu('search', link=Link(text=_(u'search'), view='search', sprite='zoom', children_url_regex=[r'^search/']))
|
||||
|
||||
@@ -1,28 +1,25 @@
|
||||
"""Configuration options for the main app"""
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from smart_settings.api import Setting, SettingNamespace
|
||||
|
||||
namespace = SettingNamespace('main', _(u'Main'), module='main.conf.settings')
|
||||
|
||||
Setting(
|
||||
namespace=namespace,
|
||||
name=u'SIDE_BAR_SEARCH',
|
||||
global_name=u'MAIN_SIDE_BAR_SEARCH',
|
||||
default=False,
|
||||
description=_(u'Controls whether the search functionality is provided by a sidebar widget or by a menu entry.')
|
||||
)
|
||||
|
||||
Setting(
|
||||
namespace=namespace,
|
||||
name=u'DISABLE_HOME_VIEW',
|
||||
global_name=u'MAIN_DISABLE_HOME_VIEW',
|
||||
default=False,
|
||||
)
|
||||
|
||||
Setting(
|
||||
namespace=namespace,
|
||||
name=u'DISABLE_ICONS',
|
||||
global_name=u'MAIN_DISABLE_ICONS',
|
||||
default=False,
|
||||
)
|
||||
#Setting(
|
||||
# namespace=namespace,
|
||||
# name=u'SIDE_BAR_SEARCH',
|
||||
# global_name=u'MAIN_SIDE_BAR_SEARCH',
|
||||
# default=False,
|
||||
# description=_(u'Controls whether the search functionality is provided by a sidebar widget or by a menu entry.')
|
||||
#)
|
||||
#
|
||||
#Setting(
|
||||
# namespace=namespace,
|
||||
# name=u'DISABLE_HOME_VIEW',
|
||||
# global_name=u'MAIN_DISABLE_HOME_VIEW',
|
||||
# default=False,
|
||||
#)
|
||||
#
|
||||
#Setting(
|
||||
# namespace=namespace,
|
||||
# name=u'DISABLE_ICONS',
|
||||
# global_name=u'MAIN_DISABLE_ICONS',
|
||||
# default=False,
|
||||
#)
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
{% load project_tags %}
|
||||
{% load navigation_tags %}
|
||||
{% load settings %}
|
||||
{% load search_tags %}
|
||||
{% load main_settings_tags %}
|
||||
{% load variable_tags %}
|
||||
|
||||
@@ -24,7 +23,7 @@
|
||||
|
||||
{% block html_title %}{% project_name %}{{ request.new_window_url }}{% block title %}{% endblock %}{% endblock %}
|
||||
|
||||
{% get_main_setting "SIDE_BAR_SEARCH" as debug %}
|
||||
{#{% get_main_setting "SIDE_BAR_SEARCH" as debug %}#}
|
||||
{% block web_theme_project_name %}{% project_name %}{% if debug %} {% trans "(DEBUG)" %} {% endif %}{% endblock %}
|
||||
|
||||
{% block web_theme_stylesheets %}
|
||||
@@ -264,6 +263,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block web_theme_sidebar %}
|
||||
{% comment %}
|
||||
{% get_main_setting "SIDE_BAR_SEARCH" as side_bar_search %}
|
||||
{% if side_bar_search and not web_theme_hide_menus %}
|
||||
{% with "true" as side_bar %}
|
||||
@@ -276,7 +276,7 @@
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
|
||||
{% endcomment %}
|
||||
{% get_object_navigation_links "secondary_menu" as secondary_menu_navigation_links %}
|
||||
{% if secondary_menu_navigation_links %}
|
||||
<div class="block">
|
||||
|
||||
@@ -2,7 +2,7 @@ import re
|
||||
|
||||
from django.template import Node
|
||||
from django.template import TemplateSyntaxError, Library
|
||||
from main.conf import settings
|
||||
#from main.conf import settings
|
||||
|
||||
register = Library()
|
||||
|
||||
@@ -13,7 +13,7 @@ class SettingsNode(Node):
|
||||
self.var_name = var_name
|
||||
|
||||
def render(self, context):
|
||||
context[self.var_name] = getattr(settings, self.format_string, '')
|
||||
context[self.var_name] = ''#getattr(settings, self.format_string, '')
|
||||
return ''
|
||||
|
||||
|
||||
|
||||
@@ -5,12 +5,7 @@ from django.template import RequestContext
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
from .conf.settings import DISABLE_HOME_VIEW
|
||||
|
||||
|
||||
def home(request):
|
||||
if DISABLE_HOME_VIEW:
|
||||
return HttpResponseRedirect(reverse('document_list_recent'))
|
||||
else:
|
||||
return render_to_response('home.html', {},
|
||||
return render_to_response('home.html', {},
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
Reference in New Issue
Block a user