Many pages can have alerts that get their style from a variable passed
by the script, e.g.:
push @messages, { type => 'message', code => 'success_on_update' };
Rather than change these to match Bootstrap 5 styles, I propose we add a
copy of the existing Bootstrap style using the existing vocabulary:
message -> info
alert -> warning
error -> danger
To test, apply the patch and rebuild CSS for the staff interface and
OPAC: (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface)
- Clear your browser cache if necessary.
- Navigate to pages which have been updated by this patch. Many pages
will implement this kind of alert after saving an edit, especially
administration pages, e.g.
Administration -> Libraries -> Edit library -> Save.
- You can test the various alert classes by adding this HTML to
IntranetMainUserBlock and OpacMainUserBlock and viewing the staff
interface and OPAC main pages.:
<div class="alert alert-danger">A standard Bootstrap danger alert with
<a href="#" class="alert-link">an example link</a>.</div>
<div class="alert alert-warning">A standard Bootstrap warning alert with
<a href="#" class="alert-link">an example link</a>.</div>
<div class="alert alert-info">A standard Bootstrap info alert with
<a href="#" class="alert-link">an example link</a>.</div>
<div class="alert alert-error">A Koha error alert with
<a href="#" class="alert-link">an example link</a>.</div>
<div class="alert alert-alert">A Koha alert alert with
<a href="#" class="alert-link">an example link</a>.</div>
<div class="alert alert-message">A Koha info alert with
<a href="#" class="alert-link">an example link</a>.</div>
Sponsored-by: Athens County Public Libraries
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch updates the OPAC and staff interface to use Bootstrap 5.
Bootstrap CSS assets are now pulled from node_modules and compiled into
staff-global.css and opac.css at build time. This update lays the
foundations of some other chnages, especially the addition of a dark
mode in the future.
Hundreds of templates have been updated, mostly with updates to the grid
markup. Most of the responsive behavior is still the same with the
exception of improved flexibility of headers and footers in both the
OPAC and staff interface.
The other most common change is to add a new "namespace" to data
attributes used by Bootstrap, e.g. "data-bs-target" or "data-bs-toggle".
Modal markup has also been updated everywhere. Other common changes:
dropdown button markup, alert markup (we now use Bootstrap's "alert
alert-warning" and "alert alert-info" instead of our old "dialog alert"
and "dialog info").
Bootstrap 5 now uses CSS variables which we can override in our own
'_variables.scss' (in both the OPAC and staff) to accomplish a lot of
the style overrides which we previously put in staff-global.scss.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Test plan:
1) Update some data in your cities table, sample for one send:
"UPDATE cities SET city_state=NULL WHERE cityid=<id>"
2) Go on "/cgi-bin/koha/admin/cities.pl" and wait a entire life :)
3) Apply this patch
4) Rebuild your po files if needed
5) Reload the same page and now you get normally the datatable
Sponsored by: BibLibre
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch makes the 'Check the logs..' messages more consistent across
the codebase.
To test:
1. Run:
$ git grep -e 'Check the logs\"' -e 'Check the logs<' -e 'Check the logs\.'
=> FAIL: Several forms show up
2. Apply this patch
3. Repeat 1
=> SUCCESS: Empty result.
4. Run:
$ git grep -e 'Check the logs for details\.'
=> SUCCESS: Consisten results show
5. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch updates the cities administration page so that page title,
breadcrumb navigation, and headings are consistent with each other and
with other parts of Koha.
To test, apply the patch and go to Administration -> Cities and towns.
Check each variation of the page to confirm that page title, breadcrumb
navigation, and heading are correct.
- Main page (listing cities)
- New city
- Edit city
- Delete city
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch updates administration templates so that title tags can be
more easily translated.
To test, apply the patch and confirm that the following
Administration pages have the correct title tags:
- Libraries
- Library groups
- Item types
- Authorized values
- Patron categories
- Circulation and fines rules
- Patron attribute types
- Library transfer limits
- Library transfer limits advanced editor
- Transport cost matrix
- Item circulation alerts
- Cities and towns
- Curbside pickup
- Patron restriction types
- Debit types
- Credit types
- Cash registers
- Manage plugins
- Manage jobs
- MARC bibliographic framework
- Koha to MARC mapping
- MARC Bibliographic framework test
- Authority types
- Classification configuration
- Record matching rules
- Record overlay rules
- OAI sets configuration
- Item search fields
- Search engine configuration
- Currencies and exchange rates
- Budgets
- Funds
- EDI accounts
- Library EANs
- Network Printers
- Identity providers
- Z39.50/SRU servers
- SMTP servers
- Did you mean?
- Table settings
- Audio alerts
- Share your usage statistics
- Share content with Mana KB
- Additional fields
- Keyboard shortcuts
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
The FontAwesome class "fa-pencil-alt" works in v.6 but is actually a v.5
class. We should use "fa-solid fa-pencil" instead.
This patch also corrects some leftover instances of "fa-edit"
To test, apply the patch and view some pages in the OPAC and staff
interface which have updated icons, e.g.
- Administration -> Libraries
- Catalog -> Bibliographic details
- OPAC -> Bibliographic details
Confirm that the pencil icon looks correct. Checking all modified
templates is probably too much, but inspecting the patch should show
that only fa-pencil-alt and fa-edit icons are affected.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch updates icons which are listed as having changed names in
this document:
https://fontawesome.com/docs/web/setup/upgrade/upgrade-from-v4
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch uses the cities administration page as a proof-of-concept for
using the [% t() %] construction to wrap translatable string in template
<title> tags. This should result in a significant improvement in
translatability.
To test, apply the patch and run the translation script to update the
.po files, e.g.
perl misc/translator/translate update fr-FR
Check the updated .po files:
- In fr-FR-staff-prog.po you should no longer see a reference to
cities.tt line 6, "#: koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt:6"
- In fr-FR-messages.po you should see several strings which have been
pulled individually from the <title> tag:
- cities.tt:9, msgid "Modify city"
- cities.tt:11, msgid "New city"
- cities.tt:15, msgid "Confirm deletion of city"
- cities.tt:19, msgid "Administration", msgid "Cities", msgid "Koha",
and msgid "Administration"
Translate the strings in fr-FR-messages.po and install the updated
translation:
perl misc/translator/translate install fr-FR
Swith to the update language in the staff interface and confirm that the
Cities page title is translated correctly.
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
id should be spelled ID, ids should be IDs as it's
an abbreviation according to:
https://www.oxfordlearnersdictionaries.com/definition/english/identification
To test:
* Some of these are hard to make happen or require specific
data, easiest will be to review the patch itself closely.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch adds a <span> tag around a string in both cities.tt and
desks.tt in order to improve translatability.
To test apply the patch and run the translation script to update the .po
files, e.g.
perl misc/translator/translate update fr-FR
Check the updated .po files:
- Before the patch you would have found 'msgid "%s Searching: %s %s %s'
- After the patch you should find 'msgid "Searching: %s'
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch finds places in the updated breadcrumbs markup where a
translatable string is isolated in a way that makes it hard for the
translation script to find it, and wraps these strings with <span>
This follow-up includes a change to admin/cities.tt as well.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
The variable name "active" is very likely to already be set for other
reasons, so changing the parameter name to "bc_active" to avoid
problems.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch lays the groundwork for updating the way we build breadcrumb
navigation on each page, and implements it on the cities administration
page as a proof of concept.
The page creates two blocks, 'breadcrumbs' and 'breadcrumb_item'
'breadcrumbs' builds the outer structure of the menu, currently:
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
<ol class="breadcrumb">
It automatically adds the "Home" link which appears on all pages.
The 'breadcrumb_item' block builds the list item which contains the
individual link.
To test, apply the patch and go to Administration -> Cities & towns. On
each variation of the page, check the breadcrumbs menu:
- On the initial summary view it should be:
Home -> Administration -> Cities
- Click "New city" and the menu should be:
Home -> Administration -> Cities -> New city
- When you edit a city:
Home -> Administration -> Cities -> Modify city
- When you delete a city:
Home -> Administration -> Cities -> Confirm deletion of city
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch adds the page section to div to the following administration pages:
admin/cash_registers.tt
admin/cities.tt
admin/credit_types.tt
admin/debit_types.tt
admin/patron-attr-types.tt
admin/restrictions.tt
plugins/plugins-home.tt
To test go the following pages and make sure everything looks good:
Administration > Cash registers. You must enable the sys pref 'UseCashRegisters'
Administration > Cities and towns.
Administration > Credit types
Administration > Debit types
Administration > Patron restrictions
Adminstration > Patron attribute types
Administration > Manage plugins
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
https://bugs.koha-community.org/show_bug.cgi?id=32082
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch makes changes the button markup in Administration templates
so that all submit buttons and any buttons that should should be styled
as primary buttons have the Bootstrap class "btn btn-primary."
To test, apply the patch and view pages in Administration to confirm
that everything looks correct. In most cases there are no visible
changes.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
What this patch does:
- change the navigation bar style
- change the breadcrumbs style
- change the "last borrower" link style
- move the search bar inside the navigation bar
- move the help link to the same row as the breadcrumbs
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
When adding a new city, the focus/cursor should be
in the first input field of the form: City
To test:
* Add a new city in administration > cities
- cursur is in no field
* Apply patch
* Add another new city
- cursor is now in the first input field of the form: City
https://bugs.koha-community.org/show_bug.cgi?id=27193
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Due to conditions. Things like "Edit batch" need to be keept in one
strings.
Also removed some capitalization because it wasn't needed and wasn't
consistend with <title> and <h1> which had now capitalization.
Also fixed patron edit-batch.tt and edit-layout.tt because they were
incomplete in regard to their label counterparts. They had the condition
on description and batch_id but weren't displaying anything different
between the two cases.
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
And a few minor fixes when they where causing issues for
translatability.
And rephrased a string about password reset to have it identical to
other strings with the same meaning.
Simplified via wrapping strings with <span> to split to huge
concatenated strings with a lot of %s everywhere.
== Test plan ==
This patch needs mainly proof reading. Still it's possible to do some
basic testing to demonstrate that adding a <span> in an IF doesn't
break anything.
Pick in one of the 110 modified templates a string that you know how to
display. Otherwise:
1. acquisitions => vendor => basket => add to basket =>
search "from existing record" => add order
2. Cancel the order
3. You see without issue "Bibliographic record will not be deleted"
4. administration => Patron categories
5. Try to delete a used and unused category
6. You see as expected
Category XXXX is in use. Deletion not possible!
and
Confirm deletion of category XXXX
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Here we need to deal with the other DT config (in datatables.js, not
columns_settings.inc).
Test plan:
Same as "normal"
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Changed each of the pages in the admin folder to have one <h1> tag
showing that describes the page, rather than the <h1> describing the
logo.
The hierarchy of heading tags may be broken in many pages, but this
will be dealt with in an additional bug.
To test:
1) Go to the Staff Client
2) Apply patch
3) Go to each of the pages in the admin folder and check that they have
an obvious and descriptive heading
4) Ensure that the heading in the page is <h1>
Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
To be nicer with translators.
Update the PO files for whichever languages will show how this is
useful.
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This patch goes through the codebase and updates existing revelant calls
to .api referencing the Koha REST dataTables wrapper to use the name
name 'kohaTable'.
Test plan.
1) Ensure the tables on the following pages all continue to work as
expected
a) acqui/parcel
b) admin/branches
c) admin/cities
d) admin/smtp_servers
e) pos/register
f) tools/quotes
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
We want admin/cities.pl to be using as much DT features as possible to be used as an example.
Test plan:
Add some cities, go to admin/cities.pl confirm that you can show/hide
column.
Go to the tables settings admin page and confirm that you can set some
default settings from there.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Swapped the order of the page titles to have the unique information
first, i.e. the name of the specific page displays first, and the name of the website (e.g. Koha) displays at the end.
To test:
1) Apply patch
2) Ensure each of the files in the admin folder are swapped around to display the most unique information first, and the website name is at the end
3) Ensure the pages displayed on the Staff Client that correspond to these files also display the changes
Sponsored-by: Catalyst IT
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Henry Bolshaw <bolshawh@parliament.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
I think the "breadcrumbs" ID is worth saving for past and future CSS
customization reasons.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Modified breadcrumbs to be accessible, in particular for a
screen-reader.
Made the block of breadcrumbs be a <nav aria label="Breadcrumb"
class="breadcrumb"> with an ordered list inside. The last breadcrumbs
also has aria-current="page" to specify that it is the current page.
To test:
1) Apply patch
2) Build scss file
3) Ensure each of the files in the admin folder has breadcrumbs that are
in a <nav aria label="Breadcrumb" class="breadcrumb"> block
4) Ensure that there is an ordered list in the block of breadcrumbs
5) Ensure that the last breadcrumb has aria-current="page"
6) Ensure that the breadcrumbs on each page of the staff client
belonging to these files look the same as before, but the '>' symbol
is replaced with '/' and the last breadcrumb has bold text
7) Ensure that when the last breadcrumb is clicked it takes you to the
page you are currently on
Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch add the noExport class to all "Actions" columns in the
codebase.
It's a stupid search and replace, maybe the class is added to table
where there is no export button.
Test plan:
Search tables where the export button is available. Confirm that the
"Actions" columns is not exported.
Example: /admin/branches.pl, /admin/cities.pl
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
To make it reusable we need to move the code to datatables.js
So far only the cities table is using the column filters so there is no other
view to test.
Note that the existing implementation didn't work at all, and were base
on what is done on the detail.pl page (using table_filters.js)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 24561 added a wrapper to use easily all the DataTables functionalities when a REST API route was used within Koha.
The filtering method used is working for the global search filter, but not if we have a filter on top of each column.
This patchset is going to, first, add the filters on top of each column
of the cities table, then the code will be moved to the DT REST API wrapper to make it reusable easily.
Test plan:
Generate some cities:
use Koha::Cities;
for ( 1 .. 42 ) {
Koha::City->new({city_name => "name_$_", city_state => "state_$_", city_country => "country_$_", city_zipcode => "zipcode_$_" })->store;
}
Hit /admin/cities.pl
Use the filters
The general filter must do a OR query on each of the cities' attributes,
when column filters must use AND
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch escapes city_id uses in URLs, and also removes redundant dom
entry as this is inherited from the global datatables configuration
anyway.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch makes HTML entities be escaped. It is done in a simple way.
We need to explore ways to do it at datatables.js level but it deserves
its own bug.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch does the following things:
- Uses a call to Koha::Cities->search(*)->count to display the same
message we displayed before when no city was found/defined (datatable
not rendered at all).
- Restores the main search box functionality, the passed param is used
to query on the city name with wildcards on both sides, for (a)
counting results and for (b) apending to the API call with the same
behaviour.
The only missing bit from QA is HTML/URI escaping values from cells, but
this is going to happen at DT level most sure.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch makes the general cities datatable use the API for rendering.
To test:
1. Test the datatable behaviour
2. Apply this patch
3. Repeat your tests
=> SUCCESS: Things work! Filtering and sorting specially
Bonus: Use the browser inspector to notice each interaction with the
datatable triggers an API call with the right query parameters
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch makes a number of changes in order to improve the way the
staff client's header menu adjusts at narrower browser widths:
- Updated version of Bootstrap 3.3.7 which includes the "collapse"
JavaScript plugin.
- Modified default Bootstrap CSS using Bootstrap's customization tool.
These changes facilitate the removal of some custom CSS (overriding
Bootstrap) from staff-global.scss.
- Added Bootstrap config file for loading customizations at
https://getbootstrap.com/docs/3.3/customize/
- Revised button classes for buttons in Bootstrap-styled toolbars.
The modified default CSS resets the base font size in Bootstrap to
better match our global CSS. A side-effect of this is that toolbar
buttons ended up looking smaller than they should. Changing the
button class solves this.
- Restructure the header menu in order to allow different rules to
govern the appearance of the navigational part of the menu
(Circulation, Search, etc) and the user menu (Set library, My
account, Log out).
- Modify the cart JS to so that the popup works well at narrow widths.
To test, apply the patch, regenerate the staff client CSS, and clear
your browser cache.
- Log in to the staff client and observe the layout of the header menu
as you adjust the browser to various widths.
- Confirm that sections of the menu "collapse" as the window gets
narrower.
- Confirm that dropdown menus behave correctly and that links work.
- Confirm that the Cart link works as expected when the cart empty
and when it has items.
- Install and enable multiple translations, including at least one
set of sub-languages (e.g. fr-FR and fr-CA).
- Test the appearance of the language menus in the footer at
various browser widths.
- View pages with button toolbars and confirm that they appear unchanged
(e.g. biblio detail page, patron detail page).
NOTE: While this patch is intended to make improvements to staff client
responsiveness, it does so within a limited scope. There are still many
pages which do not work well at narrower browser widths.
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
DataTables are used on enough pages in the staff client that it
doesn't make sense to put inclusion of the CSS into each template
where it is needed. This patch moves includes of datatables.css from
individual templates into the global header file.
To test, apply the patch and view various pages which have DataTables.
View various styles of DataTables, e.g.
- Full pagination, like item search results
- Four-button, like Saved SQL reports
Everything should look the same as it was.
Signed-off-by: Jose-Mario Monteiro-Santos <jose-mario.monteiro-santos@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch modifies several acquisitions templates to use the Bootstrap
grid instead of YUI.
This patch also removes obsolete "text/javascript" attributes from
<script> tags in the modified templates.
To test, apply the patch and view the following pages, confirming that
they look correct at various browser widths:
- Administration -> Columns settings
- Administration -> Patron categories
- View and edit patron categories
- Administration -> Cities and towns
- View and edit cities
- Administration -> Classification sources
- View and edit classification sources
- Administration -> MARC bibliographic framework test
I'm not sure if this standalone interface is actually in use, but you
can navigate directly to /cgi-bin/koha/admin/clone-rules.pl to see a
form which is usually submitted from the circulation and fines rules
interface. View the page to confirm it looks correct.
Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Here we go, next step then.
As we did not fix the performance issue when autofiltering
the variables (see bug 20975), the only solution we have is to add the
filters explicitely.
This patch has been autogenerated (using add_html_filters.pl, see next
pathces) and add the html filter to all the variables displayed in the
template.
Exceptions are made (using the new 'raw' TT filter) to the variable we
already listed in the previous versions of this patch.
To test:
- Use t/db_dependent/Koha/Patrons.t to populate your DB with autogenerated
data which contain <script> tags
- Remove them from borrower_debarments.comments (there are allowed here)
update borrower_debarments set comment="html tags possible here";
- From the interface hit page and try to catch alert box.
If you find one it means you find a possible XSS.
To know where it comes from:
* note the exact URL where you found it
* note the alert box content
* Dump your DB and search for the string in the dump to identify its
location (for instance table.field)
Next:
* Ideally we would like to use the raw filter when it is not necessary
to HTML escape the variables (in big loop for instance)
* Provide a QA script to catch missing filters (we want html, uri, url
or raw, certainly others that I am forgetting now)
* Replace the html filters with uri when needed (!)
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Having to write [% KOHA_VERSION %] for each url is bad because:
- It's easily forgettable when adding new <script> or <link>
- It prevents grep'ing for the full filename
- It violates the DRY principle
- If at some point we want to change the "force js and css reload"
mechanism, it will be tedious
This patch:
- adds a Template::Toolkit plugin that generates <script> and
<link> tags for JS and CSS files, and inserts automatically the Koha
version in the filename
- use the new plugin to remove all occurences of [% KOHA_VERSION %]
- remove the code that was adding KOHA_VERSION as a template variable
Test plan:
1. Apply patch
2. Go to several different pages in Koha (opac and intranet) while
checking your browser's dev tools (there should be no 404 for JS and
CSS files, and the Koha version should appear in filenames) and the
server logs (there should be no "File not found")
3. `git grep KOHA_VERSION` should return nothing
4. prove t/db_dependent/Koha/Template/Plugin/Asset.t
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>