<div id="dashboard">
  <div class="yui-g">
    <div class="yui-u first">
      <div class="dashboard-item">
        <h2>Recent Changes</h2>

        <ul>
% while ( my ( $page, $revision ) = $changes->next() ) {
          <li>
            <a href="<% $page->uri() %>"><% $page->title() %>
              (<% loc( 'revision %1', $revision->revision_number() ) %>)</a>
            - <% loc( '%datetime(%1)', $c->user()->set_time_zone_for_dt( $revision->creation_datetime() ) ) %>
          </li>
% }
        </ul>
      </div>
    </div>

    <div class="yui-u">
      <div class="dashboard-item">
        <h2>Popular Pages</h2>

        <ul>
% while ( my $page = $views->next() ) {
          <li>
            <a href="<% $page->uri() %>"><% $page->title() %></a> -
%   my $raw = $views->raw_row();
            <% loc( '%quant( %1, view, views )', $raw->[-1] ) %>
          </li>
% }
% unless ( $views->index() ) {
          <li><% loc( q{Looks like there hasn't been any page view activity in this wiki yet.} ) %></li>
% }
        </ul>
      </div>
    </div>
  </div>

  <div class="yui-g">
    <div class="yui-u first">
      <div class="dashboard-item">
        <h2>Popular Tags</h2>

        <ul>
% while ( my $tag = $tags->next() ) {
<& tag-as-li.mas, tag => $tag, count => $tags->raw_row()->[-1] &>
% }
% unless ( $tags->index() ) {
          <li><% loc( q{Looks like no pages have been tagged in this wiki yet.} ) %></li>
% }
        </ul>
      </div>
    </div>

    <div class="yui-u">
      <div class="dashboard-item">
        <h2>Active Users</h2>

        <ul>
% while ( my $user = $users->next() ) {
          <li>
            <& /lib/user-link.mas, user => $user, wiki => $wiki &>
          </li>
% }
% unless ( $users->index() ) {
          <li><% loc( q{Looks like there hasn't been any user activity for the past month in this wiki.} ) %></li>
% }
        </ul>
      </div>
    </div>
  </div>
</div>


<%args>
$wiki
$changes
$tags
$views
$users
</%args>

<%method title>
<% loc( '%1 Dashboard ', $wiki->title() ) %>
<%args>
$wiki
</%args>
</%method>
