diff --git a/src/static/riot/competitions/detail/_tabs.tag b/src/static/riot/competitions/detail/_tabs.tag index 1a482839f..00e94357b 100644 --- a/src/static/riot/competitions/detail/_tabs.tag +++ b/src/static/riot/competitions/detail/_tabs.tag @@ -29,17 +29,28 @@ data-tab="_tab_page{page.index}"> { page.title } +
+ Terms +
Files
+
+ +
+
+
+
+
@@ -327,6 +338,13 @@ }); }) + if(self.competition_has_no_terms_page()){ + const rendered_content = renderMarkdownWithLatex(self.competition.terms) + $(`#page_term`)[0].innerHTML = "" + rendered_content.forEach(node => { + $(`#page_term`)[0].appendChild(node.cloneNode(true)); // Append each node + }); + } _.forEach(self.competition.phases, (phase, index) => { // Render phase description const rendered_content = renderMarkdownWithLatex(phase.description) @@ -341,6 +359,18 @@ }, 500) }) + self.competition_has_no_terms_page = function () { + var no_term_page = true + if(self.competition.pages){ + self.competition.pages.forEach(function (page) { + if (page.title === "Terms") { + no_term_page = false + } + }) + } + return no_term_page + } + CODALAB.events.on('phase_selected', function (selected_phase) { self.selected_phase = selected_phase self.update()