diff --git a/plugins/themes/default/styles/components.less b/plugins/themes/default/styles/components.less index 2c375e279f7..6b1cef7b2a7 100644 --- a/plugins/themes/default/styles/components.less +++ b/plugins/themes/default/styles/components.less @@ -181,12 +181,45 @@ // List of monographs .cmp_monographs_list { - margin-left: -@double; - margin-right: -@double; + margin-left: -@base; + margin-right: -@base; + + > .title { + font-size: @font-bump; + line-height: @triple; + padding: 0 @base; + } .obj_monograph_summary { - padding: @double; - border-bottom: @bg-border; + padding: @double @base; + } + + @media(min-width: @screen-tablet) { + position: relative; + margin-top: @triple * 2; + margin-left: -@double; + margin-right: -@double; + border-top: @bg-border; + + > .title { + position: absolute; + top: -15px; + left: @double; + margin: 0; + padding: 0 @base; + background: @lift; + color: @text-light; + } + + .obj_monograph_summary { + padding: @triple; + border-bottom: @bg-border; + } + + .row:last-child .obj_monograph_summary:last-child, + > .obj_monograph_summary:last-child { // if last is a featured monograph + border-bottom: none; + } } @media(min-width: @screen-desktop) { @@ -214,9 +247,9 @@ &:first-child { padding-right: @triple; + border-top: none; border-right: @bg-border; } - } .obj_monograph_summary + .obj_monograph_summary { @@ -224,6 +257,18 @@ margin-left: -1px; // ensure right/left borders overlap border-left: @bg-border; } + + .obj_monograph_summary.is_featured { + float: none; + width: 100%; + border-right: none; + border-left: none; + border-bottom: @bg-border; + + &:last-child { + border-bottom: none; + } + } } } diff --git a/plugins/themes/default/styles/index.less b/plugins/themes/default/styles/index.less index fa01c8667b6..4442583f969 100644 --- a/plugins/themes/default/styles/index.less +++ b/plugins/themes/default/styles/index.less @@ -30,6 +30,7 @@ @import "main.less"; @import "pages/about.less"; @import "pages/announcements.less"; +@import "pages/catalogCategory.less"; @import "pages/index.less"; @import "pages/login.less"; @import "pages/lostPassword.less"; diff --git a/plugins/themes/default/styles/objects/monograph_summary.less b/plugins/themes/default/styles/objects/monograph_summary.less index 26655032ffe..1932bef713d 100644 --- a/plugins/themes/default/styles/objects/monograph_summary.less +++ b/plugins/themes/default/styles/objects/monograph_summary.less @@ -11,6 +11,15 @@ .obj_monograph_summary { .pkp_helpers_clear; + .featured { + display: inline-block; + margin-bottom: @base; + border-bottom: @bg-border; + font-size: @font-sml; + line-height: @line-sml; + color: @text-light; + } + .cover { display: block; @@ -29,8 +38,9 @@ } .title { + display: block; font-size: @font-base; - line-height: @line-base; + line-height: 25px; } .author { diff --git a/plugins/themes/default/styles/pages/catalogCategory.less b/plugins/themes/default/styles/pages/catalogCategory.less new file mode 100644 index 00000000000..c7bf5cce854 --- /dev/null +++ b/plugins/themes/default/styles/pages/catalogCategory.less @@ -0,0 +1,55 @@ +/** + * @file plugins/themes/default/styles/pages/catalogCategory.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 a category page in the catalog + * @link templates/frontend/pages/catalogCategory.tpl + */ +.page_catalog_category { + + .subcategories { + + ul { + &:extend(.pkp_unstyled_list); + } + + li { + padding-top: @half; + padding-bottom: @half; + } + + a { + text-decoration: none; + } + + @media(min-width: @screen-tablet) { + position: relative; + margin-top: @triple * 2; + margin-left: -@double; + margin-right: -@double; + padding: @triple; + border-top: @bg-border; + border-bottom: @bg-border; + + h3 { + position: absolute; + top: -15px; + left: @double; + margin: 0; + padding-left: @base; + padding-right: @base; + line-height: @triple; + background: @lift; + color: @text-light; + } + } + + @media(min-width: @screen-desktop) { + margin-left: -@triple; + margin-right: -@triple; + } + } +} diff --git a/templates/frontend/components/monographList.tpl b/templates/frontend/components/monographList.tpl index f259cc4ed20..84ce4b2c3af 100644 --- a/templates/frontend/components/monographList.tpl +++ b/templates/frontend/components/monographList.tpl @@ -8,19 +8,41 @@ * @brief Display a list of monographs. * * @uses $monographs array List of monographs to display + * @uses $featured array Optional list of monograph IDs to feature in the list + * @uses $titleKey string Optional translation key for a title for the list *}
- {foreach name="monographListLoop" from=$monographs item=monograph} - {if $smarty.foreach.monographListLoop.iteration is odd by 1} + + {* Optional title *} + {if $titleKey} +

+ {translate key=$titleKey} +

