/upstream/templates/admin/index.tmpl
Type: /type/template
body: value: $def with (counts)

$ _x = ctx.setdefault('bodyid', 'admin')
$ _x = ctx.setdefault('usergroup', 'admin')

$:macros.Dashboard()
$ stats = get_admin_stats()
<script type="text/javascript"> 
\$(function () {
    var edits = $:json_encode(counts.human_edits.get_counts(80, True));
    var members = $:json_encode(counts.members.get_counts(80, True));
    plot_tooltip_graph(\$("#editgraph"), edits, "edit(s) on");
    plot_tooltip_graph(\$("#membergraph"), members,"new members(s) on");
    });
</script> 

<div id="contentHead">
    <h1>$_("Admin Center")</h1>
	<div class="small">
	    <a href="http://monitor.us.archive.org/cgi-bin/nagios3/status.cgi?hostgroup=24.openlibrary&style=detail">Nagios</a>
	    | <a href="/admin/block">Block IPs</a>
	    | <a href="/admin/loans">Loans</a>
	    | <a href="/admin/status">Services</a>
	    | <a href="/admin/support">Support</a>
	</div>
</div>
<div id="contentBody">

    <div class="contentLeft">
        <div class="head rel"> <span class="caption"><a href="/recentchanges/">Edits Per Day</a></span>
            <h2>Edits</h2>
        </div>
        <div class="chartHolder">
            <div class="chartDisplay">
	      <div id="editgraph" style="width:430px;height:50px;">
		<!-- Edit graphs go here -->
	      </div>
            </div>
        </div>
        <table class="measurements stripeEven" id="edits">
            <thead>
                <tr>
                    <th></th>
                    <th>Today</th>
                    <th>Yesterday</th>
                    <th>Last 7 days</th>
                    <th>Last 28 days</th>
                </tr>
            </thead>
            <tbody>
                <tr class="major">
                    <td class="type">Human</td>
                    <td class="amount"><strong>$commify(counts.human_edits.latest)</strong></td>
                    <td class="amount">$commify(counts.human_edits.previous)</td>
                    <td class="amount">$commify(counts.human_edits.get_summary(7))</td>
                    <td class="amount">$commify(counts.human_edits.get_summary(28))</td>
                </tr>
                <tr class="even">
                    <td class="type">Bot</td>
                    <td class="amount"><strong>$commify(counts.bot_edits.latest)</strong></td>
                    <td class="amount">$commify(counts.bot_edits.previous)</td>
                    <td class="amount">$commify(counts.bot_edits.get_summary(7))</td>
                    <td class="amount">$commify(counts.bot_edits.get_summary(28))</td>
                </tr>
                <tr class="totals">
                    <td class="type">Total</td>
                    <td class="amount">$commify(counts.bot_edits.latest + counts.human_edits.latest)</td>
                    <td class="amount">$commify(counts.bot_edits.previous + counts.human_edits.previous)</td>
                    <td class="amount">$commify(counts.bot_edits.get_summary(7) + counts.human_edits.get_summary(7))</td>
                    <td class="amount">$commify(counts.bot_edits.get_summary(28) + counts.human_edits.get_summary(28))</td>
                </tr>
            </tbody>
        </table>
             
    </div>

    <div class="contentRight">
        <div class="head rel"> <span class="caption"><a href="/admin/people">New Accounts Per Day</a></span>
            <h2>Members</h2>
        </div>
        <div class="chartHolder">
	  <div class="chartDisplay">	
	    <div id="membergraph" style="width:430px;height:50px;">
	      <!-- Member graphs go here -->
	    </div>
	  </div>
        </div>
        <table class="measurements stripeEven" id="members">
            <thead>
                <tr>
                    <th>Today</th>
                    <th>Yesterday</th>
                    <th>Last 7 days</th>
                    <th>Last 28 days</th>
                    <th class="shift">All Time</th>
                </tr>
            </thead>
            <tbody>
                <tr class="major">
                    <td class="amount"><strong>$commify(counts.members.latest)</strong></td>
                    <td class="amount">$commify(counts.members.previous)</td>
                    <td class="amount">$commify(counts.members.get_summary(7))</td>
                    <td class="amount">$commify(counts.members.get_summary(28))</td>
                    <td class="amount shift"><strong>$commify(counts.members.total)</strong></td>
                </tr>
                <tr class="even">
                    <td class="diff"></td>
                    <td class="diff"><span class="pos">+x.x%</span></td>
                    <td class="diff"><span class="neg">-x.x%</span></td>
                    <td class="diff"><span class="pos">+x.x%</span></td>
                    <td class="diff"></td>
                </tr>
                <tr class="totals">
                    <td class="type">Edit ratio</td>
                    <td class="amount">(Member)</td>
                    <td class="amount">x :</td>
                    <td class="amount">x (Anon)</td>
                </tr>
            </tbody>
        </table>
    </div>

    <h2>Record Counts</h2>
    <script type="text/javascript">
      \$(function () {
	  plot_tooltip_graph (\$("#works_minigraph"), $:json_encode(counts.works.get_counts(80, True)), " works on ");
	  plot_tooltip_graph (\$("#editions_minigraph"), $:json_encode(counts.editions.get_counts(80, True)), " editions on ");
	  plot_tooltip_graph (\$("#ebooks_minigraph"), $:json_encode(counts.ebooks.get_counts(80, True)), " ebooks on ");
	  plot_tooltip_graph (\$("#covers_minigraph"), $:json_encode(counts.covers.get_counts(80, True)), " covers on ");
	  plot_tooltip_graph (\$("#authors_minigraph"), $:json_encode(counts.authors.get_counts(80, True)), " authors on ");
	  plot_tooltip_graph (\$("#subjects_minigraph"), $:json_encode(counts.subjects.get_counts(80, True)), " subjects on ");
	  plot_tooltip_graph (\$("#lists_minigraph"), $:json_encode(counts.lists.get_counts(80, True)), " lists on ");
	  plot_tooltip_graph (\$("#members_minigraph"), $:json_encode(counts.members.get_counts(80, True)), " members on ");
      });
</script>
    
    <table class="measurements stripeEven">
        <tr>
            <th></th>
            <th>Last 7 days</th>
            <th>Last 28 days</th>
            <th>Trend</th>
            <th>Total</th>
        </tr>
        <tr class="major">
            <td>Works</td>
            <td class="amount">$commify(counts.works.get_summary(7))</td>
            <td class="amount">$commify(counts.works.get_summary(28))</td>
            <td><div class="sparkDisplay"><div id="works_minigraph" style="width:200px;height:35px;"></div></div></td>
            <td class="amount">$commify(counts.works.total)</td>    
        </tr>
        <tr class="major even">
            <td>Editions</td>
            <td class="amount">$commify(counts.editions.get_summary(7))</td> 
            <td class="amount">$commify(counts.editions.get_summary(28))</td>
            <td><div class="sparkDisplay"><div id="editions_minigraph" style="width:200px;height:35px;"></div></div></td>
            <td class="amount">$commify(counts.editions.total)</td>    
        </tr>
        <tr class="major">
            <td>eBooks</td>
            <td class="amount">$commify(counts.ebooks.get_summary(7))</td> 
            <td class="amount">$commify(counts.ebooks.get_summary(28))</td>
            <td><div class="sparkDisplay"><div id="ebooks_minigraph" style="width:200px;height:35px;"></div></div></td>
            <td class="amount">$commify(counts.ebooks.total)</td>    
        </tr>
        <tr class="major even">
            <td>Covers</td>
            <td class="amount">$commify(counts.covers.get_summary(7))</td> 
            <td class="amount">$commify(counts.covers.get_summary(28))</td>
            <td><div class="sparkDisplay"><div id="covers_minigraph" style="width:200px;height:35px;"></div></div></td>
            <td class="amount">$commify(counts.covers.total)</td>    
        </tr>
        <tr class="major">
            <td>Authors</td>
            <td class="amount">$commify(counts.authors.get_summary(7))</td> 
            <td class="amount">$commify(counts.authors.get_summary(28))</td>
            <td><div class="sparkDisplay"><div id="authors_minigraph" style="width:200px;height:35px;"></div></div></td>
            <td class="amount">$commify(counts.authors.total)</td>    
        </tr>
        <tr class="major even">
            <td>Subjects</td>
            <td class="amount">$commify(counts.subjects.get_summary(7))</td> 
            <td class="amount">$commify(counts.subjects.get_summary(28))</td>
            <td><div class="sparkDisplay"><div id="subjects_minigraph" style="width:200px;height:35px;"></div></div></td>
            <td class="amount">$commify(counts.subjects.total)</td>    
        </tr>
        <tr class="major">
            <td>Lists</td>
            <td class="amount">$commify(counts.lists.get_summary(7))</td> 
            <td class="amount">$commify(counts.lists.get_summary(28))</td>
            <td><div class="sparkDisplay"><div id="lists_minigraph" style="width:200px;height:35px;"></div></div></td>
            <td class="amount">$commify(counts.lists.total)</td>    
        </tr>
        <tr class="major even">
            <td>Members</td>
            <td class="amount">$commify(counts.members.get_summary(7))</td>
            <td class="amount">$commify(counts.members.get_summary(28))</td>
            <td><div class="sparkDisplay"><div id="members_minigraph" style="width:200px;height:35px;"></div></div></td>
            <td class="amount">$commify(counts.members.total)</td>
        </tr>
    </table>

    <div class="clearfix"></div>

    <div class="tweets" id="adminTwitter">$:macros.twitter()</div>
            
    <div class="contentSpacer"></div>

    <div class="contentQuarter">
        <!-- Start of Flickr Badge -->
            <table id="flickr_badge_uber_wrapper"> 
                <tr> 
                    <td>
                        <table id="flickr_badge_wrapper"> 
                            <script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?count=2&display=random&size=m&layout=v&source=user&user=41108298%40N06"></script> 
                        </table> 
                    </td> 
                </tr> 
            </table> 
        <!-- End of Flickr Badge -->
    </div>

</div>
plugin: admin
m: edit