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
8e22e855
Commit
8e22e855
authored
Jan 22, 2016
by
Douglas Hall
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11274 from edx/ibrahimahmed443/enable-copyright-url
uncomment copyright url to enable it in microsites
parents
3429453d
0f09bb8a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
14 deletions
+27
-14
common/test/test_microsites/test_microsite/templates/static_templates/copyright.html
+1
-0
lms/djangoapps/courseware/tests/test_microsites.py
+20
-0
lms/djangoapps/static_template_view/views.py
+4
-1
lms/templates/static_templates/copyright.html
+0
-9
lms/urls.py
+2
-4
No files found.
common/test/test_microsites/test_microsite/templates/static_templates/copyright.html
0 → 100755
View file @
8e22e855
This is a copyright page for an Open edX microsite.
lms/djangoapps/courseware/tests/test_microsites.py
View file @
8e22e855
...
...
@@ -142,6 +142,26 @@ class TestMicrosites(ModuleStoreTestCase, LoginEnrollmentTestCase):
# assert that footer template has been properly overriden on homepage
self
.
assertNotContains
(
resp
,
'This is a Test Microsite footer'
)
@override_settings
(
SITE_NAME
=
settings
.
MICROSITE_TEST_HOSTNAME
)
def
test_microsite_anonymous_copyright_content
(
self
):
"""
Verify that the copyright, when accessed via a Microsite domain, returns
the expected 200 response
"""
resp
=
self
.
client
.
get
(
'/copyright'
,
HTTP_HOST
=
settings
.
MICROSITE_TEST_HOSTNAME
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertContains
(
resp
,
'This is a copyright page for an Open edX microsite.'
)
def
test_not_microsite_anonymous_copyright_content
(
self
):
"""
Verify that the copyright page does not exist if we are not in a microsite
"""
resp
=
self
.
client
.
get
(
'/copyright'
)
self
.
assertEqual
(
resp
.
status_code
,
404
)
def
test_no_redirect_on_homepage_when_no_enrollments
(
self
):
"""
Verify that a user going to homepage will not redirect if he/she has no course enrollments
...
...
lms/djangoapps/static_template_view/views.py
View file @
8e22e855
...
...
@@ -45,7 +45,10 @@ def render(request, template):
# Guess content type from file extension
content_type
,
__
=
mimetypes
.
guess_type
(
template
)
return
render_to_response
(
'static_templates/'
+
template
,
{},
content_type
=
content_type
)
try
:
return
render_to_response
(
'static_templates/'
+
template
,
{},
content_type
=
content_type
)
except
TopLevelLookupException
:
raise
Http404
@ensure_csrf_cookie
...
...
lms/templates/static_templates/copyright.html
deleted
100644 → 0
View file @
3429453d
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<
%
inherit
file=
"../main.html"
/>
<
%
block
name=
"pagetitle"
>
${_("Copyright")}
</
%
block>
<section
class=
"container about"
>
<h1>
${_("Copyright")}
</h1>
<p>
${_("This page left intentionally blank. It is not used by edx.org but is left here for possible use by installations of Open edX.")}
</p>
</section>
lms/urls.py
View file @
8e22e855
...
...
@@ -187,10 +187,8 @@ if not settings.FEATURES["USE_CUSTOM_THEME"]:
{
'template'
:
'press.html'
},
name
=
"press"
),
url
(
r'^media-kit$'
,
'static_template_view.views.render'
,
{
'template'
:
'media-kit.html'
},
name
=
"media-kit"
),
# TODO: (bridger) The copyright has been removed until it is updated for edX
# url(r'^copyright$', 'static_template_view.views.render',
# {'template': 'copyright.html'}, name="copyright"),
url
(
r'^copyright$'
,
'static_template_view.views.render'
,
{
'template'
:
'copyright.html'
},
name
=
"copyright"
),
# Press releases
url
(
r'^press/([_a-zA-Z0-9-]+)$'
,
'static_template_view.views.render_press_release'
,
name
=
'press_release'
),
...
...
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