From 6b5960cc2a5b69c27a097693f44fcb511f3b53bc Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Sat, 8 Jun 2013 16:16:07 -0400 Subject: [PATCH] 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(''); $('#region-opacuserjs', $('#opac-preview').contents()).replaceWith(''); $('#preview-loading').hide(); }); } $(document).ready(function () { if ($('#pref_OpacNav').size() > 0) { $('#doc3').after(''); $('#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 Signed-off-by: Katrin Fischer 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 --- .../opac-tmpl/ccsr/en/includes/doc-head-close.inc | 4 ++-- koha-tmpl/opac-tmpl/ccsr/en/includes/masthead.inc | 2 -- koha-tmpl/opac-tmpl/ccsr/en/includes/navigation.inc | 6 +++++- koha-tmpl/opac-tmpl/ccsr/en/includes/opac-bottom.inc | 12 ++++++------ .../opac-tmpl/prog/en/includes/doc-head-close.inc | 12 ++++++++---- koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc | 8 +++----- koha-tmpl/opac-tmpl/prog/en/includes/navigation.inc | 5 ++++- koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc | 8 +++----- koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc | 3 --- koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt | 6 +++--- 10 files changed, 34 insertions(+), 32 deletions(-) diff --git a/koha-tmpl/opac-tmpl/ccsr/en/includes/doc-head-close.inc b/koha-tmpl/opac-tmpl/ccsr/en/includes/doc-head-close.inc index 88b3ff851e..af6e886b42 100644 --- a/koha-tmpl/opac-tmpl/ccsr/en/includes/doc-head-close.inc +++ b/koha-tmpl/opac-tmpl/ccsr/en/includes/doc-head-close.inc @@ -27,8 +27,8 @@ [% IF ( bidi ) %] [% END %] -[% IF ( OPACMobileUserCSS ) %][% END %] -[% IF ( OPACUserCSS ) %][% END %] + + [% IF persona %] [% END %] diff --git a/koha-tmpl/opac-tmpl/ccsr/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/ccsr/en/includes/masthead.inc index b85a427852..eba9b78b62 100644 --- a/koha-tmpl/opac-tmpl/ccsr/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/ccsr/en/includes/masthead.inc @@ -239,11 +239,9 @@ You did not specify any search criteria. [% END %]

-[% IF ( OPACNoResultsFound ) %]
[% OPACNoResultsFound %]
-[% END %] [% END %]

[% END %] diff --git a/koha-tmpl/opac-tmpl/ccsr/en/includes/navigation.inc b/koha-tmpl/opac-tmpl/ccsr/en/includes/navigation.inc index fe56488f53..c3c25e6ac9 100644 --- a/koha-tmpl/opac-tmpl/ccsr/en/includes/navigation.inc +++ b/koha-tmpl/opac-tmpl/ccsr/en/includes/navigation.inc @@ -1,5 +1,9 @@ +
+[% OpacNav %] +
[% IF IsPatronPage %] [% INCLUDE usermenu.inc %] [% END %] -[% OpacNav %] +
[% OpacNavBottom %] +
diff --git a/koha-tmpl/opac-tmpl/ccsr/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/ccsr/en/includes/opac-bottom.inc index 4b4e456f7f..3f8bf66449 100644 --- a/koha-tmpl/opac-tmpl/ccsr/en/includes/opac-bottom.inc +++ b/koha-tmpl/opac-tmpl/ccsr/en/includes/opac-bottom.inc @@ -1,8 +1,6 @@ -[% IF ( opaccredits ) %] -
- [% opaccredits %] -
-[% END %] +
+ [% opaccredits %] +
@@ -82,8 +80,10 @@ + @@ -94,8 +94,12 @@ [% IF ( SyndeticsCoverImages ) %]$(window).load(function() { verify_images(); });[% END %] - [% IF ( opacuserjs ) %][% opacuserjs %][% END %] - //]]> + //]]> + + + diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc index 0af9d74996..79eb1a1b10 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc @@ -14,9 +14,9 @@ [% END %] - [% IF ( opacheader ) %] - [% opacheader %] - [% END %] +
+ [% opacheader %] +
[% END %]

[% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/navigation.inc b/koha-tmpl/opac-tmpl/prog/en/includes/navigation.inc index 9cd2c1279b..c3c25e6ac9 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/navigation.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/navigation.inc @@ -1,6 +1,9 @@ +
[% OpacNav %] +
[% IF IsPatronPage %] [% INCLUDE usermenu.inc %] [% END %] +
[% OpacNavBottom %] - +
diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc index 70206732aa..ec17f80a4e 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc @@ -1,8 +1,6 @@ -[% IF ( opaccredits ) %] -
- [% opaccredits %] -
-[% END %] +
+ [% opaccredits %] +
[% IF ( opaclanguagesdisplay || OpacKohaUrl ) %] diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc b/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc index 5486b0c33e..48d39d3339 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc @@ -29,10 +29,7 @@ [% END %] -[% IF ( OPACResultsSidebar ) %]
-[% OPACResultsSidebar %]
[% END %] [% END %] -[% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt index 7403bb05fb..eb1e600464 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt @@ -37,8 +37,8 @@

Quote of the Day

[% daily_quote.text %] ~ [% daily_quote.source %]
[% END %] - [% IF ( OpacMainUserBlock ) %]
[% OpacMainUserBlock %]
[% END %] - [% IF ( OpacMainUserBlockMobile ) %]
[% OpacMainUserBlockMobile %]
[% END %] +
[% OpacMainUserBlock %]
+
[% OpacMainUserBlockMobile %]
@@ -69,7 +69,7 @@ [% END %] [% END %] [% END %] - [% IF ( OpacNavRight ) %]
[% OpacNavRight %]
[% END %] +
[% OpacNavRight %]
[% END %] -- 2.39.5