From 109326efa70c1bda02f4bd9e8ffbffa2a7e0a961 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 18 Apr 2012 11:32:48 -0400 Subject: [PATCH] Bug 7980: [SIGNED-OFF] Group search results tag input with other actions Content-Type: text/plain; charset="utf-8" This patch hides the tag input form in OPAC search results when TagsInputOnList is turned on. An "Add tag" is added to the "Actions" line. Clicking the link un-hides the tag input form. A "Cancel" link hides it again. The patch also moves the display of ratings to the bottom of the list so that existing tags are grouped with the other title details which are prefixed with a label ("Type:", "Availability", etc.). To test, enable the TagsInputOnList system preference. Do a search and try adding tags from the search results list. signed-off-by: Jonathan Druart Signed-off-by: Marcel de Rooy --- koha-tmpl/opac-tmpl/prog/en/css/opac.css | 32 +++++++- .../opac-tmpl/prog/en/modules/opac-results.tt | 75 ++++++++++++------- .../opac-tmpl/prog/images/tag-small-disabled.png | Bin 0 -> 317 bytes koha-tmpl/opac-tmpl/prog/images/tag-small.png | Bin 0 -> 347 bytes 4 files changed, 75 insertions(+), 32 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/prog/images/tag-small-disabled.png create mode 100644 koha-tmpl/opac-tmpl/prog/images/tag-small.png diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css index 0cc7f2d..a0ec0d0 100644 --- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css +++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css @@ -722,6 +722,30 @@ input.deleteshelf:active { #tagslist li { display : inline; } +a.tag_results_add { + background-image: url(../../images/tag-small.png); + background-position : -1px center; + background-repeat : no-repeat; + padding-left : 13px; + text-decoration: none; +} + +#login4tags { + background-image: url(../../images/tag-small-disabled.png); + background-position : -1px center; + background-repeat : no-repeat; + padding-left : 13px; + text-decoration: none; + margin-left: 1em; +} + +.tag_results_input { + background-color: #EEE; + display: none; + margin-left: 1em; + padding: 0.3em; +} + #placehold input.submit:hover, #tagsel_span input.submit:hover { color: #990033; @@ -1407,6 +1431,10 @@ padding-left : .4em; font-size : 100%; } +.results_summary.actions { + margin-top : .5em; +} + .m880 { display:block; text-align:right; @@ -1420,10 +1448,6 @@ padding-left : .4em; color: #707070; } -#login4tags { - margin-top : .3em; -} - .results_summary .label { color: #202020; } diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt index 49303a6..576d9f8 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt @@ -223,6 +223,24 @@ $(document).ready(function(){ tagAdded(); return false; }); + + $(".tag_results_add").click(function(){ + var thisid = $(this).attr("id"); + thisid = thisid.replace("tag_add",""); + $(this).hide(); + $("#tagform"+thisid).show(); + $("#newtag"+thisid).focus(); + return false; + }) + + $(".cancel_tag_add").click(function(){ + var thisid = $(this).attr("id"); + thisid = thisid.replace("cancel",""); + $(this).parent().hide(); + $("#tag_add"+thisid).show(); + return false; + }) + [% ELSE %] $("#tagsel_tag").click(function(){ window.location = "/cgi-bin/koha/opac-user.pl"; @@ -503,6 +521,23 @@ $(document).ready(function(){ [% END %] + [% IF ( LibraryThingForLibrariesID ) %]
[% END %] + [% IF ( opacuserlogin ) %][% IF ( TagsEnabled ) %] + [% IF ( TagsShowOnList ) %] + [% IF ( SEARCH_RESULT.TagLoop.size ) %] +
Tags: +
    [% FOREACH TagLoo IN SEARCH_RESULT.TagLoop %]
  • [% TagLoo.term %] ([% TagLoo.weight_total %])
  • + [% END %] +
+ [% END %] + [% IF ( SEARCH_RESULT.TagLoop.size ) %] +
[% END %] + [% END %] + [% END %][% END %] + [% IF ( SEARCH_RESULT.searchhighlightblob ) %]Match: [% SEARCH_RESULT.searchhighlightblob %][% END %] + + + [% IF ( OpacStarRatings == 'all' ) %]
@@ -528,35 +563,8 @@ $(document).ready(function(){
[% END %] - - [% IF ( LibraryThingForLibrariesID ) %]
[% END %] - [% IF ( opacuserlogin ) %][% IF ( TagsEnabled ) %] - [% IF ( TagsShowOnList ) %] - [% IF ( SEARCH_RESULT.TagLoop.size ) %] -
Tags: -
    [% FOREACH TagLoo IN SEARCH_RESULT.TagLoop %]
  • [% TagLoo.term %] ([% TagLoo.weight_total %])
  • - [% END %] -
- [% END %] - [% IF ( TagsInputOnList ) %] - [% IF ( loggedinusername ) %] - New tag: - - - - [% ELSIF ( loop.first ) %]Log in to add tags. - [% END %] - [% END %] - [% IF ( SEARCH_RESULT.TagLoop.size ) %] -
[% END %] - [% END %] - [% END %][% END %] - [% IF ( SEARCH_RESULT.searchhighlightblob ) %]Match: [% SEARCH_RESULT.searchhighlightblob %][% END %] - Actions: - [% IF ( RequestOnOpac ) %] + [% IF ( RequestOnOpac ) %] [% UNLESS ( SEARCH_RESULT.norequests ) %] [% IF ( opacuserlogin ) %] [% IF ( AllowOnShelfHolds ) %] @@ -570,6 +578,17 @@ $(document).ready(function(){ [% END %] [% END %] + [% IF ( TagsInputOnList ) %] + [% IF ( loggedinusername ) %] + Add tag + + Cancel + + [% ELSIF ( loop.first ) %]Log in to add tags. + [% END %] + [% END %] [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( virtualshelves ) %]Save to Lists [% END %][% END %][% END %] diff --git a/koha-tmpl/opac-tmpl/prog/images/tag-small-disabled.png b/koha-tmpl/opac-tmpl/prog/images/tag-small-disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..4976cb023a97e18b400777336cff68ca7c955f7a GIT binary patch literal 317 zcmeAS@N?(olHy`uVBq!ia0vp^+(695!3-or^+GlRDVB6cUq=Rp^(V|(yIunMk|nMY zCBgY=CFO}lsSJ)O`AMk?p1FzXsX?iUDV2pMQ*D5XYyx~jTq`RpzkmP!=g*&S-@et? z*EcseH#IeV{ra`Dv$Lh8rMkNM_wV0-|NgD2s`~fuUq?qrPft%xP0g=gzyAOKzi~$8 zTA(>1B|(0{KrT99@b`Z%2$WCvba4!+xRoRzCYC19#?ZjPba77rp96y-2RB#IN6x03 z42&!yNe>@BPG;Q5$i$&?_So4YN4S;%nQNv5dw6i1VB}EfFsn;TbE`{iU}%y$c>df8 rMIHeMgUzfgEGI61hc)l?8A8*XeEQEtDnm{r-UW|oH~M7 literal 0 HcmV?d00001 diff --git a/koha-tmpl/opac-tmpl/prog/images/tag-small.png b/koha-tmpl/opac-tmpl/prog/images/tag-small.png new file mode 100644 index 0000000000000000000000000000000000000000..7e8b39e51d138604f299d044fdb0ce91b470cdf9 GIT binary patch literal 347 zcmeAS@N?(olHy`uVBq!ia0vp^+(695!3-or^+GlRDVB6cUq=Rp^(V|(yIunMk|nMY zCBgY=CFO}lsSJ)O`AMk?p1FzXsX?iUDV2pMQ*D5X0t0+PTowH5-hKP`;?rNfgh`Ly z|1n6K`r`9n&8Qy3>?VnO$gKliUUczLR;1>1p4)ySMo!I_I zAO0F7PyPM(zfxf1*I)mDiocn*e*hXTT@vIM4CLYf4C*G_ra)zxo-U3d6}OTmOq%p) zQWHZ1LlQ$G8;7()gT#^_Dk?iv59Bm3FmV-jb$4?&-C$s3nItx8$`lc{OF(AWsdJ}K zoKRL}6>t#9{gdP4qZ9-bHEoKV;_ASq(6As!(=d!rvw@*$qa%aD0R~$s&hjJdZAXEY OGI+ZBxvX