diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css index 7ab95e0523..aad1b2c2ab 100644 --- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css +++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css @@ -729,7 +729,7 @@ input.deleteshelf:active { #tagslist li { display : inline; } -a.tag_results_add { +a.tag_add { background-image: url(../../images/tag-small.png); background-position : -1px center; background-repeat : no-repeat; @@ -748,7 +748,6 @@ a.tag_results_add { .tag_results_input { background-color: #EEE; - display: none; margin-left: 1em; padding: 0.3em; } @@ -1450,9 +1449,19 @@ padding-left : .4em; padding-left:20px } -.searchresults .tagstatus { - display: block; - color: #707070; +.tagstatus { + color: #707070; + padding: 0 4px 0 4px; + margin-left: 5px; + border: 1px solid #bcbcbc; + background-color: #ffffcc; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.results_summary.tagstatus { + display: inline; } .results_summary .label { @@ -1463,7 +1472,11 @@ padding-left : .4em; font-weight: normal; } -.actions a { +.actions a.hold, +.actions a.addtocart, +.actions a.addtoshelf, +.actions a.addtolist, +.actions a.tag_add { margin-left : 1em; text-decoration : none; } diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc b/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc index 35d395fbdb..4f0e540879 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc @@ -80,7 +80,8 @@ var MSG_TAGS_ADDED = _("Tags added: "); var MSG_TAGS_DELETED = _("Tags added: "); var MSG_TAGS_ERRORS = _("Errors: "); - var MSG_MULTI_ADD_TAG_FAILED = _("Unable to add one or more tags.");[% END %][% END %] + var MSG_MULTI_ADD_TAG_FAILED = _("Unable to add one or more tags."); + var MSG_NO_TAG_SPECIFIED = _("No tag was specified.");[% END %][% END %] [% IF ( OPACAmazonCoverImages ) %]$(window).load(function() { verify_images(); });[% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/js/tags.js b/koha-tmpl/opac-tmpl/prog/en/js/tags.js index cd85b18733..f28747faa1 100644 --- a/koha-tmpl/opac-tmpl/prog/en/js/tags.js +++ b/koha-tmpl/opac-tmpl/prog/en/js/tags.js @@ -26,12 +26,11 @@ if (typeof(readCookie) == "undefined") { } } KOHA.Tags = { - add_tag_button: function(){ - var mybibnum = $(this).attr("title"); - var mynewtag = "newtag" + mybibnum; + add_tag_button: function(bibnum, tag){ + var mynewtag = "newtag" + bibnum; var mytagid = "#" + mynewtag; var mydata = {CGISESSID: readCookie('CGISESSID')}; // Someday this should be OPACSESSID - mydata[mynewtag] = $(mytagid).val(); // need [bracket] for variable property id + mydata[mynewtag] = tag; // need [bracket] for variable property id var response; // AJAX from server will assign value to response. $.post( "/cgi-bin/koha/opac-tags.pl", @@ -61,20 +60,23 @@ KOHA.Tags = { }, set_tag_status : function(tagid, newstatus) { $(tagid).html(newstatus); - $(tagid).css({display:"inline"}); + $(tagid).show(); }, append_tag_status : function(tagid, newstatus) { $(tagid).append(newstatus); - $(tagid).css({display:"inline"}); + $(tagid).show(); }, + clear_all_tag_status : function() { + $(".tagstatus").empty().hide(); + }, tag_message: { tagsdisabled : function(arg) {return (MSG_TAGS_DISABLED);}, scrubbed_all_bad : function(arg) {return (MSG_TAG_ALL_BAD);}, badparam : function(arg) {return (MSG_ILLEGAL_PARAMETER+" "+arg);}, scrubbed : function(arg) {return (MSG_TAG_SCRUBBED+" "+arg);}, - failed_add_tag : function(arg) {return (MSG_ADD_TAG_FAILED+ " "+arg+" "+MSG_ADD_TAG_FAILED_NOTE);}, - failed_delete : function(arg) {return (MSG_DELETE_TAG_FAILED+ " "+arg+" "+MSG_DELETE_TAG_FAILED_NOTE);}, + failed_add_tag : function(arg) {return (MSG_ADD_TAG_FAILED+ " '"+arg+"'. \n"+MSG_ADD_TAG_FAILED_NOTE);}, + failed_delete : function(arg) {return (MSG_DELETE_TAG_FAILED+ " '"+arg+"'. \n"+MSG_DELETE_TAG_FAILED_NOTE);}, login : function(arg) {return (MSG_LOGIN_REQUIRED);} }, @@ -92,7 +94,7 @@ KOHA.Tags = { mydata, function(data){ eval(data); - $(".tagstatus").empty(); + KOHA.Tags.clear_all_tag_status(); var bibErrors = false; // Display the status for each tagged bib diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tt index 0672027ed2..35aff0f22b 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tt @@ -1,3 +1,5 @@ +[% SET TagsInputEnabled = ( opacuserlogin && TagsEnabled && TagsInputOnList ) %] + [% INCLUDE 'doc-head-open.inc' %] [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your cart [% IF ( print_basket ) %] @@ -22,8 +24,6 @@ -[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %][% END %][% END %][% END %]