Evergreen development update #16: on the eve of release

Near-monochrome photo of a duck. CC0 image.

Since the previous update, another 134 patches have made their way into master — and we stand ready for the release of Evergreen 3.0.0 tomorrow.

Much has changed since we all started work on 3.0. In addition to the many improvements to Evergreen, Evergreen’s documentation has been reorganized into a set of manuals, each aimed at a specific audience. A shiny new version of OpenSRF, 3.0.0, is also available.

During the 3.0 release cycle, we have had two Bug Squashing Weeks, two feedback fests, and two web client documentation days.

Release day tomorrow is for the users of Evergreen — and for acknowledging the many people who have contributed to Evergreen 3.0. For this update on the eve of release, however, I’d like highlight some of the changes to Evergreen’s source code, especially as they establish or modify conventions for future changes to Evergreen.

RTL vs. LTR styles

Evergreen’s public catalog has gained better support for translating its interface into languages that use right-to-left scripts. As you might expect, RTL interfaces typically should have margins, paddings, and text alignments go in the opposite direction of LTR interfaces. To accommodate this in the public catalog, Open-ILS/src/templates/opac/css/style.css.tt2 now checks for a template variable called rtl that is set based on the current locale and uses it to choose between left-aligned and right-aligned styles. For example:

#rdetails_status tbody td {
    [% IF rtl == 't' -%]
    padding-right: 13px;
    text-align: right;
    [%- ELSE %]
    padding-left: 13px;
    text-align: left;
    [%- END %]

If you add new CSS styles to the public catalog, please add left-aligned and right-aligned versions when applicable.

“Cache-busting” for the public catalog and the kid’s catalog

Static assets such as images or JavaScript files used by the public and kid’s catalogs now are consistently referred to by a URL that includes a cache key value that is updated when autogen.sh is run or by Evergreen administrator action. This allows these assets to be cached by web browsers for longer while allowing fresh versions to be invoked after upgrades.

This is done by appending the value of the ctx.cache_key template variable to links to static resources. For example:

<div id="homesearch_main_logo">
    <img src="[% ctx.media_prefix %]/opac/images/main_logo.png[% ctx.cache_key %]"
        [% img_alt(l('Evergreen Logo')) %]/>

If you add new static assets to the public or kid’s catalog, please append links to those resources with [% ctx.cache_key %].

Updating manifest of files needed by offline circulation interface

The web staff client template Open-ILS/src/templates/staff/base_js.tt2 now includes a manifest of files that UpUp keeps cached via service workers. For example,

<script src="/upup.min.js"></script>
  'content-url': '[% ctx.base_path %]/staff/offline-interface',
  'cache-version': '[% USE date(format = '%Y-%m-%d'); date.format; %]',
  'service-worker-url': '/upup.sw.min.js',
  'assets': [
    '[% ctx.media_prefix %]/js/ui/default/staff/build/css/bootstrap.min.css',
    '[% ctx.media_prefix %]/js/ui/default/staff/build/css/hotkeys.min.css',
    '[% ctx.media_prefix %]/js/ui/default/staff/build/css/ngToast.min.css',
    '[% ctx.media_prefix %]/js/ui/default/staff/build/css/ngToast-animations.min.css',
    '[% ctx.media_prefix %]/js/ui/default/staff/build/css/tree-control.css',
    '[% ctx.media_prefix %]/js/ui/default/staff/build/css/tree-control-attribute.css',
    '[% ctx.media_prefix %]/js/ui/default/staff/build/css/tablesort.css',
    '[% ctx.base_path %]/staff/css/print.css',
    '[% ctx.base_path %]/staff/css/cat.css',
    '[% ctx.base_path %]/staff/css/style.css',
    '[% ctx.base_path %]/staff/css/circ.css',
    '[% ctx.media_prefix %]/js/dojo/opensrf/md5.js',
    '[% ctx.media_prefix %]/js/ui/default/staff/build/js/moment-with-locales.min.js',
    '[% ctx.media_prefix %]/js/ui/default/staff/build/js/moment-timezone-with-data.min.js',
    '[% ctx.media_prefix %]/js/ui/default/common/build/js/jquery.min.js',
    '[% ctx.media_prefix %]/js/ui/default/staff/build/js/angular.min.js',

If you add new core dependencies or services that are needed by the offline interface, reminder to update the manifest in base_js.tt2.

Formatting date and time values in the web staff client

New Angular filters are available for ensuring that date and time values are formatted correctly based on the library’s preferred locale settings. For example:

<div>{{current_location.shortname}} {{today | date:$root.egDateAndTimeFormat}}</div>

Are there other changes worth noting as affecting coding conventions? Please let me know in the comments.

Duck trivia

Some ducks have a field of vision that spans 360 degrees horizontally and 180 degrees vertically.

Leave a comment

Your email address will not be published. Required fields are marked *