Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c3003f6
Add info about template for Checkbox problem type
srpearce Dec 20, 2013
7fa8bff
Correct minor formatting error
srpearce Dec 20, 2013
41d2c21
Add JSInput template information
srpearce Dec 23, 2013
6cfe766
Update JS Input to reflect new template in Studio
srpearce Dec 24, 2013
06798ae
Create Tools topic
srpearce Dec 24, 2013
2157b4d
Miscellaneous fixes to strings found during i18n work.
Jan 2, 2014
c7cf0c6
Fixes to Translator comments found while debugging the i18n pipeline.
Dec 24, 2013
be6c57f
Mark XModule strings for i18n
Dec 23, 2013
b998a16
Assign valid content_type to static resource (import_static_content)
zubair-arbi Jan 3, 2014
fa55ac1
Fix URI vendor module to be referenced via a relative URL.
andy-armstrong Jan 6, 2014
bdd6b73
Update JSInput info with feedback from Jean-Michel
srpearce Jan 6, 2014
024c3f6
Merge pull request #2085 from edx/andya/asset-pagination-fix
andy-armstrong Jan 6, 2014
3939b13
Move JSInput info to Advanced Problems. Move LTI into to Tools.
srpearce Jan 6, 2014
e605249
Update index
srpearce Jan 6, 2014
249a618
Merge pull request #2023 from edx/sylvia/documentation/BLD-619
mhoeber Jan 6, 2014
f71688c
Merge pull request #2075 from zubair-arbi/zub/bugfix/std878-wrongcont…
zubair-arbi Jan 7, 2014
549d923
Merge pull request #2077 from edx/ned/misc-msg-fixes
nedbat Jan 7, 2014
430cfd7
Merge pull request #2096 from edx/andya/pagination-fix
andy-armstrong Jan 7, 2014
c7eed1c
Create Tools topic
srpearce Dec 24, 2013
23a949d
Merge branch 'sylvia/documentation/BLD-615' of https://github.com/edx…
mhoeber Jan 7, 2014
7e05746
Removing conflict with tools.rst
mhoeber Jan 7, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cms/djangoapps/contentstore/tests/test_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ def assert_correct_asset_response(self, url, expected_start, expected_length, ex
self.assertEquals(len(assets), expected_length)
self.assertEquals(json_response['totalCount'], expected_total)

# Test valid contentType for pdf asset (textbook.pdf)
self.assertContains(resp, "/c4x/edX/toy/asset/textbook.pdf")
asset_location = StaticContent.get_location_from_path('/c4x/edX/toy/asset/textbook.pdf')
content = contentstore().find(asset_location)
# Check after import textbook.pdf has valid contentType ('application/pdf')
# Note: Actual contentType for textbook.pdf in asset.json is 'text/pdf'
self.assertEqual(content.content_type, 'application/pdf')


class UploadTestCase(CourseTestCase):
"""
Expand Down
2 changes: 1 addition & 1 deletion cms/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"utility": "js/src/utility",
"accessibility": "js/src/accessibility_tools",
"draggabilly": "js/vendor/draggabilly.pkgd",
"URI": "/js/vendor/URI.min",
"URI": "js/vendor/URI.min",

// externally hosted files
"tender": "//edxedge.tenderapp.com/tender_widget",
Expand Down
1 change: 0 additions & 1 deletion cms/templates/export.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ <h1 class="page-header">
<h2 class="title">${_("About Exporting Courses")}</h2>
<div class="copy">
## Translators: ".tar.gz" is a file extension, and should not be translated

<p>${_("You can export courses and edit them outside of Studio. The exported file is a .tar.gz file (that is, a .tar file compressed with GNU Zip) that contains the course structure and content. You can also re-import courses that you've exported.").format(em_start='<strong>', em_end="</strong>")}</p>
</div>
</div>
Expand Down
4 changes: 0 additions & 4 deletions cms/templates/import.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,16 @@ <h3 class="title">${_("Success")}</h3>
<aside class="content-supplementary" role="complimentary">
<div class="bit">
<h3 class="title-3">${_("Why import a course?")}</h3>
## Translators: ".tar.gz" is a file extension, and files with that extension are called "gzipped tar files": these terms should not be translated
<p>${_("You may want to run a new version of an existing course, or replace an existing course altogether. Or, you may have developed a course outside Studio.")}</p>
</div>

<div class="bit">
<h3 class="title-3">${_("What content is imported?")}</h3>
## Translators: ".tar.gz" is a file extension, and files with that extension are called "gzipped tar files": these terms should not be translated
<p>${_("Only the course content and structure (including sections, subsections, and units) are imported. Other data, including student data, grading information, discussion forum data, course settings, and course team information, remains the same as it was in the existing course.")}</p>
</div>

<div class="bit">
## Translators: ".tar.gz" is a file extension, and should not be translated
<h3 class="title-3">${_("Warning: Importing while a course is running")}</h3>

<p>${_("If you perform an import while your course is running, and you change the URL names (or url_name nodes) of any Problem components, the student data associated with those Problem components may be lost. This data includes students' problem scores.")}</p>
</div>
</aside>
Expand Down
2 changes: 1 addition & 1 deletion cms/templates/registration/reg_complete.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<%! from django.utils.translation import ugettext as _ %>
<h1>Check your email</h1>
<p>${_("An activation link has been sent to {emaiL}, along with instructions for activating your account.").format(email=email)}</p>
<p>${_("An activation link has been sent to {email}, along with instructions for activating your account.").format(email=email)}</p>
15 changes: 11 additions & 4 deletions common/lib/xmodule/xmodule/js/src/annotatable/display.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,10 @@ class @Annotatable
@hideTips visible

toggleAnnotationButtonText: (hide) ->
buttonText = (if hide then 'Show' else 'Hide')+' Annotations'
if hide
buttonText = gettext('Show Annotations')
else
buttonText = gettext('Hide Annotations')
@$(@toggleAnnotationsSelector).text(buttonText)

toggleInstructions: () ->
Expand All @@ -169,7 +172,10 @@ class @Annotatable
@toggleInstructionsText hide

toggleInstructionsButton: (hide) ->
txt = (if hide then 'Expand' else 'Collapse')+' Instructions'
if hide
txt = gettext('Expand Instructions')
else
txt = gettext('Collapse Instructions')
cls = (if hide then ['expanded', 'collapsed'] else ['collapsed','expanded'])
@$(@toggleInstructionsSelector).text(txt).removeClass(cls[0]).addClass(cls[1])

Expand Down Expand Up @@ -221,13 +227,14 @@ class @Annotatable
makeTipTitle: (el) ->
(api) =>
title = $(el).data('comment-title')
(if title then title else 'Commentary')
(if title then title else gettext('Commentary'))

createComment: (text) ->
$("<div class=\"annotatable-comment\">#{text}</div>")

createReplyLink: (problem_id) ->
$("<a class=\"annotatable-reply\" href=\"javascript:void(0);\" data-problem-id=\"#{problem_id}\">Reply to Annotation</a>")
linktxt = gettext('Reply to Annotation')
$("<a class=\"annotatable-reply\" href=\"javascript:void(0);\" data-problem-id=\"#{problem_id}\">#{linktxt}</a>")

findVisibleTips: () ->
visible = []
Expand Down
10 changes: 7 additions & 3 deletions common/lib/xmodule/xmodule/js/src/capa/display.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,16 @@ class @Problem
@el.find('.problem > div').each (index, element) =>
MathJax.Hub.Queue ["Typeset", MathJax.Hub, element]

@$('.show-label').text 'Hide Answer(s)'
`// Translators: the word Answer here refers to the answer to a problem the student must solve.`
@$('.show-label').text gettext('Hide Answer(s)')
@el.addClass 'showed'
@updateProgress response
else
@$('[id^=answer_], [id^=solution_]').text ''
@$('[correct_answer]').attr correct_answer: null
@el.removeClass 'showed'
@$('.show-label').text 'Show Answer(s)'
`// Translators: the word Answer here refers to the answer to a problem the student must solve.`
@$('.show-label').text gettext('Show Answer(s)')

@el.find(".capa_inputtype").each (index, inputtype) =>
display = @inputtypeDisplays[$(inputtype).attr('id')]
Expand Down Expand Up @@ -403,6 +405,7 @@ class @Problem
formulaequationinput: (element) ->
$(element).find('input').on 'input', ->
$p = $(element).find('p.status')
`// Translators: the word Answer here is about answering a problem the student must solve.`
$p.text gettext("unanswered")
$p.parent().removeClass().addClass "unanswered"

Expand Down Expand Up @@ -431,7 +434,8 @@ class @Problem
textline: (element) ->
$(element).find('input').on 'input', ->
$p = $(element).find('p.status')
$p.text "unanswered"
`// Translators: the word Answer here is about answering a problem the student must solve.`
$p.text gettext("unanswered")
$p.parent().removeClass().addClass "unanswered"

inputtypeSetupMethods:
Expand Down
10 changes: 6 additions & 4 deletions common/lib/xmodule/xmodule/modulestore/xml_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def import_static_content(
policy = {}

verbose = True
mimetypes_list = mimetypes.types_map.values()

for dirname, _, filenames in os.walk(static_dir):
for filename in filenames:
Expand Down Expand Up @@ -64,10 +65,11 @@ def import_static_content(
policy_ele = policy.get(content_loc.name, {})
displayname = policy_ele.get('displayname', filename)
locked = policy_ele.get('locked', False)
mime_type = policy_ele.get(
'contentType',
mimetypes.guess_type(filename)[0]
)
mime_type = policy_ele.get('contentType')

# Check extracted contentType in list of all valid mimetypes
if not mime_type or mime_type not in mimetypes_list:
mime_type = mimetypes.guess_type(filename)[0] # Assign guessed mimetype
content = StaticContent(
content_loc, displayname, mime_type, data,
import_path=fullname_with_subpath, locked=locked
Expand Down
10 changes: 10 additions & 0 deletions common/test/data/toy/policies/assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"textbook.pdf":{
"contentType":"text/pdf",
"displayname":"textbook.pdf",
"locked":false,
"filename":"/c4x/edx/toy/asset/textbook.pdf",
"import_path":null,
"thumbnail_location":null
}
}
Binary file added common/test/data/toy/static/textbook.pdf
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/course_authors/source/Images/ZoomingImage
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading