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

Footer history insert

This doc was last edited by Anand Chitipothu April 18, 2011.

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
$def with (page)

$if "superfast" in ctx.features:
    $ h = page.get_history_preview()
$else:
    $ h = get_history(page)

$ versions = h.recent + h.initial

<div class="clearfix"></div>
<div id="pageHistory">
    <h2 class="collapse">
        $_("History")
    
        $if h.initial:
            <span class="title">$_("Created %s", datestr(h.initial[0].created)) &middot; </span>
        $if page.url:
            $ url = page.url(m='history')
        $else:
            $ url = changequery(m='history')
            
        $ latest = versions[0]
        <span class="link"><a rel="nofollow" href="$url">$latest.revision $_("revision")$("s" if latest.revision != 1 else "")</a></span>

        $if page.key.startswith("/works") or page.key.startswith("/books") or page.key.startswith("/authors"): 
            $ rdf = page.key + ".rdf"
            $ json = page.key + ".json"
            $ opds = page.key + ".opds"
            <div id="historyTools" class="smaller brown sansserif" style="float:right;padding-top:8px;">
                Download catalog record:
                <a href="$rdf">RDF</a>
                /
                <a href="$json">JSON</a>
                $if page.key.startswith("/books"):
                    /
                    <a href="$opds">OPDS</a>
            </div>

    </h2>

    <table class="history">
        <tbody>
            $def render_row(v,):
                <td class="timestamp"><a rel="nofollow" href="$v.key?v=$v.revision" title="$_('View revision %s', v.revision)">$datestr(v.created)</a></td>
                <td class="timestamp">
                    $if v.author: 
                        $ author_link = '<a rel="nofollow" href="%s" class="truncate" title="%s">%s</a>' % (v.author.key, v.author.displayname, v.author.displayname)
                    $elif v.ip and v.ip != "127.0.0.1":
                        $ author_link = '<a rel="nofollow" href="/recentchanges?ip=%s" title="%s">%s</a>' % (v.ip, _('an anonymous user'), v.ip)
                    $else:
                        $ author_link = '<span>%s</span>' % (_('an anonymous user'))
                    $if v.revision == 1:
                        $:_("Created by %s", author_link)
                    $else:
                        $:_("Edited by %s", author_link)
                </td>
                <td class="detail">$:render_template("history/comment", v)</td>
            
            $for v in h.recent:
                <tr>$:render_row(v)</tr>
            $if h.initial:
                $for v in h.initial:
                    <tr class="first" style="background: #eee;">$:render_row(v)</tr>
        </tbody>
    </table>
</div>