+ {/if} + + {* Show featured items first *} + {if $featured && count($featured) > 0} + {foreach from=$featured key=id item=array_key} + {include file="frontend/objects/monograph_summary.tpl" monograph=$monographs[$id] isFeatured=1} + {/foreach} + {/if} + + {assign var=counter value=1} + {foreach name="monographListLoop" from=$monographs item=monograph key=key} + {if is_array($featured) && array_key_exists($key, $featured)} + {php}continue;{/php} + {/if} + {if $counter is odd by 1}
{/if} {include file="frontend/objects/monograph_summary.tpl" monograph=$monograph} - {if $smarty.foreach.monographListLoop.iteration is even by 1} + {if $counter is even by 1}
{/if} + {assign var=counter value=$counter+1} {/foreach} {* Close .row if we have an odd number of titles *} - {if count($monographs) > 0 && $smarty.foreach.monographListLoop.iteration is odd by 1} + {if $counter > 1 && $counter is even by 1}
{/if} diff --git a/templates/frontend/objects/monograph_summary.tpl b/templates/frontend/objects/monograph_summary.tpl index 5baf5de927c..7d65f00f943 100644 --- a/templates/frontend/objects/monograph_summary.tpl +++ b/templates/frontend/objects/monograph_summary.tpl @@ -8,11 +8,17 @@ * @brief Display a summary view of a monograph for display in lists * * @uses $monograph Monograph The monograph to be displayed + * @uses $isFeatured bool Is this a featured monograph? *} -
+
getId()}" class="cover"> {translate key=getLocalizedFullTitle()|strip_tags|escape}" src="{url router=$smarty.const.ROUTE_COMPONENT component="submission.CoverHandler" op="thumbnail" submissionId=$monograph->getId() random=$monograph->getId()|uniqid}" /> + {* {if $isFeatured} + + {/if} *} getId()}" class="title"> {$monograph->getLocalizedFullTitle()} diff --git a/templates/frontend/pages/catalog.tpl b/templates/frontend/pages/catalog.tpl index 594d70bb0b6..7ad4db8fdf9 100644 --- a/templates/frontend/pages/catalog.tpl +++ b/templates/frontend/pages/catalog.tpl @@ -19,25 +19,14 @@ {* No published titles *} {if !$publishedMonographs|@count} +

+ {translate key="catalog.allBooks"} +

{translate key="catalog.noTitles"}

{* Monograph List *} {else} -
- {foreach name="monographLoop" from=$publishedMonographs item=monograph} - {if $smarty.foreach.monographLoop.iteration is odd by 1} -
- {/if} - {include file="frontend/objects/monograph_summary.tpl" monograph=$monograph} - {if $smarty.foreach.monographLoop.iteration is even by 1} -
- {/if} - {/foreach} - {* Close .row if we have an odd number of titles *} - {if $smarty.foreach.monographLoop.iteration is odd by 1} -
- {/if} -
+ {include file="frontend/components/monographList.tpl" monographs=$publishedMonographs} {/if}
diff --git a/templates/frontend/pages/catalogCategory.tpl b/templates/frontend/pages/catalogCategory.tpl index 542eacdb48c..f2f4e8b0a5e 100644 --- a/templates/frontend/pages/catalogCategory.tpl +++ b/templates/frontend/pages/catalogCategory.tpl @@ -13,6 +13,8 @@ * @uses $newReleasesMonographs array List of new monographs in this category * @uses $parentCategory Category Parent category if one exists * @uses $subcategories array List of subcategories if they exist + * @uses $alreadyShown array Array of monograph IDs which have already been + * displayed. These IDs are excluded from later sections. *} {include file="common/frontend/header.tpl" pageTitleTranslated=$category->getLocalizedTitle()} @@ -54,54 +56,25 @@ {/iterate} - {/if} {* No published titles in this category *} {if empty($publishedMonographs)} +

+ {translate key="catalog.allBooks"} +

{translate key="catalog.noTitlesSection"}

{else} - {* Featured monographs *} - {if !empty($featuredMonographIds)} -

- {translate key="catalog.featuredBooks"} -

- - {/if} - - {/if} - {* New releases *} {if !empty($newReleasesMonographs)} -

- {translate key="catalog.newReleases"} -

- {include file="frontend/components/monographList.tpl" monographs=$newReleasesMonographs} + {include file="frontend/components/monographList.tpl" monographs=$newReleasesMonographs titleKey="catalog.newReleases"} {/if} {* All monographs *} -

- {translate key="catalog.allBooks"} -

- {include file="frontend/components/monographList.tpl" monographs=$publishedMonographs} + {include file="frontend/components/monographList.tpl" monographs=$publishedMonographs featured=$featuredMonographIds titleKey="catalog.allBooks"} {/if} diff --git a/templates/frontend/pages/catalogSeries.tpl b/templates/frontend/pages/catalogSeries.tpl index 8f25145c241..fa13d877a5f 100644 --- a/templates/frontend/pages/catalogSeries.tpl +++ b/templates/frontend/pages/catalogSeries.tpl @@ -47,45 +47,13 @@ {else} - {* Featured monographs *} - {if !empty($featuredMonographIds)} -

- {translate key="catalog.featuredBooks"} -

- - {/if} - - {/if} - {* New releases *} {if !empty($newReleasesMonographs)} -

- {translate key="catalog.newReleases"} -

- {include file="frontend/components/monographList.tpl" monographs=$newReleasesMonographs} + {include file="frontend/components/monographList.tpl" monographs=$newReleasesMonographs titleKey="catalog.newReleases"} {/if} {* All monographs *} -

- {translate key="catalog.allBooks"} -

- {include file="frontend/components/monographList.tpl" monographs=$publishedMonographs} + {include file="frontend/components/monographList.tpl" monographs=$publishedMonographs featured=$featuredMonographIds titleKey="catalog.allBooks"} {/if}