Skip to content
This repository was archived by the owner on Jan 3, 2021. It is now read-only.

Commit d181802

Browse files
committed
Major revision of the Bootstrap-based new layout
1 parent 1456ce7 commit d181802

File tree

10 files changed

+97
-140
lines changed

10 files changed

+97
-140
lines changed
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#parse("header.vm")
22

3-
The requested resource does not exist at this server,
3+
<p class="lead">
4+
The requested resource does not exist on this server,
45
or no information about it is available.
6+
</p>
57

6-
#parse("footer.vm")
8+
#parse("footer.vm")
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
<hr>
2-
<div id="footer">
1+
<footer>
2+
<p class="text-center">
33
#if ($rdf_link)
4-
<a href="$rdf_link?output=ttl">As Turtle</a> |
5-
<a href="$rdf_link?output=xml">As RDF/XML</a>
4+
<a class="muted" href="$rdf_link?output=ttl">As Turtle</a> |
5+
<a class="muted" href="$rdf_link?output=xml">As RDF/XML</a>
66
#end
7-
</div>
7+
</p>
8+
</footer>
89
</div>
10+
<script src="${server_base}static/js/jquery-1.10.2.min.js"></script>
911
<script src="${server_base}static/script.js"></script>
10-
<script src="${server_base}static/js/jquery.js"></script>
1112
</body>
1213
</html>

src/main/webapp/WEB-INF/templates/header.vm

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,28 @@
2121
<link rel="stylesheet" type="text/css" href="${server_base}static/css/bootstrap-responsive.css" />
2222
</head>
2323
<body>
24-
<div class="container">
25-
<div class="masthead">
26-
<ul class="nav nav-pills pull-right">
27-
<li><a href="$rdf_link" title="RDF data"><img src="${server_base}static/rdf-icon.gif" alt="[This page as RDF]" /></a></li>
28-
</ul>
29-
<h3 class="muted">
30-
#if ($uri)
31-
<a href="$uri">$title</a>
32-
#else
33-
$title
34-
#end
3524
#if ($project_name)
25+
<div class="navbar navbar-inverse navbar-fixed-top">
26+
<div class="navbar-inner">
27+
<div class="container-fluid">
3628
#if ($project_link)
37-
<small>at <a href="$project_link">$project_name</a></small>
29+
<a class="brand" href="$project_link">$project_name</a>
3830
#else
39-
<small>at <a href="$server_base">$project_name</a></small>
31+
<a class="brand" href="$server_base">$project_name</a>
4032
#end
33+
</div>
34+
</div>
35+
</div>
4136
#end
42-
</h3>
37+
<div class="container-fluid">
38+
<div class="page-header">
39+
<h1>$title</h1>
4340
#if ($uri)
44-
<div class="truncate"><a href="$uri">$uri</a></div>
41+
<div class="truncate"><a class="muted" href="$uri">$uri</a></div>
42+
#end
43+
#if ($rdf_link)
44+
<ul class="rdf-icon nav nav-pills pull-right">
45+
<li><a href="$rdf_link" title="RDF data"><img src="${server_base}static/rdf-icon.gif" alt="This page in RDF" /></a></li>
46+
</ul>
4547
#end
4648
</div>
47-
<hr>
Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,25 @@
11
#parse("header.vm")
2-
#if ($image)
3-
<div class="row-fluid">
4-
<div class="image"><a href="$image"><img src="$image" alt="Depiction of $title" /></a></div>
5-
</div>
6-
#end
72
#if ($comment)
8-
<div class="row-fluid">
9-
<p class="comment">$comment</p>
10-
</div>
3+
<p class="lead">$comment</p>
4+
#end
5+
#if ($image)
6+
<p class="image text-center"><a href="$image"><img class="img-polaroid" src="$image" alt="Depiction of $title"></p>
117
#end
128

13-
<div class="row-fluid">
14-
#if (!$properties.isEmpty())
9+
#if (!$properties.Empty)
1510
#parse("proptable.vm")
1611
#else
17-
<p>No further information is available.</p>
12+
<p>No further information is available.</p>
1813
#end
1914
</div>
2015

2116
#if ($metadata)
22-
<div class="row-fluid">
23-
<a name="meta"></a>
24-
<h2>Metadata</h2>
25-
<div id="metadata-tables">
17+
<a name="meta"></a>
18+
<h2>Metadata</h2>
19+
<div id="metadata-tables">
2620
#parse("metadatatable.vm")
27-
</div>
28-
<a href="#meta" onclick="showAllMetadata('metadata-tables')">expand all</a>
29-
</div>
21+
</div>
22+
<a href="#meta" onclick="showAllMetadata('metadata-tables')">expand all</a>
3023
#end
3124

