Skip to content

Commit

Permalink
pkp/pkp-lib#836 Complete search results page
Browse files Browse the repository at this point in the history
  • Loading branch information
NateWr authored and asmecher committed Nov 5, 2015
1 parent b67b609 commit a9ee77d
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 6 deletions.
1 change: 1 addition & 0 deletions plugins/themes/default/styles/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
@import "pages/login.less";
@import "pages/lostPassword.less";
@import "pages/register.less";
@import "pages/searchResults.less";
@import "pages/submissions.less";
@import "pages/viewPdf.less";
@import "objects/announcement_summary.less";
Expand Down
60 changes: 60 additions & 0 deletions plugins/themes/default/styles/pages/searchResults.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/**
* @file plugins/themes/default/styles/pages/searchResults.less
*
* Copyright (c) 2014-2015 Simon Fraser University Library
* Copyright (c) 2003-2015 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @brief Styles applying to the search page
* @link templates/frontend/pages/searchResults.tpl
*/
.page_search {

.search_results a {
margin-left: 0.5em;
}

.cmp_monographs_list {
margin-top: @triple;
border-bottom: @bg-border;

@media(min-width: @screen-lg-desktop) {
border-bottom: none;
}
}

.pkp_search {
margin: 0 -@base;
padding: @triple @base;
text-align: center;

button {
&:extend( .cmp_button );
width: 100%;
margin-top: @base;


@media(min-width: @screen-phone) {
width: auto;
margin-top: 0;
}
}

input[type="text"] {
&:extend(.pkp_form input[type="text"]);
}

.search_controls {
display: none;
}

@media(min-width: @screen-phone) {
margin: 0 -@double;
padding: @triple;
}

@media(min-width: @screen-desktop) {
margin: 0 -@triple;
}
}
}
27 changes: 21 additions & 6 deletions templates/frontend/pages/searchResults.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,47 @@
* @uses $publishedMonographs array List of published monographs
* @uses $searchQuery string The search query, if one was just made
*}
{include file="common/frontend/header.tpl" pageTitle="search.searchResults"}
{include file="common/frontend/header.tpl" pageTitle="common.search"}

<div class="page page_catalog">
<div class="page page_search">

{* Breadcrumb *}
{include file="frontend/components/breadcrumbs.tpl" type="category" currentTitleKey="search.searchResults"}
{include file="frontend/components/breadcrumbs.tpl" type="category" currentTitleKey="common.search"}
<div class="monograph_count">
{translate key="catalog.browseTitles" numTitles=$publishedMonographs|@count}
</div>

{* No query - this may happen because of a screen reader, so don't show an
error, just leave them with the search form *}
{if $searchQuery == '' }

{* No published titles *}
{if !$publishedMonographs|@count}
<div>{translate key="catalog.noTitlesSearch" searchQuery=$searchQuery}</div>
{elseif !$publishedMonographs|@count}
<div class="search_results">
{translate key="catalog.noTitlesSearch" searchQuery=$searchQuery}
<a href="#search-form">
{translate key="search.searchAgain"}
</a>
</div>

{* Monograph List *}
{else}
<div>
<div class="search_results">
{if $publishedMonographs|@count > 1}
{translate key="catalog.foundTitlesSearch" searchQuery=$searchQuery number=$publishedMonographs|@count}
{else}
{translate key="catalog.foundTitleSearch" searchQuery=$searchQuery}
{/if}
<a href="#search-form">
{translate key="search.searchAgain"}
</a>
</div>
{include file="frontend/components/monographList.tpl" monographs=$publishedMonographs}
{/if}

<a name="search-form"></a>
{include file="frontend/components/searchForm_simple.tpl"}

</div><!-- .page -->

{include file="common/frontend/footer.tpl"}

0 comments on commit a9ee77d

Please sign in to comment.