Skip to content
Snippets Groups Projects
Commit 5261ae4c authored by alvaro's avatar alvaro
Browse files

bootstrap in script generated components

parent 78f7e635
No related branches found
No related tags found
No related merge requests found
......@@ -74,7 +74,7 @@
</div>
<div class="span5 well">
<h2>Add static files</h2>
<p>You can also serve (and use) files that help you to present your content the way you want (JavaScript, CSS, images, etc). Just copy them on the <code>static</code> folder inside lodspeakr and you are ready to use them. For more information <a href='https://github.com/alangrafu/lodspeakr/wiki/Statics'>about static files in LODSPeaKR, please check the wiki</a>.</p>
<p>You can also serve (and use) files that help you to present your content the way you want (JavaScript, CSS, images, etc). Just copy them on the <code>static</code> folder inside lodspeakr and you are ready to use them. For more information <a href='https://github.com/alangrafu/lodspeakr/wiki/Statics'>about static files in LODSPeaKR</a> and <a href='https://github.com/alangrafu/lodspeakr/wiki/Change-root-page'>how to change the landing page</a>, please check the wiki</a>.</p>
</div>
<div class="span5 well">
<h2>Understanding components</h2>
......
......@@ -3,40 +3,10 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
initToken='services'
cd $DIR
modelHtml=`cat service-model.inc`
modelHtml=`cat <<QUERY
{%for h in base.header %}
PREFIX {{h.prefix}}: <{{h.ns}}>
{%endfor%}
SELECT DISTINCT ?resource WHERE {
GRAPH {%if lodspk.args.arg0 %}<{{lodspk.args.arg0}}>{%else%}?g{%endif%} {
[] a ?resource .
}
}
LIMIT 10
QUERY`
viewHtml=`cat <<VIEW
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" {% for i, ns in lodspk.ns %}xmlns:{{i}}="{{ns}}" {%endfor%}
version="XHTML+RDFa 1.0" xml:lang="en">
<head>
<title>$1</title>
<link href="{{lodspk.baseUrl}}css/basic.css" rel="stylesheet" type="text/css" media="screen" />
<style type="text/css">
</style>
</head>
<body>
<h1>$1</h1>
<ul>
{% for row in models.main %}
<li><a href="{{lodspk.baseUrl}}special/instances/{{ row.resource.curie }}">{{row.resource.curie}}</a></li>
{% endfor %}
</ul>
</body>
</html>
VIEW`
viewHtml=`cat service-view.inc`
#Check models
mainDir=$DIR/../../components/$initToken/$1/
......
......@@ -4,85 +4,12 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
initToken='types'
modelHtmlSP=`cat <<QUERY
SELECT ?s ?p WHERE {
{
GRAPH ?g{
?s ?p <{{uri}}> .
}
}UNION{
?s ?p <{{uri}}> .
}
}
QUERY`
cd $DIR
modelHtmlSP=`cat type-model-1.inc`
modelHtmlPO=`cat <<QUERY
SELECT ?p ?o WHERE {
{
GRAPH ?g{
<{{uri}}> ?p ?o.
}
}UNION{
<{{uri}}> ?p ?o .
}
}
QUERY`
modelHtmlPO=`cat type-model-2.inc`
viewHtml=`cat <<VIEW
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" {% for i, ns in lodspk.ns %}xmlns:{{i}}="{{ns}}"
{%endfor%}version="XHTML+RDFa 1.0" xml:lang="en">
<head>
<title>Page about {{lodspk.this.value}}</title>
<link href="{{lodspk.home}}css/basic.css" rel="stylesheet" type="text/css" media="screen" />
<link rel="alternate" type="application/rdf+xml" title="RDF/XML Version" href="{{lodspk.this.value}}.rdf" />
<link rel="alternate" type="text/turtle" title="Turtle Version" href="{{lodspk.this.value}}.ttl" />
<link rel="alternate" type="text/plain" title="N-Triples Version" href="{{lodspk.this.value}}.nt" />
<link rel="alternate" type="application/json" title="RDFJSON Version" href="{{lodspk.this.value}}.json" />
</head>
<body about="{{lodspk.this.value}}">
<h1>Default view</h1>
<div style='margin-top: 40px'>
<table>
<tr><th>Subject</th><th>Predicate</th><th>Object</th></tr>
{% for row in models.po %}
<tr>
<td>{%if forloop.first%}<a href='{{lodspk.this.value}}'>{{lodspk.this.curie}}</a>{%endif%}</td>
<td style='background-color:#c9f9c9'><a href='{{row.p.value}}'>{{row.p.curie}}</a></td>
<td style='background-color:#c9f9c9'>
{%if row.o.uri == 1%}
<a rev='[{{row.p.curie}}]' href='{{row.o.value}}'>{{row.o.curie}}</a>
{%else%}
{{row.o.value}}
{%endif%}
</td>
</tr>
{% endfor %}
<tr><td></td><td><a href='{{lodspk.this.value}}'>{{lodspk.this.curie}}</a></td><td></td></tr>
{% for row in models.sp %}
<tr>
<td style='background-color:#c9f9c9'><a href='{{row.s.value}}'>{{row.s.curie}}</a></td>
<td style='background-color:#c9f9c9'><a rel='{{row.s.curie}}' href='{{row.p.value}}'>{{row.p.curie}}</a></td>
<td>{%if forloop.first%}<a href='{{lodspk.this.value}}'>{{lodspk.this.curie}}</a>{%endif%}</td>
</tr>
{% endfor %}
<tr><th>Subject</th><th>Predicate</th><th>Object</th></tr>
</table>
</div>
<br/>
</body>
</html>
VIEW`
viewHtml=`cat type-view.inc`
#Check models
......
......@@ -4,85 +4,12 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
initToken='uris'
modelHtmlSP=`cat <<QUERY
SELECT ?s ?p WHERE {
{
GRAPH ?g{
?s ?p <{{uri}}> .
}
}UNION{
?s ?p <{{uri}}> .
}
}
QUERY`
cd $DIR
modelHtmlSP=`cat type-model-1.inc`
modelHtmlPO=`cat <<QUERY
SELECT ?p ?o WHERE {
{
GRAPH ?g{
<{{uri}}> ?p ?o.
}
}UNION{
<{{uri}}> ?p ?o .
}
}
QUERY`
modelHtmlPO=`cat type-model-2.inc`
viewHtml=`cat <<VIEW
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" {% for i, ns in lodspk.ns %}xmlns:{{i}}="{{ns}}"
{%endfor%}version="XHTML+RDFa 1.0" xml:lang="en">
<head>
<title>Page about {{lodspk.this.value}}</title>
<link href="{{lodspk.home}}css/basic.css" rel="stylesheet" type="text/css" media="screen" />
<link rel="alternate" type="application/rdf+xml" title="RDF/XML Version" href="{{lodspk.this.value}}.rdf" />
<link rel="alternate" type="text/turtle" title="Turtle Version" href="{{lodspk.this.value}}.ttl" />
<link rel="alternate" type="text/plain" title="N-Triples Version" href="{{lodspk.this.value}}.nt" />
<link rel="alternate" type="application/json" title="RDFJSON Version" href="{{lodspk.this.value}}.json" />
</head>
<body about="{{lodspk.this.value}}">
<h1>Default view</h1>
<div style='margin-top: 40px'>
<table>
<tr><th>Subject</th><th>Predicate</th><th>Object</th></tr>
{% for row in models.po %}
<tr>
<td>{%if forloop.first%}<a href='{{lodspk.this.value}}'>{{lodspk.this.curie}}</a>{%endif%}</td>
<td style='background-color:#c9f9c9'><a href='{{row.p.value}}'>{{row.p.curie}}</a></td>
<td style='background-color:#c9f9c9'>
{%if row.o.uri == 1%}
<a rev='[{{row.p.curie}}]' href='{{row.o.value}}'>{{row.o.curie}}</a>
{%else%}
{{row.o.value}}
{%endif%}
</td>
</tr>
{% endfor %}
<tr><td></td><td><a href='{{lodspk.this.value}}'>{{lodspk.this.curie}}</a></td><td></td></tr>
{% for row in models.sp %}
<tr>
<td style='background-color:#c9f9c9'><a href='{{row.s.value}}'>{{row.s.curie}}</a></td>
<td style='background-color:#c9f9c9'><a rel='{{row.s.curie}}' href='{{row.p.value}}'>{{row.p.curie}}</a></td>
<td>{%if forloop.first%}<a href='{{lodspk.this.value}}'>{{lodspk.this.curie}}</a>{%endif%}</td>
</tr>
{% endfor %}
<tr><th>Subject</th><th>Predicate</th><th>Object</th></tr>
</table>
</div>
<br/>
</body>
</html>
VIEW`
viewHtml=`cat type-view.inc`
#Check models
......
SELECT DISTINCT ?resource WHERE {
{
GRAPH {%if lodspk.args.arg0 %}<{{lodspk.args.arg0}}>{%else%}?g{%endif%} {
[] a ?resource .
}
}UNION{
[] a ?resource .
}
}
LIMIT 10
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>LODSPeaKr Basic Menu</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" media="screen" />
<style>
body {
padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
}
.wait{
background-image:url('img/wait.gif');
background-repeat:no-repeat;
padding-right:20px;
background-position: right;
}
</style>
<link href="css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/bootstrap-typeahead.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.typeahead').typeahead({
source: function (typeahead, query) {
$('.typeahead').addClass('wait');[]
return $.get('search/'+encodeURIComponent(query), { }, function (data) {
$('.typeahead').removeClass('wait');[]
return typeahead.process(data);
}, 'json');
},
onselect: function (obj) {
$('.typeahead').attr('disabled', true);
window.location = obj.uri;
}
});
});
</script>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="#">LODSPeaKr</a>
<div class="nav-collapse">
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="classes">Classes</a></li>
<li><a href="namedGraphs">Named Graphs</a></li>
</ul>
<form class="navbar-search pull-left" action="">
<input type="text" data-provide="typeahead" class="typeahead search-query span2" placeholder="Search"/>
</form>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="container">
<h1>My new service</h1>
<ul>
{% for row in models.main %}
<li><a href="{{lodspk.home}}instances/{{ row.resource.curie }}">{{row.resource.curie}}</a></li>
{% endfor %}
</ul>
</div>
</body>
</html>
SELECT ?s ?p WHERE {
{
GRAPH ?g{
?s ?p <{{uri}}> .
}
}UNION{
?s ?p <{{uri}}> .
}
}
SELECT ?p ?o WHERE {
{
GRAPH ?g{
<{{uri}}> ?p ?o.
}
}UNION{
<{{uri}}> ?p ?o .
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>LODSPeaKr Basic Menu</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="{{lodspk.home}}css/bootstrap.min.css" rel="stylesheet" type="text/css" media="screen" />
<style>
body {
padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
}
.wait{
background-image:url('img/wait.gif');
background-repeat:no-repeat;
padding-right:20px;
background-position: right;
}
</style>
<link href="{{lodspk.home}}css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="{{lodspk.home}}js/jquery.js"></script>
<script type="text/javascript" src="{{lodspk.home}}js/bootstrap.min.js"></script>
<script type="text/javascript" src="{{lodspk.home}}js/bootstrap-typeahead.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.typeahead').typeahead({
source: function (typeahead, query) {
$('.typeahead').addClass('wait');[]
return $.get('search/'+encodeURIComponent(query), { }, function (data) {
$('.typeahead').removeClass('wait');[]
return typeahead.process(data);
}, 'json');
},
onselect: function (obj) {
$('.typeahead').attr('disabled', true);
window.location = obj.uri;
}
});
});
</script>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="{{lodspk.home}}">LODSPeaKr</a>
<div class="nav-collapse">
<ul class="nav">
<li class="active"><a href="{{lodspk.home}}">Home</a></li>
<li><a href="{{lodspk.home}}classes">Classes</a></li>
<li><a href="{{lodspk.home}}namedGraphs">Named Graphs</a></li>
</ul>
<form class="navbar-search pull-left" action="">
<input type="text" data-provide="typeahead" class="typeahead search-query span2" placeholder="Search"/>
</form>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="container">
<h1>Default view</h1>
<div style='margin-top: 40px'>
<table class='table table-striped'>
<thead>
<tr><th>Subject</th><th>Predicate</th><th>Object</th></tr>
</thead>
{% for row in models.po %}
<tr>
<td>{%if forloop.first%}<a href='{{lodspk.this.value}}'>{{lodspk.this.curie}}</a>{%endif%}</td>
<td><a href='{{row.p.value}}'>{{row.p.curie}}</a></td>
<td>
{%if row.o.uri == 1%}
<a rev='[{{row.p.curie}}]' href='{{row.o.value}}'>{{row.o.curie}}</a>
{%else%}
{{row.o.value}}
{%endif%}
</td>
</tr>
{% endfor %}
<tr><td></td><td><a href='{{lodspk.this.value}}'>{{lodspk.this.curie}}</a></td><td></td></tr>
{% for row in models.sp %}
<tr>
<td><a href='{{row.s.value}}'>{{row.s.curie}}</a></td>
<td><a rel='{{row.s.curie}}' href='{{row.p.value}}'>{{row.p.curie}}</a></td>
<td>{%if forloop.first%}<a href='{{lodspk.this.value}}'>{{lodspk.this.curie}}</a>{%endif%}</td>
</tr>
{% endfor %}
<thead>
<tr><th>Subject</th><th>Predicate</th><th>Object</th></tr>
</thead>
</table>
</div>
<br/>
</body>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment