diff --git a/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css b/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css index 3c6974fb5c..634f2b2af6 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css +++ b/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css @@ -368,6 +368,18 @@ tbody tr.active td { background-color: #FFAAAA !important; } + .show-errors { + background: #FFEC8C none; + border-color: #E0C726; + color: #000; + display: none; + text-shadow: none; +} + +.floating .show-errors { + display: inline-block; +} + @media (min-width: 768px) { li.subfield_line label { width: 20em; 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 a10fb9ef12..8f2c12450c 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -1770,6 +1770,7 @@ i { padding: .5em; text-align: center; width: 65%; + max-width: 600px; a { &.approve { @@ -1872,6 +1873,17 @@ i { strong { color: #900; } + + &.list { + text-align: left; + + h2, + h3, + h4 { + margin: 1em 0; + text-align: left; + } + } } } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt index 2887123012..fb1652e859 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -155,14 +155,24 @@ $(".tag_anchor").on("click", function(e){ e.preventDefault(); - var toolbar_height = $("#toolbar").outerHeight(); $(".tag_anchor").removeClass("selected"); $(this).addClass("selected"); var link = this.href; var linkid = link.substring( link.indexOf("#") + 1 ); - var dest = $("#" + linkid ); - var yoffset = dest.offset(); - window.scrollTo( 0, yoffset.top - toolbar_height - 20 ); + window.scrollTo( 0, getScrollto( linkid, "toolbar" ) ); + }); + + $("body").on("click", ".linkfield", function(e){ + e.preventDefault(); + var tab = $(this).data("tab"); + var field = $(this).data("field"); + var tablink = $("a[data-tabid='" + tab + "']" ); + selectTab( tablink ); + window.scrollTo( 0, getScrollto( field, "toolbar" ) ); + }); + + $("body").on("click", ".show-errors", function(e){ + document.getElementById("form-errors").scrollIntoView(); }); }); @@ -176,6 +186,26 @@ $(".tag_anchors_" + tabid ).addClass("tab_selected").show(); } + /** + * Returns a roughly ideal position to scroll an element into view + * @param {string} target - The HTML id of the element to scroll into view + * @param {string} elemid - The HTML id of the element which might obscure + * the view of the target element e.g. a floating toolbar + * @return {number} - The y-coordinate to pass to window.scrollTo() + */ + function getScrollto( target, elemid ){ + var dest = $("#" + target ); + var yoffset = dest.offset(); + + if( elemid != "" ){ + var element = $("#" + elemid ); + var elem_height = element.outerHeight(); + } else { + elem_height = 0; + } + return yoffset.top - elem_height - 20; + } + function redirect(dest){ $("#redirect").attr("value",dest); return Check(); @@ -185,7 +215,7 @@ var onOption = function () { return Check(); } -[% END %] + [% END %] /** * this function append button for create new authority if not found @@ -512,14 +542,14 @@ function PopupMARCFieldDoc(field) { var label = new Array(); var flag=0; var tabflag= new Array(); - var StrAlert = ""; + var StrAlert = "