Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
5b3f5a47
Commit
5b3f5a47
authored
11 years ago
by
Diana Huang
Browse files
Options
Downloads
Patches
Plain Diff
Add marketing_link to the Template context dictionary.
Pep8 fixes
parent
c9a6fe18
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/djangoapps/mitxmako/shortcuts.py
+2
-0
2 additions, 0 deletions
common/djangoapps/mitxmako/shortcuts.py
common/djangoapps/mitxmako/template.py
+2
-1
2 additions, 1 deletion
common/djangoapps/mitxmako/template.py
with
4 additions
and
1 deletion
common/djangoapps/mitxmako/shortcuts.py
+
2
−
0
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
...
...
This diff is collapsed.
Click to expand it.
common/djangoapps/mitxmako/template.py
+
2
−
1
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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment