Beating search with the pretty stick, a little.

git-svn-id: svn://10.0.0.236/trunk@213976 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
shaver%mozilla.org
2006-10-22 13:17:42 +00:00
parent b6aeaccb12
commit 4bc430076f
4 changed files with 169 additions and 1 deletions

View File

@@ -217,6 +217,11 @@ h6 { font-size: 90%; border: 0; }
font-size: smaller;
}
.addon-feature .search-result-image {
float: right;
margin: 0 0 0 10px;
}
.addon-feature .addon-feature-image,
.bookmarkaddon-feature .addon-feature-image {
float: left;
@@ -333,6 +338,25 @@ p.install-button {
width: 40%;
}
#hide-search-options,
#search-options {
display: none;
}
#search-results .desc {
font-size: 80%;
}
#search-results .desc p {
margin-bottom: 0px;
}
#pages #next-page {
float: right;
}
/* various lists */
.compact-list {
font-size: 80%;
font-weight: bold;

View File

@@ -6,7 +6,7 @@
* @subpackage docs
*/
startProcessing('search.tpl',$memcacheId,$compileId,'nonav');
startProcessing('search.tpl',$memcacheId,$compileId,'rustico');
require_once('includes.php');
// Instantiate AMO_Object so we can get our categories and platforms.

View File

@@ -16,6 +16,7 @@
<title>{$app|capitalize} Add-ons | Mozilla Corporation</title>
<link rel="stylesheet" type="text/css" href="/css/rustico/addons-rustico.css" media="screen">
<script src="{$config.webpath}/js/install.js" type="text/javascript"></script>
<script src="{$config.webpath}/js/search.js" type="text/javascript"></script>
</head>
<body id="mozilla-com">

View File

@@ -1,4 +1,146 @@
{if $app eq "firefox"}
<div class="corner-box">
<div>
<form action="{$smarty.server.PHP_SELF}" method="get" class="amo-form">
<input type="hidden" name="app" value="{$app}"/>
<input type="text" name="q" value="{$clean.q}" maxlength="32"/><input class="amo-submit" type="submit" value="Search"/>
<span id="show-search-options"><a href="javascript:toggle('hide-search-options','show-search-options','inline');show('search-options','inline');">Advanced Options&hellip;</a></span>
<span id="hide-search-options"><a href="javascript:toggle('show-search-options','hide-search-options','inline');hide('search-options');">Hide Options</a></span>
</div>
<div id="search-options">
<fieldset>
<legend>Search Options</legend>
<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>
<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>
<option value="T"{if $clean.type eq 'T'} selected="selected"{/if}>Themes</option>
</select>
</div>
<div>
<label class="amo-label-small" for="appfilter">App:</label>
<select id="appfilter" name="appfilter">
<option value="null">Any</option>
{html_options options=$apps selected=$clean.appfilter}
</select>
</div>
<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>
<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>
<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>
<label class="amo-label-small" for="perpage">Per page:</label>
<select id="perpage" name="perpage">
{html_options options=$perpage selected=$clean.perpage}
</select>
</div>
</fieldset>
<p><input class="amo-submit" type="submit" value="Search"/></p>
</form>
<!-- end search-options -->
<input type="hidden" name="app" value="{$app}"/>
</div>
{if $results}
<p class="first">Showing results <b>{$page.leftDisplay}</b> to <b>{$page.right}</b> of <b>{$page.resultCount}</b>. <em>(Too many results? Try using the advanced options to narrow your search.)</em></p>
<table width="100%" class="compact-list">
<tr><td width="50%" align="left">{if $page.left}
<a href="./search.php?{$page.url}&amp;left={$page.previous}">&larr; Previous Results</a>
{else}
&nbsp;
{/if}</td>
<td width="50%" align="right">
{if $page.next}
<a href="./search.php?{$page.url}&amp;left={$page.next}">Next Results &rarr;</a>
{else}
&nbsp;
{/if}
</td>
<tr>
</table>
<div id="search-results" class="clearfix">
{section name=r loop=$results}
<div class="addon-feature clearfix">
<div class="corner-box">
<h4><a href="{$config.webpath}/{$app}/{$results[r]->ID}/">{$results[r]->Name} <span>{$results[r]->Version}</span></a> <span>by
{foreach key=key item=item from=$results[r]->Authors}
<a href="{$config.webpath}/{$app}/{$item.UserID|escape}/author/">{$item.UserName|escape}</a>{if $item != end($results[r]->Authors)},{/if}
{/foreach}
</span></h4>
{if $results[r]->PreviewURI}
<img src="{$config.webpath}{$results[r]->PreviewURI}" alt="" class="search-result-image" />
{/if}
<p class="desc">{$results[r]->Description|nl2br}</p>
</div>
</div>
{/section}
</div>
<table width="100%" class="compact-list">
<tr><td width="50%" align="left">{if $page.left}
<a href="./search.php?{$page.url}&amp;left={$page.previous}">&larr; Previous Results</a>
{else}
&nbsp;
{/if}</td>
<td width="50%" align="right">
{if $page.next}
<a href="./search.php?{$page.url}&amp;left={$page.next}">Next Results &rarr;</a>
{else}
&nbsp;
{/if}
</td>
<tr>
</table>
{else}
<h2>Addon Search</h2>
<p class="first">There are currently no results. Please use the options above to adjust your search terms.</p>
{/if}
{else} {* not firefox *}
<div class="key-point">
<form action="{$smarty.server.PHP_SELF}" method="get" class="amo-form">
@@ -163,3 +305,4 @@ Next Page &raquo;
<!-- End mBody -->
</div>
{/if}