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

scan_queue template

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

$var title: Scan Queue

<style type="text/css">
<!--
tr.delayed  { background: #e2e09a; }
-->
</style>


$ status = query_param("status", "WAITING_FOR_BOOK")

<div style="float: right; clear: right; padding-top: 40px; padding-right: 20px;">
<form name="form_scan_status" action="$:changequery({})" method="GET">
    $ options = ["NOT_SCANNED", "WAITING_FOR_BOOK", "BOOK_NOT_SCANNED", "SCAN_IN_PROGRESS", "SCAN_COMPLETE"]
    <span class="green"><span class="formheader">
    Scan Status: $:Dropdown("status", options, value=status, id="scan_status").render()
    <script>
        \$("#scan_status").change(function() { document.forms["form_scan_status"].submit(); });
    </script>
    </span></span>
</form>
</div>

<div id="header">
    <div style="float:left;padding-left:10px;padding-right:15px;"></div>
    <span class="pretitle">Open Library Scan on Demand:<br /></span>
    <div id="title">Scan Queue</div>   
</div>

<div id="bibliography">
    <div id="browse-rule"></div>
    <div id="biblio-form-body">

        <table cellpadding="0" cellspacing="0" border="0" width="100%">
            <tr>
                <td class="historyheader">Shelf No.</td>
                <td class="historyheader">Scan Record</td>
                <td class="historyheader">Scanning Center</td>
                <td class="historyheader" style="white-space: nowrap">Request Date</td>
                $if status == "SCAN_COMPLETE":
                    <td class="historyheader" style="white-space: nowrap">Completion Date</td>
                <td class="historyheader">Scan Status</td>
            </tr>
            $for record in records:
                $ t = (record.request_date and to_datetime(record.request_date)) or None
                $if t and ((t.utcnow() - t).days > 7):
                    $ delayed = "delayed"
                $else:
                    $ delayed = ""
                <tr style="height:33px;" class="$record.scan_status.lower() $delayed">
                    <td class="number" valign="top" style="white-space: nowrap">$record.shelf</td>
                    <td class="path" valign="top"><a href="/scan_record$record.edition.key" style="text-decoration: underline">$record.edition.title</a> (<a href="$record.edition.key">edition</a>)</td>
                    <td class="path" valign="top"><a href="$record.locations[0].key">$record.locations[0].name</a></td>
                    <td class="path" valign="top">
                        $ t = (record.request_date and to_datetime(record.request_date)) or None
                        $if t:
                            ${(t.utcnow() - t).days} days ago
                        $else:
                            -
                    </td>
                    $if record.scan_status == "SCAN_COMPLETE":
                        <td class="path" valign="top">
                            $ t = (record.completion_date and to_datetime(record.completion_date)) or None
                            $((t and datestr(t)) or "-")
                        </td>
                    <td class="path" valign="top">$record.scan_status</td>
                 </tr>
        </table>
    </div>
</div>

$ page = safeint(query_param('p', '0'))
$ limit = 50

<div class="copyright-footer">
$if page != 0:
    &larr; <a href="$:changequery(p=page - 1)" rel="nofollow">$_.prev</a>

$if len(records) == limit:
    ... <a href="$:changequery(p=page + 1)" rel="nofollow">$_.next</a> &rarr;
<div>