source: ccsweb/trunk/smarty/templates/configListing.tpl @ 957

Last change on this file since 957 was 957, checked in by mglb1, 7 years ago

Added sorting ability to the configuration file viewer

  • Property svn:keywords set to Id
File size: 3.9 KB
Line 
1{* Copyright (C) 2006  The University of Waikato
2 *
3 * This file is part of ccsweb - CRCnet Configuration System Web Interface
4 *
5 * Author:       Matt Brown <matt@crc.net.nz>
6 * Version:      $Id$
7 *
8 * ccsweb is free software; you can redistribute it and/or modify it under the
9 * terms of the GNU General Public License version 2 as published by the Free
10 * Software Foundation.
11 *
12 * ccsweb is distributed in the hope that it will be useful, but WITHOUT ANY
13 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15 * details.
16 *
17 * You should have received a copy of the GNU General Public License along with
18 * ccsweb; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20 *}
21{strip}
22{if $keeprev==1}
23{assign var="pageq" value="?rev=$revision"}
24{assign var="pageqa" value="&amp;rev=$revision"}
25{else}
26{assign var="pageq" value=""}
27{assign var="pageqa" value=""}
28{/if}
29{assign var="nameclass" value=""}
30{assign var="sizeclass" value=""}
31{assign var="dateclass" value=""}
32{assign var="nameorder" value=""}
33{assign var="sizeorder" value=""}
34{assign var="dateorder" value=""}
35{if $order!=""}
36    {if $desc==1}
37        {assign var="`$order`class" value=" desc"}
38        {assign var="`$order`order" value="&amp;desc=0"}
39    {else}
40        {assign var="`$order`class" value=" asc"}
41        {assign var="`$order`order" value="&amp;desc=1"}
42    {/if}
43{/if}
44{/strip}
45<div id="configBrowser">
46<div id="ctxtnav" class="nav">
47 <ul>
48  <li class="last"><a href="/configs/log">Revision Log</a></li>
49 </ul>
50</div>
51
52<h1><a class="first" title="Go to root directory" href="/configs/">root</a>
53{assign var="prev" value=""}
54{assign var="parent" value=""}
55{foreach from=$path item=part}
56{if $part!=""}
57<span class="sep">/</span>
58<a title="View {$part}" href="/configs{$prev}/{$part}{$pageq}">{$part}</a>
59{assign var="parent" value=$prev}
60{assign var="prev" value="$prev/$part"}
61{/if}
62{/foreach}
63{assign var="pageurl" value="$prev"}
64</h1>
65
66<div id="jumprev">
67    <form action="/configs{$pageurl}" method="get">
68    <div>
69        <label for="rev">View revision:</label>
70        <input type="text" id="rev" name="rev" value="{$revision}" size="4" />
71    </div>
72    </form>
73</div>
74
75<table class="listing" id="dirlist">
76<thead>
77<tr>
78    <th class="name{$nameclass}">
79        <a title="Sort by name (descending)"
80            href="/configs{$pageurl}?order=name{$nameorder}{$pageqa}">Name</a>
81    </th>
82    <th class="size{$sizeclass}">
83        <a title="Sort by size"
84            href="/configs{$pageurl}?order=size{$sizeorder}{$pageqa}">Size</a>
85    </th>
86    <th class="rev">Rev</th>
87    <th class="date{$dateclass}">
88        <a title="Sort by date"
89            href="/configs{$pageurl}?order=date{$dateorder}{$pageqa}">Age</a>
90    </th>
91    <th class="change">Last Change</th>
92</tr>
93</thead>
94<tbody>
95{if $pageurl!=""}
96<tr class="even">
97    <td class="name" colspan="5">
98        <a class="parent" title="Parent Directory"
99            href="/configs{$parent}{$pageq}">../</a>
100    </td>
101</tr>
102{/if}
103{foreach from=$entries item=entry}
104<tr class="{cycle values="odd,even"}">
105    <td class="name">
106        <a class="{$entry.kind}" title="Browse Directory"
107            href="/configs{$pageurl}/{$entry.name}{$pageq}">{$entry.name}</a>
108    </td>
109    <td class="size">
110        {assign var="kbs" value=$entry.size/1024}
111        {if $entry.size>0}{$kbs|string_format:"%.1f"}&nbsp;kB{/if}
112    </td>
113    <td class="rev">
114        <a title="View Revision Log"
115            href="/configs/log{$pageurl}">{$entry.created_rev.number}</a>
116    </td>
117    <td class="age">
118        <span title="{$entry.age}">{$entry.age_rounded}</span>
119    </td>
120    <td class="change">
121        <span class="author">{$entry.last_author}:</span>
122        <span class="change">{$entry.created_rev.log}</span>
123    </td>
124</tr>
125{/foreach}
126</tbody>
127</table>
128
129</div>
Note: See TracBrowser for help on using the repository browser.