summaryrefslogtreecommitdiff
path: root/data/tpl/pbrowse
diff options
context:
space:
mode:
Diffstat (limited to 'data/tpl/pbrowse')
-rw-r--r--data/tpl/pbrowse45
1 files changed, 45 insertions, 0 deletions
diff --git a/data/tpl/pbrowse b/data/tpl/pbrowse
new file mode 100644
index 00000000..71b40c82
--- /dev/null
+++ b/data/tpl/pbrowse
@@ -0,0 +1,45 @@
+<h2>[[: $p{PageTitle} ]]</h2>
+<p class="chr">
+ -[[= $d{chr} ne 'all' ? '<a href="/p/all">all</a>' : 'all' ]]- |
+ [[ for('a'..'z', 0) { ]]-
+ -[[ if($d{chr} eq $_) { ]][[= $_?$_:'#' ]][[ } else { ]]<a href="/p/[[= $_ ]]">[[= $_?$_:'#' ]]</a>[[ } ]]
+ [[ } ]]-
+ <form id="psearch" method="get" action="/p" accept-charset="UTF-8">
+ <fieldset>
+ <input type="text" name="q" id="q" value="[[: $d{query} ]]" class="text" />
+ <input type="submit" value="Search!" />
+ </fieldset>
+ </form>
+</p>
+
+-[[ if($#{$d{prods}} < 0) { ]]
+<p>
+ No results again, life sucks... :'(
+</p>
+[[ } else {
+ my $url = sprintf '/p/%s', $d{chr};
+ $url .= '?q='.$d{query} if $d{query};
+]]
+[[= pagebut($url) ]]
+<table id="tpd">
+ <thead><tr>
+ <td class="tc1">Name</td>
+ <td class="tc2">Type</td>
+ <td class="tc3">Main language</td>
+ <td class="tc4">Website</td>
+ </tr></thead>
+[[ for (@{$d{prods}}) { ]]-
+ <tr>
+ <td class="tc1"><a href="/p[[= $_->{id} ]]">[[: $_->{name} ]]</a></td>
+ <td class="tc2">[[: $VNDB::PROT->{$_->{type}} ]]</td>
+ <td class="tc3">[[: $VNDB::LANG->{$_->{lang}} ]]</td>
+ <td class="tc4">
+ [[ if($_->{website}) { ]]
+ <a href="[[: $_->{website} ]]">[[: length($_->{website}) > 30 ? substr($_->{website}, 0, 27).'...' : $_->{website} ]]
+ [[ } else { ]]---[[ } ]]
+ </td>
+ </tr>
+[[ } ]]-
+</table>
+[[= pagebut($url) ]]
+[[ } ]]