scriptotek / emnesok

Realfagsbibliotekets emnesøk

Home Page:http://www.ub.uio.no/om/prosjekter/scriptotek/emnesok-og-infrastruktur-for-emneord.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dependency Status DOI

UiO Library Subject Search

Frontend for subject search against the vocabularies Realfagstermer (Bokmål, Nynorsk, English) and Humord (Bokmål).

The frontend uses a Skosmos instance to query for subjects, and the Primo Search API through LSM to query for catalogue records.

Develop

After cloning the repository, run npm install to fetch dependencies. To make a development build in the build folder and start a development server, run npm run dev. To make a production build, run npm run build.

Translation

The application is translated on Transifex, and the translation workflow is supported by angular-gettext, angular-gettext-cli and transifex-api-es6.

  • After source strings have been added or modified, run npm run update-pot to extract translatable strings from the application into the PO template file po/emnesok.pot and push it to Transifex. For this to work, your Transifex credentials must be stored in the .env file.

  • npm run compile-po fetches the latest translations from Transifex into the po folder and compiles these into src/app/services/translations.json.

  • npm run trans combines the two commands above for a full sync.

Code style

This project tries to adher to:

  • Y033: Controllers: Place bindable members at the top of the controller, alphabetized
  • Y052: Factories: Expose the callable members of the service (its interface) at the top (Revealing Module Pattern)

.htaccess

Atm. we have two .htaccess files, one in htdocs:

RewriteEngine on
RewriteBase /ub/emnesok/

# Serve data from some folders directly

RewriteCond %{REQUEST_URI} ^/ub/emnesok/(data|legacy|program|skosmos)
RewriteRule ^.+$ - [NC,L]

# Redirect from old URLs

RewriteCond "%{QUERY_STRING}" "^id=UHS$"
RewriteRule "^.*$" "humord?" [R,L]

RewriteCond "%{QUERY_STRING}" "^id=UREAL$"
RewriteRule "^.*$" "realfagstermer?" [R,L]

RewriteCond "%{QUERY_STRING}" "^id=TEK$"
RewriteRule "^.*$" "tekord?" [R,L]

RewriteCond "%{QUERY_STRING}" "^id=MR$"
RewriteRule "^.*$" "mrtermer?" [R,L]

RewriteRule "^test/oria/(.*)$" "$1" [R,L]

# Alias / to /2/build/

RewriteRule ^(.*) 2/build/$1 [NC,L]

and one in /htdocs/2/

RewriteEngine on
RewriteBase /ub/emnesok/2/

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]

RewriteRule ^(.*) build/index.html [NC,L]

TODO: Simplify and merge into one file.

About

Realfagsbibliotekets emnesøk

http://www.ub.uio.no/om/prosjekter/scriptotek/emnesok-og-infrastruktur-for-emneord.html

License:MIT License


Languages

Language:JavaScript 73.3%Language:HTML 21.3%Language:CSS 4.5%Language:EJS 0.9%Language:Shell 0.1%