Commit edd6c9de by Xavier Antoviaque

Move html templates to `templates/` folder, move XML to subdirectory

parent 9648043f
...@@ -48,12 +48,12 @@ class AnswerBlock(XBlock): ...@@ -48,12 +48,12 @@ class AnswerBlock(XBlock):
def mentoring_view(self, context=None): def mentoring_view(self, context=None):
if not self.read_only: if not self.read_only:
html = render_template('static/html/answer_editable.html', { html = render_template('templates/html/answer_editable.html', {
'self': self, 'self': self,
'max_length': Answer._meta.get_field('student_input').max_length, 'max_length': Answer._meta.get_field('student_input').max_length,
}) })
else: else:
html = render_template('static/html/answer_read_only.html', { html = render_template('templates/html/answer_read_only.html', {
'self': self, 'self': self,
}) })
......
...@@ -55,7 +55,7 @@ class MentoringBlock(XBlock): ...@@ -55,7 +55,7 @@ class MentoringBlock(XBlock):
""" """
fragment, named_children = self.get_children_fragment(context) fragment, named_children = self.get_children_fragment(context)
fragment.add_content(render_template('static/html/mentoring.html', { fragment.add_content(render_template('templates/html/mentoring.html', {
'self': self, 'self': self,
'named_children': named_children, 'named_children': named_children,
})) }))
...@@ -63,7 +63,7 @@ class MentoringBlock(XBlock): ...@@ -63,7 +63,7 @@ class MentoringBlock(XBlock):
fragment.add_javascript(load_resource('static/js/vendor/underscore-min.js')) fragment.add_javascript(load_resource('static/js/vendor/underscore-min.js'))
fragment.add_javascript(load_resource('static/js/mentoring.js')) fragment.add_javascript(load_resource('static/js/mentoring.js'))
fragment.add_resource(load_resource('static/html/mentoring_progress.html').format( fragment.add_resource(load_resource('templates/html/mentoring_progress.html').format(
completed=self.runtime.resources_url('images/correct-icon.png')), completed=self.runtime.resources_url('images/correct-icon.png')),
"text/html") "text/html")
...@@ -88,7 +88,6 @@ class MentoringBlock(XBlock): ...@@ -88,7 +88,6 @@ class MentoringBlock(XBlock):
completed = completed and child_result['completed'] completed = completed and child_result['completed']
self.completed = bool(completed) self.completed = bool(completed)
self.save()
return { return {
'submitResults': submit_results, 'submitResults': submit_results,
...@@ -105,13 +104,13 @@ class MentoringBlock(XBlock): ...@@ -105,13 +104,13 @@ class MentoringBlock(XBlock):
""" """
return [ return [
("Mentoring - Page 1, Pre-goal brainstom", ("Mentoring - Page 1, Pre-goal brainstom",
load_resource('templates/001_pre_goal_brainstorm.xml')), load_resource('templates/xml/001_pre_goal_brainstorm.xml')),
("Mentoring - Page 2, Getting feedback", ("Mentoring - Page 2, Getting feedback",
load_resource('templates/002_getting_feedback.xml')), load_resource('templates/xml/002_getting_feedback.xml')),
("Mentoring - Page 3, Reflecting on your feedback", ("Mentoring - Page 3, Reflecting on your feedback",
load_resource('templates/003_reflecting_on_feedback.xml')), load_resource('templates/xml/003_reflecting_on_feedback.xml')),
("Mentoring - Page 4, Deciding on your improvement goal", ("Mentoring - Page 4, Deciding on your improvement goal",
load_resource('templates/004_deciding_on_your_improvement_goal.xml')), load_resource('templates/xml/004_deciding_on_your_improvement_goal.xml')),
("Mentoring - Page 5, Checking your improvement goal", ("Mentoring - Page 5, Checking your improvement goal",
load_resource('templates/005_checking_your_improvement_goal.xml')), load_resource('templates/xml/005_checking_your_improvement_goal.xml')),
] ]
...@@ -75,7 +75,7 @@ class QuizzBlock(XBlock): ...@@ -75,7 +75,7 @@ class QuizzBlock(XBlock):
if self.type not in ('yes-no-unsure', 'rating'): if self.type not in ('yes-no-unsure', 'rating'):
raise ValueError, u'Invalid value for QuizzBlock.type: `{}`'.format(self.type) raise ValueError, u'Invalid value for QuizzBlock.type: `{}`'.format(self.type)
template_path = 'static/html/quizz_{}.html'.format(self.type) template_path = 'templates/html/quizz_{}.html'.format(self.type)
html = render_template(template_path, { html = render_template(template_path, {
'self': self, 'self': self,
}) })
...@@ -94,7 +94,7 @@ class QuizzBlock(XBlock): ...@@ -94,7 +94,7 @@ class QuizzBlock(XBlock):
self.student_choice = submission self.student_choice = submission
if show_tip: if show_tip:
formatted_tip = render_template('static/html/tip.html', { formatted_tip = render_template('templates/html/tip.html', {
'self': self, 'self': self,
}) })
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment