Bugzilla – Attachment 11583 Details for
Bug 8597
New theme for the OPAC with a mobile view
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Add system preferences to configure the mobile view.
0001-Add-system-preferences-to-configure-the-mobile-view.patch (text/plain), 16.29 KB, created by
Frédérick Capovilla
on 2012-08-13 17:34:32 UTC
(
hide
)
Description:
Add system preferences to configure the mobile view.
Filename:
MIME Type:
Creator:
Frédérick Capovilla
Created:
2012-08-13 17:34:32 UTC
Size:
16.29 KB
patch
obsolete
>From b39f8a66e2af57e20465bcd0e6660b1713ab2596 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Fr=C3=A9d=C3=A9rick?= <frederick.capovilla@libeo.com> >Date: Mon, 13 Aug 2012 12:29:35 -0400 >Subject: [PATCH] Add system preferences to configure the mobile view. > >OpacMainUserBlockMobile >OPACMobileUserCSS >OpacShowFiltersPulldownMobile >OpacShowLibrariesPulldownMobile >--- > C4/Auth.pm | 4 ++ > installer/data/mysql/sysprefs.sql | 4 ++ > installer/data/mysql/updatedatabase.pl | 10 ++++ > .../prog/en/modules/admin/preferences/opac.pref | 22 ++++++++ > koha-tmpl/opac-tmpl/ccsr/en/css/mobile.css | 30 ++++++----- > .../opac-tmpl/ccsr/en/includes/doc-head-close.inc | 1 + > koha-tmpl/opac-tmpl/ccsr/en/includes/masthead.inc | 51 ++++++++++++++++---- > koha-tmpl/opac-tmpl/prog/en/css/opac.css | 4 ++ > .../opac-tmpl/prog/en/includes/doc-head-close.inc | 1 + > koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt | 1 + > 10 files changed, 105 insertions(+), 23 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index f9b15ef..d06dbde 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -409,6 +409,7 @@ sub get_template_and_user { > OpacShowRecentComments => C4::Context->preference("OpacShowRecentComments"), > OPACURLOpenInNewWindow => "" . C4::Context->preference("OPACURLOpenInNewWindow"), > OPACUserCSS => "". C4::Context->preference("OPACUserCSS"), >+ OPACMobileUserCSS => "". C4::Context->preference("OPACMobileUserCSS"), > OPACViewOthersSuggestions => "" . C4::Context->preference("OPACViewOthersSuggestions"), > OpacAuthorities => C4::Context->preference("OpacAuthorities"), > OPACBaseURL => ($in->{'query'}->https() ? "https://" : "http://") . $ENV{'SERVER_NAME'} . >@@ -420,6 +421,9 @@ sub get_template_and_user { > OpacCloud => C4::Context->preference("OpacCloud"), > OpacKohaUrl => C4::Context->preference("OpacKohaUrl"), > OpacMainUserBlock => "" . C4::Context->preference("OpacMainUserBlock"), >+ OpacMainUserBlockMobile => "" . C4::Context->preference("OpacMainUserBlockMobile"), >+ OpacShowFiltersPulldownMobile => C4::Context->preference("OpacShowFiltersPulldownMobile"), >+ OpacShowLibrariesPulldownMobile => C4::Context->preference("OpacShowLibrariesPulldownMobile"), > OpacNav => "" . C4::Context->preference("OpacNav"), > OpacNavRight => "" . C4::Context->preference("OpacNavRight"), > OpacNavBottom => "" . C4::Context->preference("OpacNavBottom"), >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index f5a18b2..fc3f88a 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -374,3 +374,7 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( > INSERT INTO systempreferences (variable,value,explanation,type) VALUES('EnableBorrowerFiles','0','If enabled, allows librarians to upload and attach arbitrary files to a borrower record.','YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UpdateTotalIssuesOnCirc','0','Whether to update the totalissues field in the biblio on each circ.',NULL,'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IntranetSlipPrinterJS','','Use this JavaScript for printing slips. Define at least function printThenClose(). For use e.g. with Firefox PlugIn jsPrintSetup, see http://jsprintsetup.mozdev.org/','','Free'); >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACMobileUserCSS','','Include the following CSS for the mobile view on all pages in the OPAC:',NULL,'free'); >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacMainUserBlockMobile','','Show the following HTML in its own column on the main page of the OPAC (mobile version):',NULL,'free'); >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowLibrariesPulldownMobile','1','Show the libraries pulldown on the mobile version of the OPAC.',NULL,'YesNo'); >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowFiltersPulldownMobile','1','Show the search filters pulldown on the mobile version of the OPAC.',NULL,'YesNo'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index ed0c674..304320a 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -5635,6 +5635,16 @@ if(C4::Context->preference("Version") < TransformToNum($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion ="XXX"; >+if(C4::Context->preference("Version") < TransformToNum($DBversion) ) { >+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACMobileUserCSS','','Include the following CSS for the mobile view on all pages in the OPAC:',NULL,'free');"); >+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacMainUserBlockMobile','','Show the following HTML in its own column on the main page of the OPAC (mobile version):',NULL,'free');"); >+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowLibrariesPulldownMobile','1','Show the libraries pulldown on the mobile version of the OPAC.',NULL,'YesNo');"); >+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowFiltersPulldownMobile','1','Show the search filters pulldown on the mobile version of the OPAC.',NULL,'YesNo');"); >+ print "Upgrade to $DBversion done (Add OPACMobileUserCSS, OpacMainUserBlockMobile, OpacShowLibrariesPulldownMobile and OpacShowFiltersPulldownMobile sysprefs)\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index 0fe79d4..6a2784d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -163,11 +163,33 @@ OPAC: > type: textarea > class: code > - >+ - "Include the following CSS for the mobile view on all pages in the OPAC:" >+ - pref: OPACMobileUserCSS >+ type: textarea >+ class: code >+ - > - "Show the following HTML in its own column on the main page of the OPAC:" > - pref: OpacMainUserBlock > type: textarea > class: code > - >+ - "Show the following HTML in its own column on the main page of the OPAC (mobile version):" >+ - pref: OpacMainUserBlockMobile >+ type: textarea >+ class: code >+ - >+ - pref: OpacShowLibrariesPulldownMobile >+ choices: >+ yes: Show >+ no: "Don't show" >+ - the libraries pulldown on the mobile version of the OPAC. >+ - >+ - pref: OpacShowFiltersPulldownMobile >+ choices: >+ yes: Show >+ no: "Don't show" >+ - the search filters pulldown on the mobile version of the OPAC. >+ - > - "Show the following HTML on the left hand column of the main page and patron account on the OPAC (generally navigation links):" > - pref: OpacNav > type: textarea >diff --git a/koha-tmpl/opac-tmpl/ccsr/en/css/mobile.css b/koha-tmpl/opac-tmpl/ccsr/en/css/mobile.css >index 7917e77..58da8bd 100644 >--- a/koha-tmpl/opac-tmpl/ccsr/en/css/mobile.css >+++ b/koha-tmpl/opac-tmpl/ccsr/en/css/mobile.css >@@ -5,9 +5,11 @@ > > /* Hidden elements */ > >+.mobile-hidden, > body#opac-main #login, > body#opac-main #login~div, > body#opac-main #opacnav, >+body#opac-main #opacmainuserblock, > body#opac-main #news, > body#results #facetcontainer, > body#opac-detail #ulactioncontainer>:not(#action), >@@ -99,14 +101,15 @@ body#results #breadcrumbs>*{ > > /* Main */ > >-body#opac-main #opacmainuserblock { >- padding: 0 >-} >- > body#opac-main #container #ctn_lt{ > padding: 15px; > } > >+body#opac-main #opacmainuserblockmobile { >+ display: block; >+} >+ >+ > > /* Results */ > >@@ -257,30 +260,29 @@ form#searchform { > padding-top: 50px; > } > >-form.single-library #filters .jqTransformSelectWrapper { >+form#searchform #filters .jqTransformSelectWrapper, >+form#searchform #libraries .jqTransformSelectWrapper { > position: relative; >- width: 100% !important; > left: 0; > top: 0; > border-radius: 3px; > } > > form.multi-libraries #filters .jqTransformSelectWrapper{ >- position: relative; > width: 49% !important; > float: left; >- top: 0px; >- left: 0px; >- border-radius: 3px; > } > > form.multi-libraries #libraries .jqTransformSelectWrapper{ >- position: relative; > width: 49% !important; > float: right; >- top: 0px; >- left: 0px; >- border-radius: 3px; >+} >+ >+form.single-library #filters .jqTransformSelectWrapper, >+form.multi-libraries.single-field-mobile #filters .jqTransformSelectWrapper, >+form.multi-libraries.single-field-mobile #libraries .jqTransformSelectWrapper{ >+ width: 100% !important; >+ float:left; > } > > form.multi-libraries .input-wrapper{ >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 ce5b68c..07a23b8 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 >@@ -22,6 +22,7 @@ > <link rel="stylesheet" type="text/css" media="print" href="[% themelang %]/css/print.css" /> > <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no"> > <link rel="stylesheet" type="text/css" media="screen and (max-width:700px)" href="[% themelang %]/css/mobile.css" /> >+[% IF ( OPACMobileUserCSS ) %]<style type="text/css" media="screen and (max-width:700px)">[% OPACMobileUserCSS %]</style>[% END %] > [% IF ( OPACUserCSS ) %]<style type="text/css">[% OPACUserCSS %]</style>[% END %] > <!-- yui js --> > <script type="text/javascript" src="[% yuipath %]/utilities/utilities.js"></script> >diff --git a/koha-tmpl/opac-tmpl/ccsr/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/ccsr/en/includes/masthead.inc >index 2c5e571..890ecde 100644 >--- a/koha-tmpl/opac-tmpl/ccsr/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/ccsr/en/includes/masthead.inc >@@ -84,14 +84,28 @@ > > [% IF ( OpacPublic ) %] > <div id="fluid-offset"> >-[% UNLESS ( advsearch ) %]<form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="[% IF ( OpacAddMastheadLibraryPulldown ) %]multi-libraries[% ELSE %]single-library[% END %]"> >- <label for="masthead_search" class="left"> Search >+ >+ >+[% UNLESS ( advsearch ) %] >+[% IF ( OpacAddMastheadLibraryPulldown ) %] >+ [% 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> >- >- <div id="filters"> >+ [% 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> >@@ -139,7 +153,11 @@ > </div> > > [% IF ( OpacAddMastheadLibraryPulldown ) %] >- <div id="libraries"> >+ [% IF ( OpacShowLibrariesPulldownMobile ) %] >+ <div id="libraries"> >+ [% ELSE %] >+ <div id="libraries" class="mobile-hidden"> >+ [% END %] > <select name="limit" id="select_library" class="left"> > <option value="">All libraries</option> > [% FOREACH BranchesLoo IN BranchesLoop %] >@@ -168,14 +186,25 @@ > > </form> > [% ELSE %] <!--advsearch --> >-<form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="[% IF ( OpacAddMastheadLibraryPulldown ) %]multi-libraries[% ELSE %]single-library[% END %]"> >+ [% IF ( OpacAddMastheadLibraryPulldown ) %] >+ [% 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> >- >- <div id="filters" class="transparent"> >+ [% 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> >@@ -186,7 +215,11 @@ > </div> > > [% IF ( OpacAddMastheadLibraryPulldown ) %] >- <div id="libraries"> >+ [% 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> >diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css >index aeb209c..46c7bd9 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css >+++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css >@@ -2620,6 +2620,10 @@ ul.ui-tabs-nav li { > box-shadow: 1px 1px 3px 0 #666; > } > >+body#opac-main #opacmainuserblockmobile { >+ display: none; >+} >+ > .mobile_only { > display : 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 3ce49ce..d8c9802 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 >@@ -20,6 +20,7 @@ > <link rel="stylesheet" type="text/css" href="[% themelang %]/css/[% opac_css_override %]" /> > [% END %] > <link rel="stylesheet" type="text/css" media="print" href="[% themelang %]/css/print.css" /> >+[% IF ( OPACMobileUserCSS ) %]<style type="text/css" media="screen and (max-width:700px)">[% OPACMobileUserCSS %]</style>[% END %] > [% IF ( OPACUserCSS ) %]<style type="text/css">[% OPACUserCSS %]</style>[% END %] > <!-- yui js --> > <script type="text/javascript" src="[% yuipath %]/utilities/utilities.js"></script> >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 d291b2a..e505014 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt >@@ -37,6 +37,7 @@ > [% END %] > > [% IF ( OpacMainUserBlock ) %]<div id="opacmainuserblock" class="container">[% OpacMainUserBlock %]</div>[% END %] >+ [% IF ( OpacMainUserBlockMobile ) %]<div id="opacmainuserblockmobile" class="container">[% OpacMainUserBlockMobile %]</div>[% END %] > > </div> > >-- >1.7.2.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8597
:
11448
|
11449
|
11450
|
11456
|
11457
|
11458
|
11515
|
11565
|
11566
|
11567
|
11568
|
11583
|
11853
|
11854
|
11855
|
11856
|
11857
|
11858
|
11859
|
11902
|
11974
|
11975
|
12060
|
12061
|
12063
|
12064
|
12065
|
12066
|
12067
|
12174
|
12651
|
12652