<!DOCTYPE html
		PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
		xmlns:py="http://genshi.edgewall.org/"
		xmlns:xi="http://www.w3.org/2001/XInclude">
	<xi:include href="layout.html" />
	<xi:include href="macros.html" />
	<head>
		<title>$path</title>
	</head>
<?python
import os
?>
	<body>
		<div id="content" class="browser">
			<div id="jumprev">
				<form action="" method="get">
					<div>
						<B>PATH:${path}</B>
					</div>
					<div>
						<label for="rev" title="${stickyrev and _('Hint: clear the field to view latest revision') or None}">
							${_('View revision')}:</label>
						<input type="text" id="rev" name="rev" value="$stickyrev" size="6" />
					</div>
				</form>
			</div>

				<table class="listing" id="dirlist">
					<thead>
						<tr>
 				<th class="rev">${_('Directory Name')}</th>
				<th class="rev">${_('File Name')}</th>
				<th class="rev">${_('Size')}</th>
							<th class="rev">${_('Rev')}</th>
				<th class="rev">${_('Age')}</th>
							<th class="change">${_('Last Change')}</th>
							<th class="change">ログ</th>
							<th class="change">タイプ</th>
							<th class="change">実ステップ行数</th>
				<th class="change">コメント行数</th>
				<th class="change">コメント率</th>
			</tr>
			</thead>
			<tbody>
				<tr class="odd" py:if="path != '/'">
					<td colspan='11'><a href="${href.stepcounter(path[0:path.rindex('/')], rev=stickyrev, order=(dir.order != 'name' and dir.order or None), desc=dir.desc)}">..</a></td>
				</tr>

		<py:for each="idx, entry in enumerate(dir.entries)">
			<py:with vars="change = dir.changes.get(entry.rev)">
				<tr class="${idx % 2 and 'even' or 'odd'}">
					<td class="name">
						<a class="$entry.kind" title="${_('View %(kind)s', kind=(entry.kind == entry.DIRECTORY and _('Directory') or _('File')))}"
						 href="${href.stepcounter(os.path.dirname(entry.path), rev=stickyrev, order=(dir.order != 'name' and dir.order or None), desc=dir.desc)}">${os.path.dirname(entry.path)}</a>
					</td>
					<td class="name">
						<a class="$entry.kind" title="${_('View %(kind)s', kind=(entry.kind == entry.DIRECTORY and _('Directory') or _('File')))}"
						 href="${href.browser(entry.path, rev=stickyrev, order=(dir.order != 'name' and dir.order or None), desc=dir.desc)}">$entry.name</a>
					</td>
					<td class="size">${sizeinfo(entry.content_length)}</td>
					<td class="rev">
						<a title="${_('View Revision Log')}" href="${href.log(entry.path, rev=rev)}">$entry.rev</a>
					</td>
					<td class="age" style="${None}">
						${change and dateinfo(change.date) or '-'}
					</td>
					<td class="author">
						<span class="author" py:if="change"><a class="$entry.kind" href="${href.stepcounter(path, rev=stickyrev, order=(dir.order != 'name' and dir.order or None), desc=dir.desc,commiter=change.author)}">${authorinfo(change.author)}</a></span>
					</td>
					<td class="change">
						<span class="change" py:choose="" py:with="chgset_context = context('changeset', change.rev)">
						<py:when test="not change or 'CHANGESET_VIEW' not in perm(chgset_context.resource)">-</py:when>
						<py:when test="wiki_format_messages">
							${change and wiki_to_oneliner(chgset_context, change.message, shorten=True)}
						</py:when>
						<py:otherwise>${change and shorten_line(change.message)}</py:otherwise>
						</span>
					</td>
					<td py:if="entry.isdir==False">${dir.counts[idx].fileType}</td>
					<td py:if="entry.isdir==False" class="count">${dir.counts[idx].step}</td>
					<td py:if="entry.isdir==False" class="count">${dir.counts[idx].commentStep}</td>
					<td py:if="entry.isdir==False" class="count">
						<py:choose>
							<py:when test="dir.counts[idx].step == 0">N/A</py:when>
							<py:otherwise>
								${'%3.1f' % (float(dir.counts[idx].commentStep*100)/float(dir.counts[idx].commentStep+dir.counts[idx].step))}%
							</py:otherwise>
						</py:choose>
					</td>
				</tr>
			</py:with>
		</py:for>
				<tr>
					<td colspan='8'>合計</td>
					<td class="count">${dir.sum_step}</td>
					<td class="count">${dir.sum_comment}</td>
					<td class="count">${'%3.1f' % (float(dir.sum_comment*100)/float(dir.sum_step+dir.sum_comment))}%</td>
				</tr>
			</tbody>
		</table>
	</div>
	</body>
</html>
