From 75d719b67f15e4457162c3ef3bd1db2ef62e55e3 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Mon, 15 Feb 2016 20:01:29 +0100 Subject: Support resource templates in language/group/problem descriptions --- js/codeq/problem_list.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'js/codeq/problem_list.js') diff --git a/js/codeq/problem_list.js b/js/codeq/problem_list.js index 1384066..e28e672 100644 --- a/js/codeq/problem_list.js +++ b/js/codeq/problem_list.js @@ -221,6 +221,9 @@ along with this program. If not, see . */ baseTabIndex = 200; // tabindex attribute of the first problem link var langDict = convertTranslations(rawTranslations, 'name', 'description'), // this will be the resulting dictionary: multi-level keys that lead up to the lang-dict groupDict, problemDict; + + codeq.template.processDictionary(langDict.description, [languageIdentifier]); + // title: HTML structure for "name" and "desc" html.push('


'); html.push('

'); @@ -228,9 +231,11 @@ along with this program. If not, see . */ for (i = 0; i < Ngroups; i++) { group = groups[i] || {}; groupDict = convertTranslations(group.translations, 'name', 'description'); // the group-level translations, added will + codeq.template.processDictionary(groupDict.description, + [languageIdentifier, group.identifier]); // group content html.push('

'); - html.push('

'); + html.push('
'); html.push('
    '); // problem content problems = group.problems || []; @@ -268,7 +273,7 @@ along with this program. If not, see . */ var language = data.language; jqScreen.html(data.html); codeq.tr.translateDom(jqScreen); - jqScreen.find('a').on('click', function (e) { + jqScreen.find('.group-problems a').on('click', function (e) { var index = +$(this).attr('class').split(' ')[0].split('-')[1], ref = data.refs[index]; e.preventDefault(); -- cgit v1.2.1