Commit d2cf1b84 authored by Tarje.Lavik's avatar Tarje.Lavik
Browse files

Init commit

parents
static/semantic/
static/js/blackbox-search/
node_modules
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# admin-components
This repository conatins all queries, templates and extra views for the Marcus administrative webside (admin.marcus.uib.no). The site is based on Semantic-UI. There is a submodule for the search
## Install
```bash
npm install
cd static/semantic/
gulp build
```
## Install Blackbox-search
https://gitlab.com/ubbdev/marcus-search-client
```bash
## static/js/blackbox-search er i .gitignore
cd static/js/
mkdir blackbox-search
cd blackbox-search
git clone https://gitlab.com/ubbdev/marcus-search-client.git .
git checkout modularize-admin
# Følg installeringsguide til marcus-search-client (https://gitlab.com/ubbdev/marcus-search-client)
# Første steg:
cp default.semantic.json semantic.json
npm install
```
\ No newline at end of file
{
"base": "static/semantic/",
"paths": {
"source": {
"config": "src/theme.config",
"definitions": "src/definitions/",
"site": "src/site/",
"themes": "../themes/"
},
"output": {
"packaged": "dist/",
"uncompressed": "dist/components/",
"compressed": "dist/components/",
"themes": "dist/themes/"
},
"clean": "dist/"
},
"permission": false,
"autoInstall": false,
"rtl": false,
"version": "2.2.13"
}
\ No newline at end of file
<?php
#$conf['endpoint']['local'] = 'http://127.0.0.1:3030/marcus-prod/query';
$conf['endpoint']['local'] = 'http://sparql.ub.uib.no/sparql/sparql';
$conf['endpoint']['bibsys'] = 'http://marcus.uib.no/sparql/bibsys-auth/query';
$conf['endpoint']['stat'] = 'http://marcus.uib.no/sparql/rdf-statistikk/sparql';
//$conf['endpoint']['dbpedia'] = 'http://dbpedia.org/sparql';
//$conf['endpoint']['dbpedia'] = 'http://live.dbpedia.org/sparql';
$conf['home'] = '/var/www/html/lodspeakr/';
$conf['basedir'] = 'http://localhost/';
$conf['debug'] = true;
$conf['root'] = 'home';
//$conf['cache']['global'] = 1200;
$conf['ns']['base'] = 'http://data.ub.uib.no/';
$conf['ns']['local'] = 'http://data.ub.uib.no/';
$conf['ns']['scheme'] = 'http://marcus.uib.no/instance/charter/';
$conf['ns']['ubbinst'] ='http://data.ub.uib.no/instances/';
$conf['ns']['ubbont'] = 'http://data.ub.uib.no/ontology/';
$conf['ns']['dct'] = 'http://purl.org/dc/terms/';
$conf['ns']['rdf'] = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';
$conf['ns']['rdfs'] = 'http://www.w3.org/2000/01/rdf-schema#';
$conf['ns']['text'] = 'http://jena.apache.org/text#';
$conf['ns']['skos'] = 'http://www.w3.org/2004/02/skos/core#';
$conf['ns']['foaf'] = 'http://xmlns.com/foaf/0.1/';
$conf['ns']['schema'] = 'http://schema.org/';
$conf['ns']['ubstat'] = 'http://data.ub.uib.no/ontology/ubstat#';
$conf['ns']['sdmx-attribute'] = 'http://purl.org/linked-data/sdmx/2009/attribute#';
$conf['ns']['sdmx-measure'] = 'http://purl.org/linked-data/sdmx/2009/measure#';
$conf['ns']['qb'] = 'http://data.ub.uib.no/ontology/ubstat#';
// $conf['mirror_external_uris'] = true;
$conf['mirror_external_uris'] = $conf['ns']['base'];
// Cherry-picked components (see https://github.com/alangrafu/lodspeakr/wiki/Reuse-cherry-picked-components-from-other-repositories)
// Variables in can be used to store user info.
// For examples, 'title' will be used in the header.
// (You can forget about all conventions and use your own as well)
$lodspk['title'] = 'Marcus';
$lodspk['subtitle'] = 'Spesialsamlingen ved Universitetet i Bergen';
$lodspk['currentDate'] = date("D M d, Y");
$lodspk['yesterday'] = date("Y-m-d", time() - 60 * 60 * 24);
/* Oyvind spesialkrydder query post variabel som kan brukes over hele lodspkr */
/*$lodspk['query'] = $_POST['query'];
$lodspk['latest'] = $_POST['latest'];
*/
/*ATTENTION: By default this application is available to
* be exported and copied (its configuration)
* by others. If you do not want that,
* turn the next option as false
*/
$conf['export'] = false;
$conf['static']['haanga'] = false;
$conf['modules']['available'] = array('static','service','uri','type','admin');
?>
{%if models.po|length != 0 %}
<div class="ui segment">
<div class="header">
Denne siden har disse egenskapene
</div>
<table class="ui fluid very compact very basic large table" about="{{uri}}">
<thead>
<tr><th>Predikat</th><th>Objekt</th></tr>
</thead>
{% for row in models.po %}
<tr>
<td class="collapsing">{% ifchanged row.p.value %}<a href="{{row.p.value}}">{% if row.classLabel %}{{row.classLabel.curie}}{% else %}{{row.p.value}}{%endif%}</a>{% endifchanged%}</td>
<td>
{%if row.o.uri == 1 && row.label %}
<a rel='{{row.p.value}}' href='{{row.o.value}}'>{{row.label.value}}</a>
{%endif%}
{%if row.o.uri == 1 && !row.label %}
<a rel='{{row.p.value}}' href='{{row.o.value}}'>{{row.o.curie}}</a>
{%endif%}
{%if row.o.uri == 0 && !row.label %}
<span property='{{row.p.value}}'>{{row.o.value}}</span>
{%endif%}
</td>
</tr>
{% endfor %}
<tfoot>
<tr><th>Predikat</th><th>Objekt</th></tr>
</tfoot>
</table>
</div>
{%endif%}
<!--
{%if models.sp|length != 0 %}
<div class="ui segment">
<div class="header">
Disse objektene lenker til denne siden
</div>
<table class="ui basic collapsing celled table" about="{{uri}}">
<thead>
<tr><th>Subjekt</th><th>Predikat</th><th>Objekt</th></tr>
</thead>
{% for row in models.sp %}
<tr>
<td>
{%if row.s.uri == 1 && row.label %}
<a rel='{{row.p.value}}' href='{{row.s.value}}'>{{row.label.curie}}</a>
{%endif%}
{%if row.s.uri == 1 && !row.label %}
<a rel='{{row.p.value}}' href='{{row.s.value}}'>{{row.s.curie}}</a>
{%endif%}
{%if row.s.uri != 1 && !row.label %}
<span property='{{row.p.value}}'>{{row.s.value}}</span>
{%endif%}
</td>
<td class="collapsing">{% ifchanged row.p.value %}<a href="{{row.p.value}}">{% if row.classLabel %}{{row.classLabel.curie}}{% else %}{{row.p.value}}{%endif%}</a>{% endifchanged%}</td>
<td class="collapsing">{%if forloop.first%}<a href='{{lodspk.this.value}}'>Denne siden</a>{%endif%}</td>
</tr>
{% endfor %}
<tfoot>
<tr><th>Subjekt</th><th>Predikat</th><th>Objekt</th></tr>
</tfoot>
</table>
</div>
{%endif%}
-->
\ No newline at end of file
<!-- ALL DATA -->
<button type="button" class="ui olive small button all-data" ><i class="fa fa-heart all-data tada"></i> Vis data</button>
<script>
$('.all-data').mouseover(function(){
$('.all-data.tada').transition('tada');
});
</script>
\ No newline at end of file
<div class="ui seven doubling cards">
{% for row in models.collections %}
<div class="ui card">
{% if row.logo %}
<a class="ui image" href="{{row.uri.value}}">
<img src="{{row.logo.value}}"/>
</a>
{% else %}
<a href="{{row.uri.value}}" class="ui small image">
<img data-src="holder.js/200x100">
</a>{% endif %}
<div class="middle aligned content">
<a class="header" href="{{row.uri.value}}">{% if row.title && row.title.value != "" %}{{row.title.value}}{% else %}{% if row.label && row.label.value != "" %}{{row.label.value}}{% else %} {{row.identifier.value}}{%endif%}{%endif%}</a>
<!--{% if row.description %}
<div class="description">
<p>{{row.description.value|truncatewords:25}}</p>
<a href="{{row.uri.value}}">se mer</a>
</div>
{%endif%}-->
</div>
</div>
{% endfor %}
</div>
\ No newline at end of file
{% if first.main.created.value != null %}
<p><strong><i class="fa fa-calendar"></i>
Dato: <span itemprop="dateCreated">{{ first.main.created.value }}</span>
</strong></p>
{% endif %}
{% if first.main.madeafter.value != null || first.main.madebefore.value != null %}
<p><i class="fa fa-calendar"></i>
{% if first.main.madeafter.value != null && first.main.madebefore.value != null %}
Laget mellom <strong>{{ first.main.madeafter.value }}</strong> og <strong>{{ first.main.madebefore.value }}</strong>
{% endif %}
{% if first.main.madeafter.value != null && first.main.madebefore.value == null %}
Laget etter <strong>{{ first.main.madeafter.value }}</strong>
{% endif %}
{% if first.main.madeafter.value == null && first.main.madebefore.value != null %}
Laget før <strong>{{ first.main.madebefore.value }}</strong>
{% endif %}
</p>
{% endif %}
\ No newline at end of file
<span class="header">Avbildet</span>
<div class="ui cards">
{% for row in models.depicted %}
{% ifchanged row.uri.value %}
<div class="card">
<div class="content">
{% if row.img %}<img class="right floated tiny ui circular image" src="{{row.img.value}}" />{% endif %}
<a class="header" href="{{ row.uri.value }}" >{{row.label.value}}</a>
<div class="meta">
<p>{% if row.birthDate.value || row.deathDate.value %}
{% if row.birthDate %}<small>({{ row.birthDate.value }}{% else %}<small>(&nbsp;&nbsp;&nbsp;&nbsp;-{% endif %}
{% if row.deathDate %}- {{ row.deathDate.value }})</small>{% else %}-&nbsp;&nbsp;&nbsp;&nbsp;)</small>{% endif %}
{% else %}</small>{% endif %}</p>
</div>
{% if row.description %}
<div class="description">
<p>{{row.description.value|truncatewords:15}}</p>
</div>
{% endif %}
</div>
</div>
{% endifchanged %}
{% endfor %}
</div>
\ No newline at end of file
<span class="header">Avbildet på</span>
<div class="ui cards">
{% for row in models.depiction %}
{% ifchanged row.uri.value %}
<div class="ui card">
<a style="min-height:250px; width: 100%;" class="ui image" href="{{ row.uri.value }}">
<img {% if row.img %}src="{{row.img.value}}"{%else%}data-src="holder.js/350x250"{%endif%} alt="">
</a>
<div class="extra content">
<a href="{{ row.uri.value }}"><strong>{{ row.label.value }}</strong></a>
{% if row.description %}<p>{{row.description.value|truncatewords:15}}</p>{% endif %}
</div>
</div>
{% endifchanged %}
{% endfor %}
</div>
{% if models.dzi|length != 0 %}
<!-- Contains the OpenSeadragon viewer -->
<div class="ui top attached tab segment no-padding active" data-tab="dzi">
<div id="dzi1" style="height:50rem; background-color: black;"></div>
</div>
{% endif %}
{% if models.digitalresources|length != 0 %}
<div data-tab="jpeg" class="{% if models.dzi|length == 0 %}active{% endif %} ui top attached tab segment no-padding">
<!-- fotorama.css & fotorama.js. -->
<link href="http://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.3/fotorama.css" rel="stylesheet">
<script src="http://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.3/fotorama.js"></script>
<div class="fotorama">
{% for row in models.digitalresources %}
<img src="{{row.imgSM.value}}" data-full="{{row.imgMD.value}}" alt=""/>
{% endfor %}
</div>
</div>
{% endif %}
{% if models.dzi|length != 0 && models.digitalresources|length != 0 %}
<div class="ui bottom attached tabular menu dr-tab">
<a class="item {% if models.dzi|length != 0 %}active{% else %}disabled{% endif %}" data-tab="dzi">Zoom</a>
<a class="item {% if models.dzi|length == 0 %}active{% endif %}" data-tab="jpeg">Jpeg</a>
<div id="dzi-control" class="right menu">
<button id="resetZoom" class="ui item button"><i class="fa fa-arrows-alt"></i> <span class="hidden-xs">tilpass zoom</span></button>
<button id="full-page" class="ui item button" alt="Fullskjermvisning av og på"><i id="fullPage" class="fa fa-expand"></i></button>
<button id="zoom-out" class="ui item button"><i class="fa fa-search-minus"></i></button>
<button id="zoom-in" class="ui item button"><i class="fa fa-search-plus"></i></button>
{% if models.dzi|length > 1 %}
<button id="previous" class="ui item button"><i class="fa fa-arrow-left"></i> forrige</button>
<button class="ui item button"> til side &nbsp;<input style="width: 55px;" type="number" id="page" value="1"/> av <span id="tileSourcesLength"></span></button>
<button id="next" class="ui item button">neste <i class="fa fa-arrow-right"></i></button>
{%endif%}
</div>
</div>
{% endif %}
<script type="text/javascript" src="{{lodspk.home}}js/openseadragon/openseadragon.js"></script>
<script type="text/javascript">
var viewer = OpenSeadragon({
id: "dzi1",
prefixUrl: "{{lodspk.home}}vjs/openseadragon/images/",
tileSources: [
{% for row in models.dzi %}{%if !forloop.first && models.dzi|length > 1 %},{%endif%}
"{{ row.dziUri.value }}"{% endfor %}
],
visibilityRatio: 1.0,
minZoomLevel: 1,
constrainDuringPan: true,
preserveViewport: false,
//minZoomImageRatio: 0.9,
minPixelRatio: 0.5,
animationTime: 0.8,
springStiffness: 8,
showNavigator: true,
//navigatorId: "navigatorDiv",
toolbar: "dzi-control",
zoomInButton: "zoom-in",
zoomOutButton: "zoom-out",
homeButton: "resetZoom",
fullPageButton: "full-page",
nextButton: "next",
previousButton: "previous"
});
$('#page').change(function() {
chpage = $('#page').val();
currentPage = chpage-1;
viewer.goToPage(chpage-1);
});
viewer.addHandler('page', function(event){
$('#page').val(event.page+1);
});
function tileSourceLength() {
length = viewer.tileSources.length ;
$('#tileSourcesLength').append(length);
};
tileSourceLength();
</script>
\ No newline at end of file
<div id="disqus_thread" class="col-md-12"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'ubblod';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
\ No newline at end of file
{% if models.digitalresources|length != 0 %}
<div class="ui small buttons">
<div class="ui button"><i class="fa fa-download"></i> Last ned</div>
<div class="ui floating dropdown icon button download-dropdown">
<i class="dropdown icon"></i>
<div class="menu">
{% if first.digitalresources.imgXS.value %}
<div class="item"><a href="{{first.digitalresources.imgXS.value}}" download>JPG - veldig liten</a></div>
{% endif %}
{% if first.digitalresources.imgSM.value %}
<div class="item"><a href="{{first.digitalresources.imgSM.value}}" download>JPG - liten</a></div>
{% endif %}
{% if first.digitalresources.imgMD.value %}
<div class="item"><a itemprop="image" href="{{first.digitalresources.imgMD.value}}" download>JPG - medium</a></div>
{% endif %}
{% if first.digitalresources.imgLG.value %}
<div class="item"><a itemprop="image" href="{{first.digitalresources.imgLG.value}}" download>JPG - stor</a></div>
{% endif %}
</div>
</div>
</div>
{% endif %}
\ No newline at end of file
<div id="dzi1" style="height: 600px; background-color: black;"></div>
<div id="dzi-control" class="ui bottom attached label">
<button id="resetZoom" class="ui button"><i class="fa fa-arrows-alt"></i> <span class="hidden-xs">tilpass zoom</span></button>
<button id="full-page" class="ui button" alt="Fullskjermvisning av og på"><i id="fullPage" class="fa fa-expand"></i></button>
<button id="zoom-out" class="ui button"><i class="fa fa-search-minus"></i></button>
<button id="zoom-in" class="ui button"><i class="fa fa-search-plus"></i></button>
{% if models.dzi|length > 1 %}
<button id="previous" class="ui button"><i class="fa fa-arrow-left"></i> forrige</button>
<button>gå til side &nbsp;<input style="width: 55px;" type="number" id="page" value="1"/> av <span id="tileSourcesLength"></span></button>
<button id="next" class="ui button">neste <i class="fa fa-arrow-right"></i></button>
{%endif%}
</div>
<script type="text/javascript" src="{{lodspk.home}}js/openseadragon/openseadragon.js"></script>
<script type="text/javascript">
var viewer = OpenSeadragon({
id: "dzi1",
prefixUrl: "{{lodspk.home}}vjs/openseadragon/images/",
tileSources: [
{% for row in models.dzi %}{%if !forloop.first && models.dzi|length > 1 %},{%endif%}
"{{ row.dziUri.value }}"{% endfor %}
],
preserveViewport: false,
minZoomImageRatio: 0.6,
minPixelRatio: 0.5,
animationTime: 0.8,
springStiffness: 8,
showNavigator: true,
//navigatorId: "navigatorDiv",
toolbar: "dzi-control",
zoomInButton: "zoom-in",
zoomOutButton: "zoom-out",
homeButton: "resetZoom",
fullPageButton: "full-page",
nextButton: "next",
previousButton: "previous"
});
$('#page').change(function() {
chpage = $('#page').val();
currentPage = chpage-1;
viewer.goToPage(chpage-1);
});
viewer.addHandler('page', function(event){
$('#page').val(event.page+1);
});
function tileSourceLength() {
length = viewer.tileSources.length ;
$('#tileSourcesLength').append(length);
};
tileSourceLength();
</script>
\ No newline at end of file
<div class="ui seven doubling cards">
{% for row in models.events %}
<div class="card">
{% if row.logo %}
<a class="ui small image" href="{{row.uri.value}}">
<img src="{{row.logo.value}}"/>
</a>
{% else %}
<a href="{{row.uri.value}}" class="ui small image">
<img data-src="holder.js/100x100">
</a>
{% endif %}
<div class="middle aligned content">
<a class="header" href="{{row.uri.value}}">{% if row.title && row.title.value != "" %}{{row.title.value}}{% else %}{% if row.label && row.label.value != "" %}{{row.label.value}}{% else %} {{row.identifier.value}}{%endif%}{%endif%}</a>
<!-- {% if row.description %}
<div class="description">
<p>{{row.description.value|truncatewords:25}}</p>
<a href="{{row.uri.value}}">se mer</a>
</div>
{%endif%}-->
</div>
</div>
{% endfor %}
</div>
\ No newline at end of file
<footer class="ui container fluid">
<div>
</div>
</footer>
<script src="{{lodspk.home}}js/marcus-ux.js"></script>
\ No newline at end of file
<meta charset="utf-8">
<title>{{lodspk.title}} {% if first.main.title.value != "" %} - {{first.main.title.value}}{% else %} - {% if first.main.label.value != "" %}{{first.main.label.value}}{%endif%}{%endif%}</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="http://marcus.uib.no/img/favicon-adm.ico" type="image/x-icon">
<link rel="icon" href="http://marcus.uib.no/img/favicon-adm.ico" type="image/x-icon">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- <script type="text/javascript" src="{{lodspk.home}}js/jquery.js"></script> -->
<link rel="stylesheet" type="text/css" href="{{lodspk.home}}semantic/dist/semantic.min.css">
<link rel="stylesheet" type="text/css" href="{{lodspk.home}}css/marcus_overrides.css">
<link rel="stylesheet" type="text/css" href="{{lodspk.home}}css/print.css" media="print">
<!--<script src="{{lodspk.home}}semantic/dist/semantic.min.js"></script>-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.1/semantic.min.js"></script>
<script src="{{lodspk.home}}js/marcus-ux.js"></script>
<script src="{{lodspk.home}}js/holder.js"></script>
<!-- Font Awesome -->
<link href="//netdna.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet">
<!-- Leaflet -->
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" />
<![endif]-->
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
<!-- <script src="{{lodspk.home}}js/Leaflet/dist/leaflet.js"></script> -->
<script src="{{lodspk.home}}js/Leaflet/leaflet-providers.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- TODO: Move to pages using it -->
<script type="text/javascript" src="{{lodspk.home}}js/qrcode/jquery.qrcode-0.7.0.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=Lato:400,700|Libre+Baskerville|Montserrat:400,400i,700" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<title>{{lodspk.title}}</title>
\ No newline at end of file
<div class="main-content-menu ui fixed secondary menu">
<div class="item">
<div id="show-menu">
<a class="item ui mobile only"><i class="large sidebar icon"></i></a>
</div>
<div class="logo">
<a href="{{lodspk.home}}home">Marcus<span class="descr">-admin</span></a>
</div>
</div>
<div class="item">
<form class="ui form" role="search" method="get" action="/search">
<input type="text" placeholder="Søk ..." name="q">
</form>
</div>
</div>
<ul class="nav in" id="side-menu"><