Overview

Here is the development of the journal-view template.

journal-view v1.1

Description

A link is added to create a new Note in a Journal. Boostrap grid is used to position the link on the right hand side of the page.

Code


<?xml version="1.0" encoding="UTF-8" ?>
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xi="http://www.w3.org/2001/XInclude"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:dcterms="http://purl.org/dc/terms/">
<head>
    <title resource="?this">{rdfs:label}</title>
</head>
<body resource="?this">
    <div class="container">
        <div class="page-header">
            <h1 property="rdfs:label" />
        </div>
        <div class="row">
            <div class="col-sm-8">
                <p property="rdfs:comment" />
            </div>
            <div class="col-sm-4">
                <aside class="well well-sm">
                    <p class="lead">
                        <a resource="Note" href="Note" onclick="href='?create='+encodeURIComponent(getAttribute('resource'))">Create a new note</a>
                    </p>
                </aside>
            </div>
        </div>
    </div>
</body>
</html>

journal-view v1.2

Description

An unordered list is added in order to create new Notes in a Journal.

Code


<?xml version="1.0" encoding="UTF-8" ?>
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xi="http://www.w3.org/2001/XInclude"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:dcterms="http://purl.org/dc/terms/">
<head>
	<title resource="?this">{rdfs:label}</title>
</head>
<body resource="?this">
    <div class="container">
        <div class="page-header">
            <h1 property="rdfs:label" />
        </div>
        <div class="row">
            <div class="col-sm-8">
                <p property="rdfs:comment" />
                <ul>
                    <li rev="dcterms:isPartOf" resource="?note">
                        <a href="?note">
                            <time datetime="{dcterms:date}" />
                        </a>
                    </li>
                </ul>
                <script type="text/javascript">
                    $('li time[datetime]').text(function(){
                        return calli.parseDateTime(this).toLocaleString();
                    });
                </script>
            </div>
            <div class="col-sm-4">
                <aside class="well well-sm">
                    <p class="lead">
                        <a resource="Note" href="Note" onclick="href='?create='+encodeURIComponent(getAttribute('resource'))">Create a new note</a>
                    </p>
                </aside>
            </div>
        </div>
    </div>
</body>
</html>