3225
#parse("footer.vm")
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
## Renders the name of a ResourceProperty, given in $property
22
<span class="property-name">
33
#if ($property.Inverse && !($showLabels && $property.InverseLabel))
4-
<small>Is</small>
4+
<span class="muted">Is</span>
55
#end
66
#if ($showLabels && $property.Inverse && $property.InverseLabel)
77
<a class="uri" href="$property.BrowsableURL" title="$property.URI">$property.InverseLabel</a>
88
#elseif ($showLabels && $property.label)
99
<a class="uri" href="$property.BrowsableURL" title="$property.URI">$property.label</a>
1010
#elseif ($property.hasPrefix())
11-
<a class="uri" href="$property.BrowsableURL" title="$property.URI"><small>$property.Prefix:</small>$property.LocalName</a>
11+
<a class="uri" href="$property.BrowsableURL" title="$property.URI"><span class="muted">$property.Prefix:</span>$property.LocalName</a>
1212
#else
13-
<a class="uri" href="$property.BrowsableURL" title="$property.URI"><small>?:</small>$property.LocalName</a>
13+
<a class="uri" href="$property.BrowsableURL" title="$property.URI"><span class="muted">?:</span>$property.LocalName</a>
1414
#end
1515
#if ($property.Inverse && !($showLabels && $property.InverseLabel))
16-
<small>of</small>
16+
<span class="muted">of</span>
1717
#end
1818
</span>

src/main/webapp/WEB-INF/templates/proptable.vm

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,29 @@
11
## Renders a set of ResourceProperties, given in $properties, as a property-value table
2-
<table class="table table-bordered table-striped table-hover">
2+
<table class="table table-bordered property-table">
33
<colgroup>
44
<col class="property-column" span="1">
55
<col class="value-column" span="1">
66
</colgroup>
7+
<thead>
8+
<tr><th>Property</th><th>Value</th></tr>
9+
</thead>
710
<tbody>
811
#foreach ($property in $properties)
912
<tr>
10-
<td class="property">
13+
<td>
1114
#parse("property-name.vm")
1215
</td>
13-
<td class="wrapword">
16+
<td class="property-value">
1417
#if ($property.hasOnlySimpleValues())
1518
#parse("values.vm")
1619
#else
17-
<span class="values-summary">
18-
#if ($property.ValueCount == 1)
19-
#set ($text = "1 value")
20-
#else
21-
#set ($text = "$property.ValueCount values")
22-
#end
2320
#if ($property.ValuesPageURL)
24-
[<a href="$property.ValuesPageURL">$text</a>]
21+
<a href="$property.ValuesPageURL">
22+
<span class="badge">$property.ValueCount</span>
23+
</a>
2524
#else
26-
[$text]
25+
<span class="badge">$property.ValueCount</span> <small class="muted">&nbsp;&nbsp;anonymous</small>
2726
#end
28-
</span>
2927
#end
3028
</td>
3129
</tr>

src/main/webapp/WEB-INF/templates/values.vm

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
## Renders the values of a single ResourceProperties, given in $property, as an unordered list
2-
<ul class="property-values">
2+
#if ($property.SimpleValues.size() > 1)
3+
#set ($multi = "multi")
4+
#else
5+
#set ($multi = "")
6+
#end
7+
8+
<ul class="$multi property-values unstyled">
39
#foreach ($value in $property.SimpleValues)
410
<li>
511
#if ($value.Node.isURI())
612
#if ($showLabels && $value.label)
713
<a class="uri" href="$value.BrowsableURL" title="$value.Node.URI">$value.label</a>
8-
#elseif ($value.hasPrefix())
9-
<a class="uri" href="$value.BrowsableURL" title="$value.Node.URI"><small>$value.Prefix:</small>$value.LocalName</a>
14+
#elseif ($value.Prefix)
15+
<a class="uri" href="$value.BrowsableURL" title="$value.Node.URI"><span class="muted">$value.Prefix:</span>$value.LocalName</a>
1016
#else
11-
<small>&lt;</small><a class="uri" href="$value.BrowsableURL">$value.Node.URI</a><small>&gt;</small>
17+
<span class="muted">&lt;</span><a class="uri" href="$value.BrowsableURL">$value.Node.URI</a><span class="muted">&gt;</span>
1218
#end
13-
#elseif ($value.Node.isLiteral())
19+
#elseif ($value.Node.Literal)
1420
<span class="literal">$value.Node.LiteralLexicalForm
1521
#if ($value.DatatypeLabel)
16-
<small> ($value.DatatypeLabel)</small>
22+
<small class="muted"> &nbsp;$value.DatatypeLabel</small>
1723
#end
1824
#if ($value.Node.LiteralLanguage != "")
19-
<small> ($value.Node.LiteralLanguage)</small>
25+
<small class="muted"> &nbsp;$value.Node.LiteralLanguage</small>
2026
#end
2127
</span>
2228
#end

src/main/webapp/WEB-INF/templates/valuespage.vm

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,26 @@
22
## given in $property. Simple values are shown first as a list,
33
## complex values (i.e., descriptions of blank nodes) as complete
44
## resource descriptions underneath.
5+
56
#parse("header.vm")
67

7-
<p><a href="$back_uri">Back to $back_label</a></p>
8+
<ul class="breadcrumb">
9+
<li><a href="$back_uri">$back_label</a> <span class="divider">/</span></li>
10+
<li class="active">#parse("property-name.vm")</li>
11+
</ul>
812

9-
<table class="table">
10-
<thead>
11-
<tr>
12-
<th>
13-
#parse("property-name.vm")
14-
</th>
15-
</tr>
16-
</thead>
17-
<tbody>
18-
<tr>
19-
<td>
20-
#if (!$property.SimpleValues.isEmpty())
13+
#if (!$property.SimpleValues.Empty)
2114
#parse("values.vm")
2215
#end
2316

2417
#foreach ($resource in $property.ComplexValues)
2518
#if ($resource.Title)
26-
<h2>$resource.Title</h2>
19+
<h3>$resource.Title</h3>
2720
#else
28-
<h2>Resource #$velocityCount</h2>
21+
<h3>Resource #$velocityCount</h3>
2922
#end
3023
#set ($properties = $resource.Properties)
3124
#parse("proptable.vm")
3225
#end
33-
</td>
34-
</tr>
35-
</tbody>
36-
</table>
3726

3827
#parse("footer.vm")

src/main/webapp/static/script.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
function init() {
1+
$(function() {
22
init_long_literals();
3-
}
3+
});
44

55
var long_literal_counter = 0;
66
var long_literal_spans = {};
@@ -13,13 +13,13 @@ function init_long_literals() {
1313
var textNode = span.firstChild;
1414
var text = textNode.data;
1515
if (text.length < 300) continue;
16-
var match = text.match(/([^\0]{150}[^\0]*? )([^\0]*)/);
16+
var match = text.match(/([^\0]{250}[^\0]*? )([^\0]*)/);
1717
if (!match) continue;
1818
span.insertBefore(document.createTextNode(match[1] + ' ... '), span.firstChild);
1919
span.removeChild(textNode);
2020
var link = document.createElement('a');
2121
link.href = 'javascript:expand(' + long_literal_counter + ');';
22-
link.appendChild(document.createTextNode('\u00BBmore\u00BB'));
22+
link.appendChild(document.createTextNode('more'));
2323
link.className = 'expander';
2424
span.insertBefore(link, span.firstChild.nextSibling);
2525
long_literal_spans[long_literal_counter] = span;
@@ -42,4 +42,4 @@ function showAllMetadata(name) {
4242
for (i = 0; i < tables.length; i++) {
4343
tables[i].style.display = 'block';
4444
}
45-
}
45+
}

src/main/webapp/static/style.css

Lines changed: 18 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,24 @@
1-
img {
2-
width:100%;
3-
}
4-
.image img {
5-
display: block;
6-
margin-left: auto;
7-
margin-right: auto;
8-
width:100%;
9-
}
10-
td img {
11-
height:auto;
12-
margin-right: : 0px;
13-
padding: 0 10px 10px 0;
14-
width:100px;
15-
}
16-
.wrapword ul {
17-
list-style-type: none;
18-
margin: 0 0 25px 0;
19-
}
20-
.wrapword {
21-
word-break: break-word;
22-
text-align: justify;
23-
min-width: 50%;
24-
}
25-
.row-fluid {
26-
padding-bottom: 50px;
27-
}
28-
.justify {
29-
text-align: center;
30-
}
1+
table.property-table th { background: #f8f8f8; }
2+
.property-name { white-space: nowrap; }
3+
.property-name a { color: #444; }
4+
.property-name a:hover { color: #000; }
5+
.property-name a .muted { color: #666; }
6+
ul.property-values.multi li { padding-left: .7em; text-indent: -0.8em; }
7+
ul.property-values.multi li:before { color: #999; content: "•";font-family: monospace; }
8+
td > ul.property-values { margin-bottom: 0; }
9+
td.property-value { min-width: 50%; text-align: justify; word-break: break-word; }
10+
col.property-column { width: 25%; }
11+
.expander { font-size: 85%; }
12+
.rdf-icon { margin-top: -40px; }
13+
.rdf-icon img { opacity: 0.7; }
14+
.image img { margin-bottom: 2em; max-width: 400px; max-height: 400px; width: 100%; }
15+
body { padding: 40px 0; }
3116
.truncate {
3217
-ms-word-break: break-all;
18+
-moz-hyphens: auto;
19+
-webkit-hyphens: auto;
20+
hyphens: auto;
3321
word-break: break-all;
34-
3522
/* Non standard for webkit */
3623
word-break: break-word;
37-
38-
-webkit-hyphens: auto;
39-
-moz-hyphens: auto;
40-
hyphens: auto;
41-
}
42-
col.property-column {
43-
width: 13em;
44-
}
45-
body {
46-
padding-top: 20px;
47-
padding-bottom: 60px;
48-
}
49-
50-
/* Custom container */
51-
.container {
52-
margin: 0 auto;
53-
max-width: 1000px;
54-
}
55-
.container > hr {
56-
margin: 40px 0;
5724
}

0 commit comments

Comments
 (0)