Skip to content

Commit

Permalink
Fix #33
Browse files Browse the repository at this point in the history
  • Loading branch information
enridaga committed Jul 13, 2014
1 parent 58d5f23 commit ec999d8
Show file tree
Hide file tree
Showing 9 changed files with 146 additions and 12 deletions.
4 changes: 2 additions & 2 deletions app/templates/book-title-template.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h2 class="book-title"><%= title %></h2>
<p><em>By <%= author %></em></p>
<p>
Published <%= printed %><!--, <%= pages.length %> pages --> &middot;
<a href="<%= viewonlink %>" target="_blank">View on <%= viewon %></a>
<!-- Published <%= printed %>, <%= pages.length %> pages &middot; -->
<a href="<%= viewonlink %>" target="_blank"><%= viewon %></a>
</p>
2 changes: 1 addition & 1 deletion app/templates/place-summary-template.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h3><%= title %></h3>
<div class="frequency-bars"></div>
<p><!-- http%3A%2F%2Fpleiades.stoa.org%2Fplaces%2F -->
<span class="frequency"><%= frequency %></span> reference<%= frequency == 1 ? "" : "s" %> | <span class="change-this control on">Report a problem with this record</span> <span class="change-this-divider">|</span> <a href="<%= uri %>" target="_blank">Place page on Pleiades</a> | <a href="http://pelagios.dme.ait.ac.at/api/places/<%= encodeURIComponent(uri) %>" target="_blank">References in Pelagios</a>
<span class="frequency"><%= frequency %></span> reference<%= frequency == 1 ? "" : "s" %> | <span class="change-this control on">Report a problem with this record</span> <span class="change-this-divider">|</span> <a href="<%= uri %>" target="_blank">Find out more in the Pleiades Gazetteer</a> | <a href="http://pelagios.dme.ait.ac.at/api/places/<%= encodeURIComponent(uri) %>" target="_blank">Find related documents via Pelagios</a>
</p>
<div></div>
<!-- <ul>
Expand Down
12 changes: 8 additions & 4 deletions app/views/BookReferencesView.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ define(['gv', 'views/BookView', 'models/Collection',], function(gv, BookView, Co
if (DEBUG) console.error('Failed to load related places');
}
});
// create content
view.$el.append('<h4>Book References</h4>');

return this;
},

