Updated CSS and adjusted Search.

This commit is contained in:
mike.morgan%oregonstate.edu 2006-03-28 02:37:22 +00:00
parent d2c2d2a110
commit e86fb4f786
7 changed files with 61 additions and 36 deletions

View File

@ -411,6 +411,14 @@
background: transparent url("../../img/key-point_br.gif") scroll no-repeat bottom right ;
}
#search-side {
padding: 10px;
#search-options {
display: none;
}
#hide-search-options {
display: none;
}
#show-search-options {
display: inline;
}

View File

@ -3,7 +3,7 @@
}
.amo-submit {
background-color: #cfc;
background-color: #eee;
border: 2px #999 outset;
}

View File

@ -0,0 +1,12 @@
function toggle(show,hide,display) {
document.getElementById(show).style.display = display;
document.getElementById(hide).style.display = "none";
}
function hide(id) {
document.getElementById(id).style.display = "none";
}
function show(id,display) {
document.getElementById(id).style.display = display;
}

View File

@ -9,7 +9,6 @@
* @todo add page links ( 1 2 3 4 5 ..... n ) for big result sets? is this necessary?
* @todo take pagination and throw it into a class so we can reuse the methodology.
* @todo check validation - the form has some errors in it.
* @todo fix CSS so the pull-downs look symmetrical before design freaks start crying.
*/
// Get our cache_id based on what we have in our query string.
@ -135,6 +134,7 @@ $select = "
// Where clause.
$where = "
WHERE
version.approved = 'YES' AND
";
// Order by.
@ -142,9 +142,7 @@ $orderby = "
ORDER BY
";
if (!empty($sql['platform'])||!empty($sql['app'])) {
$select .= " INNER JOIN version ON version.ID = main.ID ";
}
$select .= " INNER JOIN version ON version.ID = main.ID ";
if (!empty($sql['cat'])) {
$select .= " INNER JOIN categoryxref ON categoryxref.ID = main.ID ";
@ -277,7 +275,8 @@ $tpl->assign(
'sort' => $sort,
'perpage' => $perpage,
'content' => 'search.tpl',
'title' => 'Search'
'title' => 'Search',
'extraHeaders' => '<script src="'.WEB_PATH.'/js/search.js" type="text/javascript"></script>'
)
);
?>

View File

@ -17,6 +17,9 @@
<script src="{$config.webpath}/js/install.js" type="text/javascript"></script>
<script src="{$config.webpath}/js/search-plugin.js" type="text/javascript"></script>
<script src="{$config.webpath}/js/auth.js" type="text/javascript"></script>
{if $extraHeaders}
{$extraHeaders}
{/if}
</head>
<body>

View File

@ -16,6 +16,9 @@
<script src="{$config.webpath}/js/install.js" type="text/javascript"></script>
<script src="{$config.webpath}/js/search-plugin.js" type="text/javascript"></script>
<script src="{$config.webpath}/js/auth.js" type="text/javascript"></script>
{if $extraHeaders}
{$extraHeaders}
{/if}
</head>
<body>

View File

@ -1,29 +1,30 @@
<div id="side">
{* @todo fix the javascript hide/show so it's not n00bl3t1z3t3d *}
<div class="key-point">
<div id="nav">
<form id="search-side" action="{$smarty.server.PHP_SELF}" method="get">
<form action="{$smarty.server.PHP_SELF}" method="get" class="amo-form">
<div>
<input type="text" name="q" value="{$clean.q}" maxlength="32"/>
<input type="submit" value="Search"/>
<div id="show-search-options"><input class="amo-submit" type="submit" value="Search"/> <a href="javascript:toggle('hide-search-options','show-search-options','inline');show('search-options','inline');">Show Options</a></div>
<div id="hide-search-options"><a href="javascript:toggle('show-search-options','hide-search-options','inline');hide('search-options');">Hide Options</a></div>
</div>
<div id="search-options">
<fieldset>
<legend>Search Options</legend>
<div class="search-option">
<label for="cat">Category:</label>
<div>
<label class="amo-label-small" for="cat">Category:</label>
<select name="cat" id="cat">
<option value="null">Any</option>
{html_options options=$cats selected=$clean.cat}
</select>
</div>
<div class="search-option">
<label for="type">Type:</label>
<div>
<label class="amo-label-small" for="type">Type:</label>
<select id="type" name="type">
<option value="null">Any</option>
<option value="E"{if $clean.type eq 'E'} selected="selected"{/if}>Extensions</option>
@ -31,39 +32,39 @@
</select>
</div>
<div class="search-option">
<label for="app">App:</label>
<div>
<label class="amo-label-small" for="app">App:</label>
<select id="app" name="app">
<option value="null">Any</option>
{html_options options=$apps selected=$app}
</select>
</div>
<div class="search-option">
<label for="platform">Platform:</label>
<div>
<label class="amo-label-small" for="platform">Platform:</label>
<select id="platform" name="platform">
<option value="null">Any</option>
{html_options options=$platforms selected=$clean.platform}
</select>
</div>
<div class="search-option">
<label for="date">Date:</label>
<div>
<label class="amo-label-small" for="date">Date:</label>
<select id="date" name="date">
<option value="null">Any</option>
{html_options options=$dates selected=$clean.date}
</select>
</div>
<div class="search-option">
<label for="sort">Sort by:</label>
<div>
<label class="amo-label-small" for="sort">Sort by:</label>
<select id="sort" name="sort">
{html_options options=$sort selected=$clean.sort}
</select>
</div>
<div class="search-option">
<label for="perpage">Per page:</label>
<div>
<label class="amo-label-small" for="perpage">Per page:</label>
<select id="perpage" name="perpage">
{html_options options=$perpage selected=$clean.perpage}
</select>
@ -71,21 +72,21 @@
</fieldset>
<p><input type="submit" value="Search"/></p>
<p><input class="amo-submit" type="submit" value="Search"/></p>
<!-- end search-options -->
</div>
</form>
</div>
<!-- end nav -->
</div>
<!-- end side -->
<div id="mBody">
<div id="mainContent">
{if $results}
<h2>Addon Search Results</h2>
<h2>Search Results</h2>
<p class="first"><b>{$page.resultCount}</b> Addons found. Showing records <b>{$page.leftDisplay}-{$page.right}</b>. <em>Too many results? Try narrowing your search.</em></p>
<div class="pages">
@ -152,6 +153,5 @@ Next Page &raquo;
{/if}
<!-- End mBody -->
</div>
<!-- end mainContent -->