Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: cms/utils.py

Issue 29933596: Issue 5333 - Allow cms to generate relative pages (Closed) Base URL: https://hg.adblockplus.org/cms/
Patch Set: Address comments on PS2, rearrange test files (again) Created Nov. 7, 2018, 4:14 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cms/utils.py
===================================================================
--- a/cms/utils.py
+++ b/cms/utils.py
@@ -126,7 +126,7 @@
def get_page_params(source, locale, page, format=None, site_url_override=None,
- localized_string_callback=None):
+ localized_string_callback=None, relative=None):
from cms.converters import converters
# Guess page format if omitted, but default to Markdown for friendlier exceptions
@@ -144,6 +144,7 @@
'page': page,
'config': source.read_config(),
'localized_string_callback': localized_string_callback,
+ 'relative': relative,
}
params['localedata'] = source.read_locale(params['locale'], page)
@@ -190,9 +191,10 @@
def process_page(source, locale, page, format=None, site_url_override=None,
- localized_string_callback=None):
+ localized_string_callback=None, relative=False):
from cms.converters import TemplateConverter
params = get_page_params(source, locale, page, format, site_url_override,
localized_string_callback)
+ params['relative'] = relative
return TemplateConverter(*params['templatedata'], params=params)()

Powered by Google App Engine
This is Rietveld