Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/maintenance.tt
Owen Leonard b7f0b58ee8
Bug 23798: Convert OpacMaintenanceNotice system preference to additional contents
This patch moves the OpacMaintenanceNotice system preference into HTML
customizations, making it possible to have language-specific content.

The patch modifies the OPAC maintenance page template so that the
language selection menu can be shown correctly according to the
OpacLangSelectorMode preference.

To test you should have some content in the OpacMaintenanceNotice
system preference before applying the patch. Apply the patch and run the
database update process.

- In the staff client, go to Tools -> HTML customizations and verify
  that the content from OpacMaintenanceNotice is now stored there.
- The HTML customization entry form should offer OpacMaintenanceNotice
  as a choice under "Display location."
- Update and reinstall active translations (for instance fr-FR):
  - perl misc/translator/translate update fr-FR
  - perl misc/translator/translate install fr-FR
- Enable the translation if necessary under Administration -> System
  preferences -> language.
- Enable the "opaclanguagesdisplay" preference if necessary.
- Enable the "OpacMaintenance" system preference.
- Edit the OpacMaintenanceNotice HTML customization and add unique
  content to the "fr-FR" tab.

- Try to view any page in the OPAC. You should see the content you
  added to the OpacMaintenanceNotice HTML customization.
- Switch to your updated translation. The page should redisplay with
  your translated content.
- Go to Administration -> System preferences and search for
  "OpacMaintenanceNotice." The search should return no
  results.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-08 17:41:27 -03:00

89 lines
3.6 KiB
Text

[% USE raw %]
[% USE Koha %]
[% USE AdditionalContents %]
[% INCLUDE 'doc-head-open.inc' %]
[% SET OpacHeader = AdditionalContents.get( location => "opacheader", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
[% SET OpacMaintenanceNotice = AdditionalContents.get( location => "OpacMaintenanceNotice", lang => lang, library => branchcode || default_branch ) %]
[% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %]
[% SET opaclanguagedisplay = Koha.Preference('opaclanguagedisplay') %]
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
[% INCLUDE 'doc-head-close.inc' %]
[% BLOCK cssinclude %]
<style>
.navbar-expand {
justify-content: space-between;
}
#opac-maintenance-message {
background:none repeat scroll 0 0 #FFFFFF;
border:1px solid #A2A2A2;
border-radius: 8px 8px 8px 8px;
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.2);
margin:4em auto;
padding:1.5em;
position:relative;
right:auto;
top:auto;
width:50%;
}
.langlabel {
display: inline;
}
</style>
[% END %]
</head>
<body id="opac_maintenance" class="opac">
<div id="wrapper">
<div id="header-region" class="noprint">
<nav class="navbar navbar-expand">
<div id="logo">
<a class="navbar-brand" href="/cgi-bin/koha/opac-main.pl">
[% IF ( LibraryNameTitle ) %]
[% LibraryNameTitle | html %]
[% ELSE %]
Koha online
[% END %]
</a>
</div>
[% IF ( Koha.Preference( 'opaclanguagesdisplay' ) ) %]
[% INCLUDE 'masthead-langmenu.inc' %]
[% END %]
</nav>
</div>
[% IF ( OpacHeader ) %]
<div class="container-fluid">
<div class="row">
<div class="col">
[% PROCESS koha_news_block news => OpacHeader %]
</div>
</div>
</div>
[% END %]
<div class="main">
<div class="container-fluid">
<div class="row">
<div class="col">
<div id="opac-maintenance-message" class="maincontent">
[% IF ( OpacMaintenanceNotice ) %]
[% PROCESS koha_news_block news => OpacMaintenanceNotice %]
[% ELSE %]
<h1>System maintenance</h1>
<p>
<span>The [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog is offline for system maintenance. We'll be back soon!</span>
[% IF ( Koha.Preference( 'ReplytoDefault' ) ) %]
If you have any questions, please contact the <a href="mailto:[% Koha.Preference( 'ReplytoDefault' ) | $raw %]">site administrator</a>
[% ELSIF ( Koha.Preference( 'KohaAdminEmailAddress' ) ) %]
If you have any questions, please contact the <a href="mailto:[% Koha.Preference( 'KohaAdminEmailAddress' ) | $raw %]">site administrator</a>
[% END %]
</p>
[% END %]
</div>
</div>
</div>
</div>
</div>
[% INCLUDE 'opac-bottom.inc' %]
[% BLOCK jsinclude %][% END %]