From fc188dfc825eb81fb6969305e8945b95138cbd41 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 22 Mar 2019 18:16:33 +0000 Subject: [PATCH] Bug 13782: RSS for news needs a bit of styling This patch makes a number of updates to the display of news in the OPAC. I hope that this makes OPAC news nicer/easier to read. It includes style changes to make the RSS link look better too. To test, apply the patch and regenerate the OPAC CSS. You should have multiple active news items. View the OPAC news with varied values of NewsAuthorDisplay and OpacNewsLibrarySelect. Test the single news item view. Test with Quotes on and off, and with OpacMainUserBlock populated or not. Signed-off-by: Liz Rea Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- .../opac-tmpl/bootstrap/css/src/opac.scss | 30 +++-- .../bootstrap/en/modules/opac-main.tt | 103 +++++++++++------- 2 files changed, 82 insertions(+), 51 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss index a4c135f84c..20fc1cd5d6 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss +++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss @@ -515,29 +515,41 @@ th { #news { margin: .5em 0; + padding: 1em; + + .newsitem { + &:last-child { + .newsfooter { + border-bottom: 0; + } + } + } } .newscontainer { border: 1px solid #DDD; - border-bottom-width: 0; } .newsheader { - background-color: #f0f3f3; - border-bottom: 1px solid #DDD; - color: #727272; margin: 0; - padding: 8px; + padding: 8px 0; } .newsbody { - padding: 8px; + padding: 8px 0; } .newsfooter { - border-bottom: 1px solid #DDD; - font-style: italic; - padding: 4px 8px; + border-bottom: 1px solid #EEE; + color: #727272; + font-size: 90%; + margin-bottom: .5em; + padding-bottom: .5em; +} + +#rssnews-container { + color: #727272; + font-size: 90%; } #rssnews-container { diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt index e02635fc41..46768ca7d5 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt @@ -49,19 +49,22 @@ [% ELSE %]
[% END %] - [% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %] + + [% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %] + [% UNLESS news_item %]
- - + +
[% END %] + [% END %] [% IF ( koha_news ) %] @@ -73,41 +76,54 @@ [% ELSE %] -
- [% SET newsdisp = ( Koha.Preference('NewsAuthorDisplay') ) %] - [% FOREACH koha_new IN koha_news %] -
-

[% koha_new.title | html %]

-
[% koha_new.content | $raw %]
-
(published on [% koha_new.timestamp | $KohaDates with_hours = 1 %][% IF ( (newsdisp == 'opac' || newsdisp == 'both') && koha_new.borrowernumber ) %] by [% koha_new.author_title | html %] [% koha_new.author_firstname | html %] [% koha_new.author_surname | html %][% END %])
-
- [% END %] -
- - [% END %] - - [% UNLESS news_item %] +
+ [% SET newsdisp = ( Koha.Preference('NewsAuthorDisplay') ) %] + [% FOREACH koha_new IN koha_news %] +
+

+ [% IF ( news_item ) %] + [% koha_new.title | html %] + [% ELSE %] + [% koha_new.title | html %] + [% END %] +

+
[% koha_new.content | $raw %]
+
+ Published on [% koha_new.timestamp | $KohaDates with_hours = 1 %] + [% IF ( (newsdisp == 'opac' || newsdisp == 'both') && koha_new.borrowernumber ) %] + by [% koha_new.author_title | html %] [% koha_new.author_firstname | html %] [% koha_new.author_surname | html %] + [% END %] + [% IF ( news_item ) %] + • Show all news + [% END %] +
+
- +
- [% END %] + [% END # /IF single_news_error %] [% ELSE %] [% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %] @@ -119,6 +135,9 @@
[% END %] + [% END # IF koha_news %] + + [% UNLESS news_item # Don't show under single news item %] [% IF ( display_daily_quote && daily_quote ) %]

Quote of the day

@@ -129,8 +148,8 @@ [% END %] [% IF ( OpacMainUserBlock ) %]
[% OpacMainUserBlock | $raw %]
[% END %] + [% END %] - [% END %]
[% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) || OpacNavRight ) %] -- 2.39.5