|
1 | 1 | <%inherit file="../${context.get('request').registry.settings.get('clld.app_template', 'app.mako')}"/> |
2 | 2 | <%namespace name="util" file="../util.mako"/> |
3 | 3 | <%! active_menu_item = "sources" %> |
| 4 | +<%! multirow = True %> |
4 | 5 | <%! from itertools import groupby %> |
5 | 6 |
|
| 7 | +
|
6 | 8 | <%block name="title">${ctx.name}</%block> |
7 | 9 |
|
8 | | -<h3>${ctx.name} ${h.contactmail(req, ctx, title='report a problem')}</h3> |
9 | | -##<abbr class="unapi-id" title="${h.urlescape(request.resource_url(ctx))}"></abbr> |
| 10 | +<div class="row-fluid"> |
| 11 | + <div class="span7"> |
| 12 | +
|
| 13 | + <h3>${ctx.name} ${h.contactmail(req, ctx, title='report a problem')}</h3> |
| 14 | + ##<abbr class="unapi-id" title="${h.urlescape(request.resource_url(ctx))}"></abbr> |
10 | 15 | ${ctx.coins(request)|n} |
11 | 16 |
|
12 | | -% if ctx.jsondata.get('thanks'): |
13 | | -<div class="alert alert-success"> |
14 | | - This record was contributed by ${ctx.jsondata['thanks']}. |
15 | | -</div> |
16 | | -% endif |
| 17 | + % if ctx.jsondata.get('thanks'): |
| 18 | + <div class="alert alert-success"> |
| 19 | + This record was contributed by ${ctx.jsondata['thanks']}. |
| 20 | + </div> |
| 21 | + % endif |
17 | 22 |
|
18 | | -<div class="tabbable"> |
19 | | - <ul class="nav nav-tabs"> |
20 | | - <li class="active"><a href="#tab1" data-toggle="tab">Text</a></li> |
21 | | - <li><a href="#tab2" data-toggle="tab">BibTeX</a></li> |
22 | | - </ul> |
23 | | - <div class="tab-content"> |
24 | | - <% bibrec = ctx.bibtex() %> |
25 | | - <div id="tab1" class="tab-pane active"> |
26 | | - <p id="${h.format_gbs_identifier(ctx)}">${bibrec.text()}</p> |
27 | | - % if ctx.datadict().get('Additional_information'): |
28 | | - <p> |
29 | | - ${ctx.datadict().get('Additional_information')} |
30 | | - </p> |
31 | | - % endif |
32 | | - <ul class="inline"> |
33 | | - % if ctx.author == 'ISO 639-3 Registration Authority': |
34 | | - <li>${u.format_external_link_in_label(ctx.howpublished, 'ISO 639-3')}</li> |
35 | | - % endif |
36 | | - % if ctx.url: |
37 | | - <li>${u.format_external_link_in_label(ctx.url)}</li> |
38 | | - % elif ctx.jsondata.get('doi'): |
39 | | - <li>${u.format_external_link_in_label('http://dx.doi.org/%s' % ctx.jsondata['doi'], 'DOI')}</li> |
40 | | - % endif |
41 | | - % if ctx.gbid: |
42 | | - <li>${u.format_external_link_in_label('https://books.google.com/books?id=%s' % ctx.gbid.split('id=')[-1], label='Google Books')}</li> |
43 | | - % endif |
44 | | - <% oclc = ctx.jsondata.get('oclc') %> |
45 | | - % if oclc: |
46 | | - <li>${u.format_external_link_in_label('http://www.worldcat.org/oclc/{0}'.format(oclc), 'WorldCat')}</li> |
47 | | - % endif |
48 | | - ##<% isbn = ctx.jsondata.get('isbn') %> |
| 23 | + <div class="tabbable"> |
| 24 | + <ul class="nav nav-tabs"> |
| 25 | + <li class="active"><a href="#tab1" data-toggle="tab">Text</a></li> |
| 26 | + <li><a href="#tab2" data-toggle="tab">BibTeX</a></li> |
| 27 | + </ul> |
| 28 | + <div class="tab-content"> |
| 29 | + <% bibrec = ctx.bibtex() %> |
| 30 | + <div id="tab1" class="tab-pane active"> |
| 31 | + <p id="${h.format_gbs_identifier(ctx)}">${bibrec.text()}</p> |
| 32 | + % if ctx.datadict().get('Additional_information'): |
| 33 | + <p> |
| 34 | + ${ctx.datadict().get('Additional_information')} |
| 35 | + </p> |
| 36 | + % endif |
| 37 | + <ul class="inline"> |
| 38 | + % if ctx.author == 'ISO 639-3 Registration Authority': |
| 39 | + <li>${u.format_external_link_in_label(ctx.howpublished, 'ISO 639-3')}</li> |
| 40 | + % endif |
| 41 | + % if ctx.url: |
| 42 | + <li>${u.format_external_link_in_label(ctx.url)}</li> |
| 43 | + % elif ctx.jsondata.get('doi'): |
| 44 | + <li>${u.format_external_link_in_label('http://dx.doi.org/%s' % ctx.jsondata['doi'], 'DOI')}</li> |
| 45 | + % endif |
| 46 | + % if ctx.gbid: |
| 47 | + <li>${u.format_external_link_in_label('https://books.google.com/books?id=%s' % ctx.gbid.split('id=')[-1], label='Google Books')}</li> |
| 48 | + % endif |
| 49 | + <% oclc = ctx.jsondata.get('oclc') %> |
| 50 | + % if oclc: |
| 51 | + <li>${u.format_external_link_in_label('http://www.worldcat.org/oclc/{0}'.format(oclc), 'WorldCat')}</li> |
| 52 | + % endif |
| 53 | + ##<% isbn = ctx.jsondata.get('isbn') %> |
49 | 54 | ##% if isbn: |
50 | 55 | ## ${util.gbs_links(['ISBN:{0}'.format(isbn)])} |
51 | 56 | ##% endif |
52 | 57 | </ul> |
53 | | - % if ctx.iaid: |
54 | | - <hr /> |
55 | | - <iframe src='https://archive.org/stream/${ctx.iaid}?ui=embed#mode/1up' width='680px' height='750px' frameborder='1' ></iframe> |
56 | | - % endif |
57 | | - </div> |
58 | | - <div id="tab2" class="tab-pane"><pre>${bibrec}</pre></div> |
| 58 | + % if ctx.iaid: |
| 59 | + <hr/> |
| 60 | + <iframe src='https://archive.org/stream/${ctx.iaid}?ui=embed#mode/1up' width='680px' |
| 61 | + height='750px' frameborder='1'></iframe> |
| 62 | + % endif |
| 63 | + </div> |
| 64 | + <div id="tab2" class="tab-pane"> |
| 65 | + <pre>${bibrec}</pre> |
| 66 | + </div> |
| 67 | + </div> |
| 68 | + </div> |
59 | 69 | </div> |
60 | | -</div> |
61 | 70 |
|
62 | | -<%def name="sidebar()"> |
63 | | -% if ctx.doctypes: |
64 | | -<%util:well> |
65 | | - <h3>Document types${u.format_ca_icon(req, ctx, 'doctype')}</h3> |
66 | | - <ul class="inline"> |
67 | | - % for dt in ctx.doctypes: |
68 | | - <li> |
69 | | - ${u.format_label_link(request.route_url('home.glossary', _anchor='doctype-' + dt.id), dt.name.capitalize().replace('_', ' '), title=dt.description)} |
70 | | - </li> |
71 | | - % endfor |
72 | | - </ul> |
73 | | -</%util:well> |
74 | | -% endif |
75 | | -% if ctx.languages: |
76 | | -<%util:well> |
77 | | - ${u.format_language_header(request, ctx, level=3)} |
78 | | - <ul class="unstyled"> |
79 | | - % for li in u.format_languages(request, ctx): |
80 | | - ${li} |
81 | | - % endfor |
82 | | - </ul> |
83 | | -</%util:well> |
84 | | -% endif |
85 | | -<%util:well> |
86 | | - <h3>Providers</h3> |
87 | | - <ul class="inline"> |
88 | | - % for p, keys in groupby(ctx.bibkeys, lambda bk: bk.provider): |
89 | | - <dl> |
90 | | - <dt>${h.link(request, p)}</dt> |
91 | | - % for k in keys: |
92 | | - <dd><a href="${request.route_url('source', id=k.id)}">${k.id}</a></dd> |
93 | | - % endfor |
94 | | - </dl> |
95 | | - % endfor |
96 | | - </ul> |
97 | | -</%util:well> |
98 | | -</%def> |
| 71 | + <div class="span5"> |
| 72 | + |
| 73 | + % if ctx.doctypes: |
| 74 | + <%util:well> |
| 75 | + <h3>Document types${u.format_ca_icon(req, ctx, 'doctype')}</h3> |
| 76 | + <ul class="inline"> |
| 77 | + % for dt in ctx.doctypes: |
| 78 | + <li> |
| 79 | + ${u.format_label_link(request.route_url('home.glossary', _anchor='doctype-' + dt.id), dt.name.capitalize().replace('_', ' '), title=dt.description)} |
| 80 | + </li> |
| 81 | + % endfor |
| 82 | + </ul> |
| 83 | + </%util:well> |
| 84 | + % endif |
| 85 | + % if ctx.languages: |
| 86 | + <%util:well> |
| 87 | + ${u.format_language_header(request, ctx, level=3)} |
| 88 | + <table class="table table-condensed"> |
| 89 | + <thead> |
| 90 | + <tr> |
| 91 | + <th>Name in source</th> |
| 92 | + <th>Glottolog languoid</th> |
| 93 | + </tr> |
| 94 | + </thead> |
| 95 | + <tbody> |
| 96 | + % for names, links in u.format_languages(request, ctx): |
| 97 | + <tr> |
| 98 | + <td>${names}</td> |
| 99 | + <td>${links}</td> |
| 100 | + </tr> |
| 101 | + % endfor |
| 102 | +
|
| 103 | + </tbody> |
| 104 | + </table> |
| 105 | + </%util:well> |
| 106 | + % endif |
| 107 | + <%util:well> |
| 108 | + <h3>Providers</h3> |
| 109 | + <ul class="inline"> |
| 110 | + % for p, keys in groupby(ctx.bibkeys, lambda bk: bk.provider): |
| 111 | + <dl> |
| 112 | + <dt>${h.link(request, p)}</dt> |
| 113 | + % for k in keys: |
| 114 | + <dd><a href="${request.route_url('source', id=k.id)}">${k.id}</a></dd> |
| 115 | + % endfor |
| 116 | + </dl> |
| 117 | + % endfor |
| 118 | + </ul> |
| 119 | + </%util:well> |
| 120 | + </div> |
| 121 | +</div> |
0 commit comments