Koha/koha-tmpl/opac-tmpl/ccsr/en/includes/masthead.inc
Jared Camins-Esakov 6b5960cc2a Bug 10405: add IDs for customizable OPAC regions
This patch adds unique IDs for:
opaccredits
opacheader
OPACMobileUserCSS
OpacNavBottom
OpacUserCSS
opacuserjs

This is an amended patch which includes the changes to CCSR which I
forgot to commit before. The patch does not add a unique ID for
opacheader to CCSR, since opacheader is positioned wrong.

This is most useful for previewing changes you make in the OPAC
preferences using the following javascript in your IntranetUserJS:

function showPreview(url) {
    $('#preview-loading').show();
    document.getElementById('opac-preview').src = url;
    $('#opac-preview').load(function () {
        $('#opac-preview').show();
        $('#region-opaccredits', $('#opac-preview').contents()).html($('#pref_opaccredits').val());
        $('#region-opacheader', $('#opac-preview').contents()).html($('#pref_opacheader').val());
        $('#opacmainuserblock', $('#opac-preview').contents()).html($('#pref_OpacMainUserBlock').val());
        $('#opacmainuserblockmobile', $('#opac-preview').contents()).html($('#pref_OpacMainUserBlockMobile').val());
        $('#region-opacnav', $('#opac-preview').contents()).html($('#pref_OpacNav').val());
        $('#region-opacnavbottom', $('#opac-preview').contents()).html($('#pref_OpacNavBottom').val());
        $('#opacrightsidebar', $('#opac-preview').contents()).html($('#pref_OpacNavRight').val());
        $('#noresultsfound', $('#opac-preview').contents()).html($('#pref_OPACNoResultsFound').val());
        $('#opacresultssidebar', $('#opac-preview').contents()).html($('#pref_OPACResultsSidebar').val());
        $('#region-opacusercss', $('#opac-preview').contents()).replaceWith('<style id="region-opacusercss" type="text/css">' + $('#pref_OPACUserCSS').val() + '</style>');

        $('#region-opacuserjs', $('#opac-preview').contents()).replaceWith('<script id="region-opacuserjs" type="text/javascript">' + $('#pref_opacuserjs').val() + '</script>');
        $('#preview-loading').hide();
    });
}

$(document).ready(function () {
    if ($('#pref_OpacNav').size() > 0) {
        $('#doc3').after('<div class="navbar navbar-fixed-bottom" style="z-index: 10000;"><div id="preview-pane" class="navbar-inner"><h4 style="float: left; margin-right: 2em;">Preview changes</h4><div class="btn-group" data-toggle="buttons-radio"><button type="button" class="btn" id="preview-main">Main page</button><button type="button" class="btn" id="preview-results">Results</button><button type="button" class="btn" id="preview-details">Details</button><button type="button" class="btn active" id="preview-hide">Hide</button></div><img id="preview-loading" style="display: none;" src="/intranet-tmpl/prog/img/loading-small.gif"><iframe id="opac-preview" style="height: 20em; width: 100%; display: none;"></iframe></div></div>');

        $('#preview-main').click(function () {
            showPreview('/cgi-bin/koha/opac/opac-main.pl');
        });
        $('#preview-results').click(function () {
            showPreview('/cgi-bin/koha/opac/opac-search.pl?idx=&q=pqf%3D%40attr+1%3D_ALLRECORDS+%40attr+2%3D103+%22%22&branch_group_limit=');
        });
        $('#preview-details').click(function () {
            showPreview('/cgi-bin/koha/opac/opac-detail.pl?biblionumber=1');
        });
        $('#preview-hide').click(function () {
            $('#opac-preview').hide();
            $('#preview-loading').hide();
        });
    }
});

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>

Note: The provided JavaScript didn't work for me and resulted in an
error in Firebug. Ater talking to Jared it seems like there is more needed
than the bit of Javascript so make this work, but it might be a good
starting point, so I am leaving it in the commit message.

Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-08-14 21:55:04 +00:00

249 lines
10 KiB
HTML

