Permalink
Browse files

adding the ability to deep link to a specific page configuration

  • Loading branch information...
1 parent 9406980 commit e84f7d346415fda5f5856bfe321186115c8ef4b5 @anutron committed Jun 21, 2011
Showing with 16 additions and 6 deletions.
  1. +1 −1 frontend_dev/templates/index.mako
  2. +2 −0 frontend_dev/urls.py
  3. +13 −5 frontend_dev/views.py
@@ -7,6 +7,6 @@
</head>
<frameset rows="33,*" framespacing="0" border="1" >
<frame name="top_nav" src="/top_nav" noresize marginheight="0" marginwidth="0"/>
- <frame name="bottom_frame" src="/bottom_frame?menu_path=/docs_menu&content_path=/welcome" noresize marginheight="0" marginwidth="0"/>
+ <frame name="bottom_frame" src="${bottom}" noresize marginheight="0" marginwidth="0"/>
</frameset>
</html>
@@ -11,6 +11,8 @@
(r'^docs_menu/', 'views.docs_menu'),
(r'^docs/(?P<path>.*)$', 'views.docs'),
+
+ (r'^viewdoc/(?P<path>.*)$', 'views.viewdoc'),
(r'^source/', 'views.view_source'),
(r'^demo/', 'views.demo'),
(r'^specs/', 'views.specs'),
View
@@ -31,14 +31,22 @@
excluded_tests = settings.EXCLUDED_TESTS
-def index(request):
+def index(request, path=False, content_path=False):
""" The main frameset. """
+
+ if content_path is False:
+ content_path = '/welcome'
+
return render_to_response('index.mako',
{
- 'title': settings.TITLE_PREFIX
+ 'title': settings.TITLE_PREFIX,
+ 'bottom': path or request.REQUEST.get('bottom', '/bottom_frame?menu_path=/docs_menu&content_path=' + content_path)
}
)
+def docs(request, path):
+ return index(request, content_path = '/viewdoc/' + path)
+
def welcome(request):
""" The default 'home' page for the main content frame; pulls in WELCOME.md from the frontend_dev app. """
welcome_file = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "WELCOME.md"))
@@ -227,7 +235,7 @@ def format_code(extension, code_str):
# DOCS
-def docs(request, path):
+def viewdoc(request, path):
if path == '':
path = "test-runner/WELCOME"
if not re.search("md$(?i)", path):
@@ -261,7 +269,7 @@ def replacer(matchobj):
'docs': files,
'title': make_title(path.split('/')[-1]),
'title_prefix': settings.TITLE_PREFIX,
- 'current': 'docs/' + path,
+ 'current': 'viewdoc/' + path,
'dirs': dirs,
'toc': toc
}
@@ -570,7 +578,7 @@ def docs_url(project, path):
root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
project_path = settings.DOCS[project]
docs_path = project_path.replace(root, '')
- return os.path.normpath('/docs/' + docs_path + path);
+ return os.path.normpath('/viewdoc/' + docs_path + path);

0 comments on commit e84f7d3

Please sign in to comment.