Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
5b3f5a47
Commit
5b3f5a47
authored
May 06, 2013
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add marketing_link to the Template context dictionary.
Pep8 fixes
parent
c9a6fe18
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletions
+4
-1
common/djangoapps/mitxmako/shortcuts.py
+2
-0
common/djangoapps/mitxmako/template.py
+2
-1
No files found.
common/djangoapps/mitxmako/shortcuts.py
View file @
5b3f5a47
...
...
@@ -19,6 +19,7 @@ from . import middleware
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
def
marketing_link
(
name
):
"""Returns the correct URL for a link to the marketing site
depending on if the marketing site is enabled
...
...
@@ -39,6 +40,7 @@ def marketing_link(name):
else
:
return
''
def
render_to_string
(
template_name
,
dictionary
,
context
=
None
,
namespace
=
'main'
):
context_instance
=
Context
(
dictionary
)
# add dictionary to context_instance
...
...
common/djangoapps/mitxmako/template.py
View file @
5b3f5a47
...
...
@@ -14,6 +14,7 @@
from
django.conf
import
settings
from
mako.template
import
Template
as
MakoTemplate
from
mitxmako.shortcuts
import
marketing_link
from
mitxmako
import
middleware
...
...
@@ -37,7 +38,6 @@ class Template(MakoTemplate):
kwargs
.
update
(
overrides
)
super
(
Template
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
def
render
(
self
,
context_instance
):
"""
This takes a render call with a context (from Django) and translates
...
...
@@ -55,5 +55,6 @@ class Template(MakoTemplate):
context_dictionary
[
'settings'
]
=
settings
context_dictionary
[
'MITX_ROOT_URL'
]
=
settings
.
MITX_ROOT_URL
context_dictionary
[
'django_context'
]
=
context_instance
context_dictionary
[
'marketing_link'
]
=
marketing_link
return
super
(
Template
,
self
)
.
render_unicode
(
**
context_dictionary
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment