diff options
author | Callan Barrett <wizzomafizzo@gmail.com> | 2008-12-21 17:49:35 +0100 |
---|---|---|
committer | Loui Chang <louipc.ist@gmail.com> | 2008-12-21 18:44:31 +0100 |
commit | b4a62c4915cc969e53abf803cd57d9d994eaf48c (patch) | |
tree | 1113e292520d27734396f7ec29a0b1127acbb0ea /web/template | |
parent | 6415b65ac92a29335104d9aac583d0ed8b37196f (diff) | |
download | aur-b4a62c4915cc969e53abf803cd57d9d994eaf48c.tar.gz aur-b4a62c4915cc969e53abf803cd57d9d994eaf48c.tar.xz |
Move package search results to a template
Logic is separated from html as much as possible, all html in a template
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Diffstat (limited to 'web/template')
-rw-r--r-- | web/template/pkg_search_results.php | 142 |
1 files changed, 142 insertions, 0 deletions
diff --git a/web/template/pkg_search_results.php b/web/template/pkg_search_results.php new file mode 100644 index 00000000..5af02ef0 --- /dev/null +++ b/web/template/pkg_search_results.php @@ -0,0 +1,142 @@ +<form action='packages.php?<?php print $_SERVER['QUERY_STRING'] ?>' method='post'> +<center> + +<table cellspacing='3' class='boxSoft'> + <tr> + <td class='boxSoftTitle' align='right'> + <span class='f3'><?php print __("Package Listing") ?></span> + </td> + </tr> + <tr> + <td class='boxSoft'> + <table width='100%' cellspacing='0' cellpadding='2'> + +<?php if (!$result) { ?> +<div class='pgboxbody'><?php print __("Error retrieving package list.") ?></div> +<?php } elseif ($total == 0) { ?> +<div class='pgboxbody'><?php print __("No packages matched your search criteria.") ?></div> +<?php } else { ?> + +<tr> + <?php if ($SID): ?> + <th style='border-bottom: #666 1px solid; vertical-align: bottom'> </th> + <?php endif; ?> + <th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'> + <?php print "<a href='?O=$O&L=".intval($_REQUEST["L"])."&C=".intval($_REQUEST["C"])."&K=$K&SB=l&SO=$SO_next&PP=$PP&SeB=".$_REQUEST["SeB"]."&do_Orphans=".$_REQUEST["do_Orphans"]."'>".__("Location")."</a>"; ?> + </span></th> + <th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'> + <?php print "<a href='?O=$O&L=".intval($_REQUEST["L"])."&C=".intval($_REQUEST["C"])."&K=$K&SB=c&SO=$SO_next&PP=$PP&SeB=".$_REQUEST["SeB"]."&do_Orphans=".$_REQUEST["do_Orphans"]."'>".__("Category")."</a>"; ?> + </span></th> + <th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'> + <?php print "<a href='?O=$O&L=".intval($_REQUEST["L"])."&C=".intval($_REQUEST["C"])."&K=$K&SB=n&SO=$SO_next&PP=$PP&SeB=".$_REQUEST["SeB"]."&do_Orphans=".$_REQUEST["do_Orphans"]."'>".__("Name")."</a>"; ?> + </span></th> + <th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'> + <?php print "<a href='?O=$O&L=".intval($_REQUEST["L"])."&C=".intval($_REQUEST["C"])."&K=$K&SB=v&SO=$SO_next&PP=$PP&SeB=".$_REQUEST["SeB"]."&do_Orphans=".$_REQUEST["do_Orphans"]."'>".__("Votes")."</a>"; ?> + </span></th> + <?php if ($SID): ?> + <th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print __("Voted") ?></span></th> + <th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print __("Notify") ?></span></th> + <?php endif; ?> + <th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print __("Description") ?></a></span></th> + <th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'> + <?php print "<a href='?O=$O&L=".intval($_REQUEST["L"])."&C=".intval($_REQUEST["C"])."&K=$K&SB=m&SO=$SO_next&PP=$PP&SeB=".$_REQUEST["SeB"]."&do_Orphans=".$_REQUEST["do_Orphans"]."'>".__("Maintainer")."</a>"; ?> + </span></th> +</tr> + +<?php for ($i=0; $row = mysql_fetch_assoc($result); $i++) { (($i % 2) == 0) ? $c = "data1" : $c = "data2"; ?> +<tr> + <?php if ($SID): if ($row["OutOfDate"]): $c = "outofdate"; endif; ?> + <td class='<?php print $c ?>'><input type='checkbox' name='IDs[<?php print $row["ID"] ?>]' value='1'></td> + <?php endif; ?> + <td class='<?php print $c ?>'><span class='f5'><span class='blue'><?php print $row["Location"] ?></span></span></td> + <td class='<?php print $c ?>'><span class='f5'><span class='blue'><?php print $row["Category"] ?></span></span></td> + <td class='<?php print $c ?>'><span class='f4'><a href='packages.php?ID=<?php print $row["ID"] ?>'><span class='black'><?php print $row["Name"] ?> <?php print $row["Version"] ?></span></a></span></td> + <td class='<?php print $c ?>'><span class='f5'><span class='blue'> <?php print $row["NumVotes"] ?></span></span></td> + <?php if ($SID): ?> + <td class='<?php print $c ?>'><span class='f5'><span class='blue'> + <?php if (isset($row["Voted"])): ?> + <?php print __("Yes") ?></span></td> + <?php else: ?> + </span></td> + <?php endif; ?> + <td class='<?php print $c ?>'><span class='f5'><span class='blue'> + <?php if (isset($row["Notify"])): ?> + <?php print __("Yes") ?></span></td> + <?php else: ?> + </span></td> + <?php endif; ?> + <?php endif; ?> + <td class='<?php print $c ?>'><span class='f4'><span class='blue'> + <?php print $row["Description"] ?></span></span></td> + <td class='<?php print $c ?>'><span class='f5'><span class='blue'> + <?php if (isset($row["Maintainer"])): ?> + <a href='packages.php?K=<?php print $row['Maintainer'] ?>&SeB=m'><?php print $row['Maintainer'] ?></a> + <?php else: ?> + <span style='color: blue; font-style: italic;'><?php print __("orphan") ?></span> + <?php endif; ?> + </span></span></td> +</tr> +<?php } ?> + + </table> + </td> + </tr> +</table> + +<?php if ($SID): ?> +<div style='text-align: right; padding: 5px 5% 5px 0'> + <select name='action'> + <option><?php print __("Actions") ?></option> + <option value='do_Flag'><?php print __("Flag Out-of-date") ?></option> + <option value='do_UnFlag'><?php print __("Unflag Out-of-date") ?></option> + <option value='do_Adopt'><?php print __("Adopt Packages") ?></option> + <option value='do_Disown'><?php print __("Disown Packages") ?></option> + <?php if (account_from_sid($SID) == "Trusted User" || account_from_sid($SID) == "Developer"): ?> + <option value='do_Delete'><?php print __("Delete Packages") ?></option> + <?php endif; ?> + <option value='do_Notify'><?php print __("Notify") ?></option> + <option value='do_UnNotify'><?php print __("UnNotify") ?></option> + </select> + <input type='submit' class='button' style='width: 80px' value='<?php print __("Go") ?>' /> +</div> +<?php endif; ?> + +<table width='90%' cellspacing='0' cellpadding='2'> + <tr> + <td> + <table border='0' cellpadding='0' cellspacing='0' width='100%'> + <tr> + <tr><td align='center' colspan='0'><span class='f4'><span class='blue'> + <?php print __("Showing results %s - %s of %s", $first, $last, $total) ?> + </span></span></td></tr> + <td colspan='2' align='center'> + <span class='f5'> + <?php if ($SID): ?> + <span class="outofdate"><?php print __("Out of Date") ?></span> + <?php endif; ?> + </span></td> + </tr> + <tr> + <td align='left'> + <?php if (($O-$PP) >= 0): ?> + <?php print "<a href='packages.php?O=" . ($O - $PP) . "&L=".intval($_REQUEST["L"])."&C=".intval($_REQUEST["C"])."&K=$K&SB=$SB&SO=$SO&PP=$PP&SeB=".$_REQUEST["SeB"]."&do_Orphans=".$_REQUEST["do_Orphans"]. "'>" . __("Less") . "</a>" ?> + <?php elseif ($O<$PP && $O>0): ?> + <?php print "<a href='packages.php?O=0&L=".intval($_REQUEST["L"])."&C=".intval($_REQUEST["C"])."&K=$K&SB=$SB&SO=$SO&PP=$PP&SeB=".$_REQUEST["SeB"]."&do_Orphans=".$_REQUEST["do_Orphans"]. "'>" . __("Less") . "</a>" ?> + <?php endif; ?> + </td> + <td align='right'> + <?php if ($total - $PP - $O > 0): ?> + <?php print "<a href='packages.php?O=" . ($O + $PP) . "&L=".intval($_REQUEST["L"])."&C=".intval($_REQUEST["C"]) . "&K=$K&SB=$SB&SO=$SO&PP=$PP&SeB=".$_REQUEST["SeB"] . "&do_Orphans=".$_REQUEST["do_Orphans"]."'>" . __("More") . "</a>" ?> + <?php endif; ?> + </td> + </tr> + +<?php } ?> + + </table> + </td> + </tr> +</table> + +</center> +</form> |