/upstream/templates/borrow/index.tmpl
Type: /type/template
body: value: $def with (page, stats)

$var title: $page.name

$ subject_list = [('subjects', 20), ('places', 20), ('people', 10), ('times', 10)]

<div id="contentHead">
    $:render_template("borrow/navigation", path="/borrow")
    <h1>$_("Borrow eBooks")</h1>
</div>

<style type="text/css">

/* Reset height to support 4 rows. */

#resultsCovers {
    width: 958px;
    /*height: 442px;
    */
    height: 844px;
}

#resultsCovers .jcarousel-container,
#resultsList .jcarousel-container {
    width: 918px;
    padding: 20px;
}
#resultsCovers .jcarousel-clip,
#resultsList .jcarousel-clip {
    width: 918px;
    /*height: 402px;
    */
    height: 804px;
}
#resultsCovers .jcarousel-item-horizontal {
    width: 918px;
    /*height: 402px;
    */
    height: 804px;
    margin-right: 0;
}
</style>

<script type="text/javascript">
<!--
var page = new Subject($:json_encode(page), {pagesize: 24});
//-->
</script>

$:render_template("lib/covers", page)

<script type="text/javascript">
function resetCounts() {
    var hash = {};
    var counts = \$("<span></span>");
    
    var x = sprintf(ungettext("%s book", "%s books", page.work_count), commify(page.work_count));
    var y = sprintf(ungettext("%s ebook", "%s ebooks", page.ebook_count), commify(page.ebook_count));
    
    counts.append('<strong></strong>').find("strong:last").text(x);
    hash.ebooks = null;

    counts.append("&nbsp;");
    counts.append('<span class="clickdata"></span>');

	\$("#coversCount").html(counts.html());
    
	var yearFrom, yearTo;		
	if (page.filter.published_in) {
		var y = "" + page.filter.published_in;
		if (y.indexOf("-") > 0) {
			var tokens = y.split("-");
			yearFrom = tokens[0];
			yearTo = tokens[1];
			page._published_in = page.filter.published_in;
		}
		else {
			yearFrom = yearTo = y;
		}

		hash.published_in = y;
	}
	else {
	    page._published_in = null;
	    
		yearFrom = page.publishing_history[0][0];
		yearTo = page.publishing_history[page.publishing_history.length-1][0];
		
        hash.published_in = null;
	}
	
	if (yearFrom == yearTo) {
        \$(".clickdata").text(sprintf(_("published in %s."), yearFrom));
	}
	else {
        \$(".clickdata").text(sprintf(_("published between %s & %s."), yearFrom, yearTo));
	}
}

\$(function() {
	resetCounts();
});
</script>

<div id="contentBody"> 

<div class="head"> 
    <h2>Search the Lending Library</h2> 
</div> 

<div class="section"> 
    <form method="get" action="/search" class="siteSearch olform"> 
    <label for="q" class="hidden">Keywords</label> 
    <input type="text" name="q" id="q" value="" size="100" style="width:505px;"/>
    <input type="hidden" name="subject_facet" value="Lending library">
    <button type="submit" class="larger" id="searchsubmit">Search</button> 
    </form> 
</div> 
   
<div class="clearfix"></div> 


<div class="head"> 
    <h2>Loans Per Day</h2> 

    <br />&nbsp;
    <div class="chart">
        <div id="loans-per-day" class="graph">
            <noscript>$_("You need to have JavaScript turned on to see the nifty chart!")</noscript>
        </div> 
    </div>
</div> 

<style type="text/css"> 
div.graph,div.chart{width:898px;height:180px;float:none;background-image:none;}
.chartYaxis{width:180px;top:85px;left:-85px;}
</style>

<script type="text/javascript">

\$(function () {
    \$.plot("#loans-per-day", [$:json_encode(stats.get_loans_per_day())], {
        series: {
             bars: {
                 show: true,
                 align: "left",
                 barWidth: 24 * 60 * 60 * 1000,
                 color: "#35672e",
                 fillColor: "#35672e",
             },
             color: "#35672e"
        },
         grid: {
             hoverable: true,
             show: true,
            borderWidth: 1, 
            borderColor: "#d9d9d9"
         },
         xaxis: {
             mode: "time"
         }
    });
});
</script>
</div>
plugin: openlibrary
title: template to render /borrow
m: edit