Giter Club home page Giter Club logo

registry-config-base's Introduction

registry-config-base

Provides configuration, UI templates and bootstraping for a starting registry installation.

Custom installations can fork this repository then customize the configuration and UI files. This makes it possible to pull in an merge upstream UI fixes made in this base repository.

N.B. Requires registry-core 1.2.0 or higher

Layout

Directory Role
ldregistry A starting set of configuration files and templates which should be install in /opt/ldregistry on the target system. For details of the role of these files see Configuration
install Files used to configure the front end nginx proxy
scripts Example installation scripts

Customizing the configuration

The base configuration is based on the UK Government Environment registry.

Files in ldregistry which may require customization are:

File Role
templates Velocity templates which implement the registry UI, particular targets for customization are ...
templates/about.vm Provides descriptive information on the registry instance
ui/assets Style sheets and associated javascript and images, the ones here are based on bootstrap3
boot Initial register contents
config Configuration files for the registry instance see Configuration

Change notes - July 2016

A substantial restructuring of the UI templates has been completed. The key changes are:

  • Moved UI assets to subdirectory ui/assets. This makes it easier to configure the front end web server to serve the static assets directly, with only the ui templates being served from tomcat.

  • Updated default look and feel to be more consistent with, but not infringe, gov.uk styling. This is created using sass to customize bootstrap 3.3.6. The new subdirectory ui-customize contains the sass scripts and instructions for regenerating the styling.

  • Restructure the UI templates to split into smaller, more maintainable parts with more consistent naming convention. In particular all top level pages are in the root directory, the elements that application to all pages are in templates/structure, all templates that are intended to be included within a parent template ("partials" in Rails terminology) start with "_".

  • Simplified the default UI:

    • splitting the "admin" tab into separate "actions" and "administrators"
    • flattening the "registration" action
    • move some actions to "advanced" menu
    • improved "create register" dialog to include metadata annotation These are aimed a supporting common operations where a register might be manually created but most content is upload from CSV (or maybe jsonld or ttl files) with "patch" mode being a good universal default.

The templates are structured as follows:

Template Role
templates/ All top level page templates
templates/main.vm All normal page renders go through this, if it is the landing page it displays the category based view (templates/main/_page-category.vm), otherwise it normally displays a register or item (templates/main/_item-render.vm)
templates/structure Elements used on every page to provide the header (_header.vm), optional status bar (_service-bar.vm) and footer (_footer.vm). A standard page normally starts with a sequence of header, navbar and status bar via _preamble.vm.
templates/nav Partials used to render the navigation bar
templates/main Partials used for the main pages, in particular all the pieces that make up the default register/item view
templates/action Templates used for the various actions (whether on the navbar menus or in the admin tab). The convention is that _{action}.vm renders the link which can be used to invoke {action} then _{action}-dialog.vm or _{action}-page.vm render the UI for carrying out the action either as an inline modal (dialog) or as a separately page (page). The macros #startActionSection, #action and #endActionSection are used to render the actions tab and keep track of which actions are available so which dialogs need to be included. The macro #renderDialogs then includes the required dialog partials.

registry-config-base's People

Contributors

der avatar marqh avatar mika018 avatar mo-marqh avatar simonoakesepimorphics avatar skwlilac avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

registry-config-base's Issues

missing templates

The default register
/system/typed-templates
includes entries for dataset and URIset, but the .vm files for these are not present in the distribution.
(concept-scheme-render.vm is, however.)

Mistake building URIs in edit UI

Steps to reproduce:

  1. Build a LDR instance with a baseURI that includes a path following the domain
  2. login, open edit dialogue, make a change, select [Save changes]
    --- Save failed: Bad Request - Payload URI does not match target ---

Inspection of the request URL shows that an extra /def has been inserted in the URL.
When this is removed, everything is fine.

Looks like perhaps the algorithm for building the request URL has parsed some input to find the end of the domain, rather than the end of the baseURI ??

UI Restructure - merge?

I've implemented some UI simplifications in response to various user feedback. This is aimed at making routine registry admin (create a register, upload or patch a set of entries using e.g. a CSV) easier for non-experts. For example, by hiding some more advanced features in the "advanced" menu and by packaging standard options as drop downs/radio buttons.

As part of this I've restructured the velocity templates area to improve structuring and make them easier to maintain.

I've also restructured how the main CSS file is generated to make it easier to customize the look and feel. This is based on using sass to generate a customized bootstrap and add core registry styles. In doing so I've updated the default look and feel to be more compatible with GOV.UK styling.

This forms the basis for new deployments of the UK Environment and Location registries (e.g. see http://environment.data.gov.uk/registry - though without a login the UI changes other than look&feel aren't visible).

This is all currently in branch ui-restructure.

Now that this work has completed and there are a couple of instances in production I'd like to merge this into master. I know that @marqh at least uses registry-config-base as an upstream so that a merge would mean your next rebase might be a little different from normal. So I'll hold off the merge for a short time until we have a chance to confirm it is acceptable.

Duplicate entries in tree view of a hierarchical register.

When a registry contains multiple hierarchical schemes each of which may reference common terms from another register, the tree view of a register presents multiple entries of a child item, one for each of the registers that references the item within its hierarchy. This occurs because in the hierarchy view, the query embedded within main/_hlist-render-child.vm locates the reg:RegisterItem associated with the child entity and it is a link to that item that is then presented to the user.

Suggest replacing this line in main/_hlist-render-child.vm (layout adjusted for readability)

#set($query="SELECT DISTINCT ?item WHERE 
             { <$concept> $narrow ?entity.  
               ?entity ^reg:entity/^reg:definition/^version:currentVersion ?item 
             } ")

with

#set($query="SELECT DISTINCT ?item WHERE 
             { <$concept> $narrow ?entity. 
               { SELECT ?entity (sample(?i2) as ?item) WHERE 
                 { ?entity ^reg:entity/^reg:definition/^version:currentVersion ?i2 } 
                 GROUP BY ?entity 
               } OPTIONAL { 
                 ?entity rdfs:label|skos:prefLabel ?label 
               } 
             } ORDER BY lcase(?label)")

By wrapping the second half of the query in a SELECT... GROUP BY construct enable the (random) selection of a single reg:RegisterItem (?item) for each referenced entity which then eliminates any duplication of identical items in the tree view.

In addition there is an added probe for labels under an OPTIONAL in order to alpha sort the nested elements of a the tree view which makes a more deterministic and navigable presentation particularly if a parent node has many children.

A PR will follow offering an implementation of the suggested change.

how to make "Browse" mode be the default view

Hi, we are a group at mdl/nws/noaa is USA. The users of our registry app prefer the "Browse" mode of the registry to be a default view. That is, each time a user visits the registry homepage, he wants to see the "Browse" view instead of clicking the "Browse" menu at the top of the app's gui. Can someone tell us how to set this up? Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.