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
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
code.vt.edu will be down for maintenance from 0530-0630 EDT Wednesday, March 26th
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
2223d200
Commit
2223d200
authored
12 years ago
by
Calen Pennington
Browse files
Options
Downloads
Patches
Plain Diff
Only display the LMS link if it's set up, and don't error if it isn't
parent
c7209a73
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
cms/djangoapps/contentstore/views.py
+11
-6
11 additions, 6 deletions
cms/djangoapps/contentstore/views.py
cms/envs/aws.py
+1
-1
1 addition, 1 deletion
cms/envs/aws.py
cms/envs/common.py
+2
-0
2 additions, 0 deletions
cms/envs/common.py
cms/templates/unit.html
+2
-0
2 additions, 0 deletions
cms/templates/unit.html
with
16 additions
and
7 deletions
cms/djangoapps/contentstore/views.py
+
11
−
6
View file @
2223d200
...
...
@@ -106,6 +106,16 @@ def edit_item(request):
item
=
modulestore
().
get_item
(
item_location
)
item
.
get_html
=
wrap_xmodule
(
item
.
get_html
,
item
,
"
xmodule_edit.html
"
)
if
settings
.
LMS_BASE
is
not
None
:
lms_link
=
"
{lms_base}/courses/{course_id}/jump_to/{location}
"
.
format
(
lms_base
=
settings
.
LMS_BASE
,
# TODO: These will need to be changed to point to the particular instance of this problem in the particular course
course_id
=
[
course
.
id
for
course
in
modulestore
().
get_courses
()
if
course
.
location
.
org
==
item
.
location
.
org
and
course
.
location
.
course
==
item
.
location
.
course
][
0
],
location
=
item
.
location
,
)
else
:
lms_link
=
None
return
render_to_response
(
'
unit.html
'
,
{
'
contents
'
:
item
.
get_html
(),
'
js_module
'
:
item
.
js_module_name
,
...
...
@@ -114,12 +124,7 @@ def edit_item(request):
'
previews
'
:
get_module_previews
(
request
,
item
),
'
metadata
'
:
item
.
metadata
,
# TODO: It would be nice to able to use reverse here in some form, but we don't have the lms urls imported
'
lms_link
'
:
"
{lms_base}/courses/{course_id}/jump_to/{location}
"
.
format
(
lms_base
=
settings
.
LMS_BASE
,
# TODO: These will need to be changed to point to the particular instance of this problem in the particular course
course_id
=
[
course
.
id
for
course
in
modulestore
().
get_courses
()
if
course
.
location
.
org
==
item
.
location
.
org
and
course
.
location
.
course
==
item
.
location
.
course
][
0
],
location
=
item
.
location
,
)
'
lms_link
'
:
lms_link
,
})
...
...
This diff is collapsed.
Click to expand it.
cms/envs/aws.py
+
1
−
1
View file @
2223d200
...
...
@@ -19,7 +19,7 @@ DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
with
open
(
ENV_ROOT
/
"
cms.env.json
"
)
as
env_file
:
ENV_TOKENS
=
json
.
load
(
env_file
)
LMS_BASE
=
ENV_TOKENS
[
'
LMS_BASE
'
]
LMS_BASE
=
ENV_TOKENS
.
get
(
'
LMS_BASE
'
)
SITE_NAME
=
ENV_TOKENS
[
'
SITE_NAME
'
]
...
...
This diff is collapsed.
Click to expand it.
cms/envs/common.py
+
2
−
0
View file @
2223d200
...
...
@@ -88,6 +88,8 @@ TEMPLATE_CONTEXT_PROCESSORS = (
'
django.core.context_processors.csrf
'
,
# necessary for csrf protection
)
LMS_BASE
=
None
################################# Jasmine ###################################
JASMINE_TEST_DIRECTORY
=
PROJECT_ROOT
+
'
/static/coffee
'
...
...
This diff is collapsed.
Click to expand it.
cms/templates/unit.html
+
2
−
0
View file @
2223d200
...
...
@@ -42,7 +42,9 @@
</section>
</section>
${contents}
% if lms_link is not None:
<a
class=
"lms-link"
href=
"${lms_link}"
>
View in LMS
</a>
% endif
<section
class=
"previews"
>
% for preview in previews:
<section
class=
"preview"
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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