$def with (page) $ _t = i18n.get_namespace('/type/edition') $ _ = i18n.get_namespace('/mode/view') $ s = "other_titles", "translated_titles", "genres", "first_publish_date", "subject_places", "original_languages", "dewey_number", "lc_classifications", "subjects", "subject_times", "excerpts" $ subjects = ["subjects"] $for name in s: $if page[name]:
$if name == "other_titles": $elif name == "translated_titles": $for t in page[name]: $elif name == "subjects": $else:
$_t[name]$:'; '.join(thingrepr(i) for i in page[name])
$t.language.name - $t.text;
$for name in subjects: $for subject in page[name]: $:utf8(thingrepr(subject)).replace(' -- ', '/'),
$:thingrepr(page[name])
$ cur_locale = i18n.get_locale() $ this_lang = False $ simple = False $ wikipedia = [] $ links = page.links $if links: $for link in links: $ wiki_find = link.url.find('.wikipedia.org/') $ lang = link.url[7:wiki_find] $if not lang.replace('-', '').isalpha(): $continue $ link['lang'] = lang $if lang == cur_locale: $ this_lang = link $if lang == 'simple': $ simple = link $ wikipedia.append(link) $if this_lang or len(wikipedia):
$_t['wikipedia']: $if this_lang: $this_lang.lang: $(this_lang.title or this_lang.url) $else: No link to Wikipedia in your language $if simple: Simple English: $(simple.title or simple.url) $if len(wikipedia): Other languages
$ links = [l for l in links if 'lang' not in l] $if links:
$_t['links']: $for link in links: $(link.title or link.url)