It looks like you're offline.
Open Library logo
additional options menu

This doc was last edited by Anand Chitipothu June 19, 2009.

plugin upstream
Templates in the website are disabled now. Editing them will not have any effect on the live website.
   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
$def with (page)

$ _t = i18n.get_namespace('/type/author')
$ _ = i18n.get_namespace('/mode/view')

$ s = "birth_date", "birth_place", "death_date", "death_place", "wikipedia"

<div id="nav" style="margin-left: 0px; clear: both;">
<div id="options">
<div class="navouter">
<img src="/static/images/nav.top.png" alt="Options" border="0" />
<div class="navinner">
<div class="navinner-padding">
<span class="navheader">About this Author</span><br /><br />

$for name in s:
    $if page[name]:
        <span class="navheader" style="text-transform: none; letter-spacing: .0em; font-weight: bold; color: #333;">$_t[name]:</span> 
        <div style="padding: 0px 15px 8px 25px; border-top: 0px solid #fff;">
            $if name == "other_titles":
                $:'<br />'.join(thingrepr(i) for i in page[name])
            $elif name == "translated_titles":
                $for t in page[name]: <span style="font-style: italic;">$t.language.name -</span> $t.text<br />
            $elif name == "links":
                $for link in page[name]: <a href="$link.url">$(link.title or link.url)</a><br />
            $else:
                $:thingrepr(page[name])<br />
        </div>

$ cur_locale = i18n.get_locale()
$ this_lang = False
$ simple = False
$ wikipedia = []
$ links = page.links

            <script>
            function show_full_list() {
                document.getElementById('wikipedia').style.display='none';
                document.getElementById('full_list').style.display='block';
            }
            function hide_full_list() {
                document.getElementById('wikipedia').style.display='block';
                document.getElementById('full_list').style.display='none';
            }
            </script>

$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):
        <span class="navheader" style="text-transform: none; letter-spacing: .0em; font-weight: bold; color: #333;">$_t['wikipedia']:</span> 
        <div style="padding: 0px 15px 8px 25px; border-top: 0px solid #fff;">
        $if wikipedia:
            <div id="wikipedia">
        $if this_lang:
            $this_lang.lang: <a href="$this_lang.url">$(this_lang.title or this_lang.url)</a>
        $else:
            No link to Wikipedia in your language
            $if simple:
                <br>
                Simple English: <a href="$simple.url">$(simple.title or simple.url)</a>
        $if len(wikipedia):
            <br>
            <a href="javascript:show_full_list()" style="color:black">Other&nbsp;languages&nbsp;»</a></div>
            <div style="display:none" id="full_list">
            <a href="javascript:hide_full_list()" style="color:black">«&nbsp;back</a><br>
            $for link in wikipedia:
                $link.lang: <a href="$link.url">$(link.title or link.url)</a><br>
            </div>
        </div>
    $ links = [l for l in links if 'lang' not in l]
    $if links:
        <span class="navheader" style="text-transform: none; letter-spacing: .0em; font-weight: bold; color: #333;">$_t['links']:</span> 
        <div style="padding: 0px 15px 8px 25px; border-top: 0px solid #fff;">
            $for link in links: <a href="$link.url">$(link.title or link.url)</a><br />
        </div>
</div>
</div>

<img src="/static/images/nav.bot.png" alt="" border="0" />

</div>
</div>
</div>