Ejemplo n.º 1
0
 def render_unit(self):
     fields = {
             k: Markup(v) for k,v in self.unit.wiki_fields.iteritems()}
     fields['reflection'] = Markup('<p><i>Removed from this view for peers\' privacy.<br>--BOOC Instructors and Tech Staff</i></p>')
     self.template_value['fields'] = fields
     self.template_value['unit'] = self.find_unit_by_id(self.unit_num)
     self.template_value['report'] = self.unit
     self.template_value['badge_slug'] = self.report.badge.key().name()
     # THIS is kinda magic - we render a page like wf_temp_u1.html, but have
     # it inherit from wf_evidence.html rather than wf_page.html.  This
     # removes the comment section, for instance.
     self.template_value['layout_template'] = 'wf_evidence.html'
     self.template_value['review'] = Annotation.reviews(whose=self.report.student, unit=self.unit_num).get()
     self.render(page_templates.templates[self.unit_num])