From 42741feaeb59e77025a93da7c737403e833a0a62 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 23 Oct 2020 18:01:24 +0000 Subject: [PATCH] Bug 26804: Limit the size of the News column in newst table This patch attempts to make the table on koha-news.tt more manaagable by limiting the width of the 'News' column and adding a sticky thead so you know what column you are looking at when you scroll through News Items To Test: 1. Add some HTML to a News Item. I am using a bunch of lorem ipsum HTML and this image set to 1000px. '' but I'm not your overlord so choose your own way. 2. Look at /cgi-bin/koha/tools/koha-news.pl and see all your content in the News column. With a large image you have to scroll a long way to see the action buttons (Edit, Delete) 3. Apply patch 4. Regenerate the staff CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client) 5. Clear you cache and again look at /cgi-bin/koha/tools/koha-news.pl. The table should only be 200px wide no matter the size of your content. 6. Scroll down and notice the thead stays with you. 7. Try testing at many different screen size. Question: Should we limit height as well? Signed-off-by: Lisette Scheer --- koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss | 11 +++++++++++ koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index a698ec9bf9..3cae5b378f 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -1232,6 +1232,17 @@ div { } } +#newst { + thead { + position: sticky; + top: 0; + } + .news_content { + max-width: 200px; + overflow: hidden; + } +} + #header_search { background-position: .5em .5em; background-repeat: no-repeat; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt index c210a5b707..7c54cbd983 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt @@ -123,7 +123,7 @@ Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %] Expiration date Title Author - News + News Actions [% FOREACH opac_new IN opac_news %] @@ -155,7 +155,7 @@ Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %] [% opac_new.expirationdate | $KohaDates %] [% IF ( opac_new.expired ) %](expired)[% END %] [% opac_new.title | html %] [% opac_new.author_title | html %] [% opac_new.author_firstname | html %] [% opac_new.author_surname | html %] - + [% opac_new.content | $raw %] -- 2.11.0