Expand All @@ -59,12 +58,17 @@ define(['gv', 'views/BookView', 'models/Collection',], function(gv, BookView, Co
refs = refs.filter(function(book) {
return book.id != bookId;
});
if (refs.length)
if (refs.length){
// create content
view.$el.append('<h4>Book References</h4>');
refs.slice(0, gv.settings.bookRefCount)
.forEach(function(book) {
view.$el.append(template(book.toJSON()));
});
else view.$el.append('<p>No other book references were found.</p>');
}
else {
//view.$el.append('<p>No other book references were found.</p>');
}
},

// UI Event Handlers - update state
Expand Down
4 changes: 2 additions & 2 deletions app/views/PlaceReferencesView.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ define(['gv', 'views/BookView'], function(gv, BookView) {
// get the place
place = book.places.get(placeId);
place.ready(function() {
view.$el.append('<h4>References details</h4>');
view.$el.append('<h4>No. of References by Book and Chapter</h4>');
if(book.supportsSections()){
var sections = [];
place.get('sparkData').forEach(function(r){
Expand All @@ -45,7 +45,7 @@ define(['gv', 'views/BookView'], function(gv, BookView) {
});
for(var k in sections) {
var plinks = sections[k];
$('<p><b>Ch. ' + k + '</b> (' + plinks.length + '): ' + plinks.join(' ') + '</p>').appendTo( view.el );
$('<p><b>Bk. ' + k + '</b> (' + plinks.length + '), Chapters: ' + plinks.join(' ') + '</p>').appendTo( view.el );
};
}else{
var plinks = [];
Expand Down
11 changes: 9 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,26 @@

<property name="build.dir" value="build" />
<property name="target.dir" value="." />
<property name="index.template" value="index.tmpl.html" />

<!-- Build Targets -->

<target name="build-dev">
<property name="index.template" value="index.tmpl.html" />
<property name="js.settings" value="${js.settings.dev}"/>
<ant target="-start-build-dev"/>
</target>

<target name="build-production">
<property name="index.template" value="index.tmpl.html" />
<property name="js.settings" value="${js.settings.production}"/>
<ant target="-start-build-production"/>
</target>

<target name="build-hestia">
<property name="index.template" value="index.hestia.tmpl.html" />
<property name="js.settings" value="${js.settings.hestia}"/>
<ant target="-start-build-production"/>
</target>

<target name="build-production-test">
<property name="index.file" value="index.html" />
Expand Down Expand Up @@ -119,7 +126,7 @@
${js.app.init}"/> <!-- ,
-->
<property name="js.insert.files"
value="${js.settings.production},
value="${js.settings},
${js.lib.nomunge},
${js.concat.target}" />
<property name="js.uglify.compress" value="true"/>
Expand Down
1 change: 1 addition & 0 deletions config/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ js.app.config = app/config.js
# uglify config
js.settings.dev = config/settings.dev.js
js.settings.production = config/settings.production.js
js.settings.hestia = config/settings.hestia.js

# CSS files
css.app = css/gapvis.less
Expand Down
2 changes: 1 addition & 1 deletion config/settings.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ API_DATA_TYPE = 'json';
DEBUG = true;
// if present and not null, makes a direct link isntead of a form. Looks for {token-id}
//REPORT_BAD_TOKEN_URL = "http://gap2.alexandriaarchive.org/report/token-issues/{token-id}";
VIEW_ON = "Perseus"
VIEW_ON = "View on Perseus"
VIEW_ON_LINK = function(uri, page){
// uri is the link to the book page on the origin repository
// page is the page number (eg, 1, 3, -13) or reference (eg. 1.1, 4.5)
Expand Down
35 changes: 35 additions & 0 deletions config/settings.hestia.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// development settings
API_ROOT = 'tests/api';
REPORT_URL = 'tests/api/flags/';
// API_DATA_TYPE = 'json';
// DEBUG = true;
// disableChangeLink = true;
// //if present and not null, makes a direct link isntead of a form. Looks for {token-id}
// REPORT_BAD_TOKEN_URL = null;
// //if present and not null, makes a direct link isntead of a form. Looks for {place-id}
//REPORT_PROBLEM_PLACE_URL = 'http://gap2.alexandriaarchive.org/report/place-issues/{place-id}';
API_ROOT = 'http://gap2.alexandriaarchive.org';
REPORT_URL = 'http://gap2.alexandriaarchive.org/flags/';
API_DATA_TYPE = 'json';
DEBUG = false;
// if present and not null, makes a direct link isntead of a form. Looks for {token-id}
//REPORT_BAD_TOKEN_URL = "http://gap2.alexandriaarchive.org/report/token-issues/{token-id}";
VIEW_ON = "Search or download the full text via the Perseus Classical Library"
VIEW_ON_LINK = function(uri, page){
// uri is the link to the book page on the origin repository
// page is the page number (eg, 1, 3, -13) or reference (eg. 1.1, 4.5)
// Implement here how to build a more detailed link

// XXX This is the default (do nothing)
//return uri;

// XXX This is an example for Perseus repository
// uri is something like http://www.perseus.tufts.edu/hopper/text?doc=Perseus%3Atext%3A1999.01.0126
if(page.indexOf('.')!=-1){
page = page.split('.');
return uri + '%3Abook%3D' + page[0] + '%3Achapter%3D' + page[1] + '%3A';
}else{
return uri;
}
};
PLACE_THEME = "frequency"; // Supported values are 'frequency' and 'feature'. If the value is set to 'feature' then places should have a 'type' property set to one of the following values: "REGION", "SETTLEMENT", "NATURAL_FEATURE"
87 changes: 87 additions & 0 deletions index.hestia.tmpl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<title>HestiaVis: Visual Interface for Reading Herodotous' Histories</title>
<meta name="description" content="HestiaVis: Visual Interface for Reading Herodotus' Histories.">
<meta name="author" content="Hestia Project / Google Ancient Places Project">

<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<!-- STYLES -->

<!-- SCRIPTS -->

<!-- ANALYTICS -->

<style>
#logo-container a {
background: url('http://hestia.open.ac.uk/wp-content/uploads/2013/09/Hestia_logo_180px.png') no-repeat;
background-size: 100%;
display:inline-block;
width: 70px;
margin: 0px 10px 0px 10px;
}
</style>
</head>

<body>

<div id="container">
<header>
<!-- h1><a href="#">HestiaVis</a> <span class="beta">BETA</span></h1 -->
<h1><div id="logo-container"><a href="http://hestia.open.ac.uk" target="_blank">&nbsp;</a></div></h1>
<nav>
<a href="index.html">Home</a> &middot; <a href="http://hestia.open.ac.uk/">About</a> &middot; <a href="http://hestia.open.ac.uk/blog/">Blog</a>
</nav>
</header>
<div id="app-view" role="main" class="clearfix"></div>
<footer>
GapVis (c) 2011 <a href="http://www.nickrabinowitz.com">Nick Rabinowitz</a> / <a href="http://googleancientplaces.wordpress.com/">Google Ancient Places</a>. Hosting by <a href="http://alexandriaarchive.org/">AlexandriaArchive.org</a>. Funding by&nbsp;&nbsp;<img src="images/google_logo.png" alt="Google">.
</footer>
</div>

<div id="message-view">
<div class="alert">
<button class="close">&times;</button>
<span></span>
</div>
</div>

<div id="change-this-link">
<button class="btn" title="Report an Issue"><i class="glyphicon glyphicon-edit"></i></button>
</div>

<div id="change-this-form" class="modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button class="close cancel">&times;</button>
<h3>Report an Issue</h3>
</div>
<div class="modal-body">
<p>Is something wrong with this place reference? Let us know, so we can fix it!</p>
<p>
Reference: <span class="ref">"<span id="ctf-place-name"></span>" (<span id="ctf-book-title"></span><span class="pagenum">,
p. <span id="ctf-page-id"></span></span>)</span>
</p>
<form>
<label for="ctf-problem">What's wrong here?</label>
<div>
<textarea id="ctf-problem" name="note" rows="5"></textarea>
</div>
</form>
</div>
<div class="modal-footer">
<button class="btn cancel">Cancel</button>
<button class="btn btn-primary submit">Submit</button>
</div>
</div>
</div>
</div>
<!-- TEMPLATES -->

</body>
</html>

0 comments on commit ec999d8

Please sign in to comment.