svn: /pear2/sandbox/pear2.php.net/trunk/www/ css/search.css templates/pear2/html/Search.tpl.php
[email protected] (Michael Gauthier)
| Newsgroups | php.pear.cvs,php.pear.core |
|---|---|
| Message-ID | <[email protected]> |
gauthierm Thu, 24 Jun 2010 22:53:14 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=300740
Log:
Add no-results message to search page.
Changed paths:
U pear2/sandbox/pear2.php.net/trunk/www/css/search.css
U pear2/sandbox/pear2.php.net/trunk/www/templates/pear2/html/Search.tpl.php
Modified: pear2/sandbox/pear2.php.net/trunk/www/css/search.css
===================================================================
--- pear2/sandbox/pear2.php.net/trunk/www/css/search.css 2010-06-24 22:52:52 UTC (rev 300739)
+++ pear2/sandbox/pear2.php.net/trunk/www/css/search.css 2010-06-24 22:53:14 UTC (rev 300740)
@@ -23,3 +23,15 @@
}
/* }}} */
+/* {{{ No results message */
+
+.view-search ul {
+ margin: 0.5em 0;
+}
+
+.view-search ul li {
+ list-style-type: disc;
+ margin-left: 2em;
+}
+
+/* }}} */
Modified: pear2/sandbox/pear2.php.net/trunk/www/templates/pear2/html/Search.tpl.php
===================================================================
--- pear2/sandbox/pear2.php.net/trunk/www/templates/pear2/html/Search.tpl.php 2010-06-24 22:52:52 UTC (rev 300739)
+++ pear2/sandbox/pear2.php.net/trunk/www/templates/pear2/html/Search.tpl.php 2010-06-24 22:53:14 UTC (rev 300740)
@@ -8,6 +8,20 @@
<?php echo $savant->render(null, 'SearchForm.tpl.php'); ?>
</div>
<div class="pearbox-content">
- <?php echo $savant->render($context, 'PackageList.tpl.php'); ?>
+<?php
+
+if (count($context) === 0) {
+ ?>
+ <p>No packages were found for the keywords <strong><?php echo $context->query; ?></strong>.</p>
+ <ul>
+ <li>try using less specific keywords</li>
+ </ul>
+ <?php
+} else {
+ echo $savant->render($context, 'PackageList.tpl.php');
+}
+
+?>
+
</div>
</div>