<div id="header-wrapper">
<div id="opac-custom-header">
[% IF ( opacheader ) %]
[% opacheader %]
[% END %]
</div>
<div id="opac-main-search" class="yui-g">
<a class="logo" href="/cgi-bin/koha/opac-main.pl">
[% UNLESS ( opacsmallimage ) %]
[% UNLESS ( LibraryName ) %]
<img src="/opac-tmpl/ccsr/images/logo-koha.png" alt="Koha Online Catalog" />
[% ELSE %]
<img src="/opac-tmpl/ccsr/images/logo-koha.png" alt="[% LibraryName %] Online Catalog" />
[% END %]
[% ELSE %]
[% UNLESS ( LibraryName ) %]
<img src="[% opacsmallimage %]" alt="Koha Online Catalog" />
[% ELSE %]
<img src="[% opacsmallimage %]" alt="[% LibraryName %] Online Catalog" />
[% END %]
[% END %]
</a>
<div id="fluid">
[% IF ( OpacPublic ) %]
<div id="fluid-offset">
[% UNLESS ( advsearch ) %]
[% IF Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 %]
[% IF ( OpacShowFiltersPulldownMobile and not OpacShowLibrariesPulldownMobile ) or ( not OpacShowFiltersPulldownMobile and OpacShowLibrariesPulldownMobile ) %]
<form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="multi-libraries single-field-mobile">
[% ELSE %]
<form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="multi-libraries">
[% END %]
[% ELSE %]
<form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="single-library">
[% END %]
<label for="masthead_search" class="left"> Search
[% UNLESS ( OpacAddMastheadLibraryPulldown ) %]
[% IF ( mylibraryfirst ) %] (in [% mylibraryfirst %] only)[% END %]
[% END %]
</label>
[% IF ( OpacShowFiltersPulldownMobile ) %]
<div id="filters">
[% ELSE %]
<div id="filters" class="mobile-hidden">
[% END %]
<select name="idx" id="masthead_search" class="left">
[% IF ( ms_kw ) %]
<option selected="selected" value="">Library catalog</option>
[% ELSE %]
<option value="">Library catalog</option>
[% END %]
[% IF ( ms_ti ) %]
<option selected="selected" value="ti">Title</option>
[% ELSE %]
<option value="ti">Title</option>
[% END %]
[% IF ( ms_au ) %]
<option selected="selected" value="au">Author</option>
[% ELSE %]
<option value="au">Author</option>
[% END %]
[% IF ( ms_su ) %]
<option selected="selected" value="su">Subject</option>
[% ELSE %]
<option value="su">Subject</option>
[% END %]
[% IF ( ms_nb ) %]
<option selected="selected" value="nb">ISBN</option>
[% ELSE %]
<option value="nb">ISBN</option>
[% END %]
[% IF ( ms_se ) %]
<option selected="selected" value="se">Series</option>
[% ELSE %]
<option value="se">Series</option>
[% END %]
[% IF ( ms_callnum ) %]
<option selected="selected" value="callnum">Call number</option>
[% ELSE %]
<option value="callnum">Call number</option>
[% END %]</select>
</div>
<div class="input-wrapper">
[% IF ( ms_value ) %]
<input type="text" id = "transl1" name="q" value="[% ms_value |html %]" class="left" style="width: 35%; font-size: 111%;"/><div id="translControl"></div>
[% ELSE %]
<input type="text" id = "transl1" name="q" class="left" style="width: 35%; font-size: 111%;"/><div id="translControl"></div>
[% END %]
</div>
[% IF Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 %]
[% IF ( OpacShowLibrariesPulldownMobile ) %]
<div id="libraries">
[% ELSE %]
<div id="libraries" class="mobile-hidden">
[% END %]
<select name="branch_group_limit" id="select_library" class="left">
<option value="">All libraries</option>
<optgroup label="Libraries">
[% FOREACH BranchesLoo IN BranchesLoop %]
[% IF ( BranchesLoo.selected ) %]<option selected="selected" value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>
[% ELSE %]<option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>[% END %]
[% END %]
</optgroup>
[% IF BranchCategoriesLoop %]
<optgroup label="Groups">
[% FOREACH bc IN BranchCategoriesLoop %]
[% IF ( bc.selected ) %]
<option selected="selected" value="multibranchlimit-[% bc.categorycode %]">[% bc.categoryname %]</option>
[% ELSE %]
<option value="multibranchlimit-[% bc.categorycode %]">[% bc.categoryname %]</option>
[% END %]
[% END %]
</optgroup>
[% END %]
</select>
</div>
[% ELSE %]
[% IF ( opac_limit_override ) %]
[% IF ( opac_search_limit ) %]
<input name="limit" value="[% opac_search_limit %]" type="hidden" />
[% END %]
[% ELSE %]
[% IF ( mylibraryfirst ) %]
<input name="limit" value="branch:[% mylibraryfirst %]" type="hidden" />
[% END %]
[% END %]
[% END %]
<input type="submit" value="Go" id="searchsubmit" class="left" />
<div class="clear"></div>
</form>
[% ELSE %] <!--advsearch -->
[% IF Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 %]
[% IF ( OpacShowFiltersPulldownMobile and not OpacShowLibrariesPulldownMobile ) or ( not OpacShowFiltersPulldownMobile and OpacShowLibrariesPulldownMobile ) %]
<form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="multi-libraries single-field-mobile">
[% ELSE %]
<form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="multi-libraries">
[% END %]
[% ELSE %]
<form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="single-library">
[% END %]
<label for="masthead_search" class="left"> Search
[% UNLESS ( OpacAddMastheadLibraryPulldown ) %]
[% IF ( mylibraryfirst ) %] (in [% mylibraryfirst %] only)[% END %]
[% END %]
</label>
[% IF ( OpacShowFiltersPulldownMobile ) %]
<div id="filters" class="transparent">
[% ELSE %]
<div id="filters" class="transparent mobile-hidden">
[% END %]
<select name="idx" id="masthead_search" class="left" disabled="disabled">
<option selected="selected" value="">Library Catalog</option>
</select>
</div>
<div class="input-wrapper">
<input type="text" id = "transl1" name="q" class="left transparent" style="width: 35%; font-size: 111%;" disabled="disabled"/><div id="translControl"></div>
</div>
[% IF Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 %]
[% IF ( OpacShowLibrariesPulldownMobile ) %]
<div id="libraries">
[% ELSE %]
<div id="libraries" class="mobile-hidden">
[% END %]
<select name="limit" id="select_library" class="left transparent">
<option value="">All Libraries</option>
</select>
</div>
[% END %]
<input type="submit" value="Go" id="searchsubmit" class="left transparent" disabled="disabled" />
<div class="clear"></div>
</form>
[% END %]
<div id="moresearches">
<a href="/cgi-bin/koha/opac-search.pl">Advanced search</a>
[% IF Koha.Preference( 'UseCourseReserves' ) == 1 %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a>[% END %]
[% IF ( OpacBrowser ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-browser.pl">Browse by hierarchy</a>[% END %]
[% IF ( OpacAuthorities ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a>[% END %]
[% IF ( opacuserlogin && ( Koha.Preference( 'reviewson' ) == 1 ) && ( Koha.Preference( 'OpacShowRecentComments' ) == 1 ) ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-showreviews.pl">Recent comments</a>[% END %]
[% IF ( TagsEnabled ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-tags.pl">Tag cloud</a>[% END %]
[% IF ( OpacCloud ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-tags_subject.pl">Subject cloud</a>[% END %]
[% IF ( OpacTopissue ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-topissues.pl">Most popular</a>[% END %]
[% IF ( suggestion ) %]
[% IF ( AnonSuggestions ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-suggestions.pl">Purchase suggestions</a>
[% ELSIF ( OPACViewOthersSuggestions ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-suggestions.pl">Purchase suggestions</a>
[% END %]
[% END %]
</div>
</div>
</div>
<div id="libraryname">
<h1></h1>
</div>
[% END %] <!-- OpacPublic -->
</div>
</div>
<div id="container">
<div id="ctn_lt">
<div id="ctn_rt">
<div id="ctn_lb">
<div id="ctn_rb">
<div id="breadcrumbs" class="yui-g">
<p><a href="/cgi-bin/koha/opac-main.pl" title="Home">Home</a>
[% IF ( searchdesc ) %]<span class="rsaquo"> &rsaquo; </span><a href="/cgi-bin/koha/opac-search.pl" title="Search">Search</a><span class="rsaquo"> &rsaquo; </span>
[% IF ( total ) %]<strong>Your search returned [% total |html %] results.</strong>
[% IF ( related ) %] (related searches: [% FOREACH relate IN related %][% relate.related_search %][% END %]). [% END %]
<a href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;count=[% countrss |html %]&amp;sort_by=acqdate_dsc&amp;format=rss2" class="rsssearchlink">
<img src="/opac-tmpl/ccsr/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" border="0" class="rsssearchicon"/></a>
[% ELSE %]
<strong>No results found!</strong>
<p>
[% IF ( searchdesc ) %]
No results found for that in [% LibraryName %] catalog. <a href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;format=rss2" class="rsssearchlink"><img src="/opac-tmpl/ccsr/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" border="0" class="rsssearchicon"/></a>
[% ELSE %]
You did not specify any search criteria.
[% END %]
</p>
<div id="noresultsfound">
[% OPACNoResultsFound %]
</div>
</div>
[% END %]</p>[% END %]</div>
<div class="ctn_in">