Skip to content

Commit

Permalink
Fix templates
Browse files Browse the repository at this point in the history
  • Loading branch information
davorg committed May 20, 2019
1 parent f899823 commit 0d1a12e
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 30 deletions.
4 changes: 2 additions & 2 deletions build
Expand Up @@ -19,8 +19,8 @@ my %resources = qw[
my $tt = Template->new({
INCLUDE_PATH => [ qw( in tt_lib ) ],
OUTPUT_PATH => 'docs',
PRE_PROCESS => 'header.tt',
POST_PROCESS => 'footer.tt',
# PRE_PROCESS => 'header.tt',
# POST_PROCESS => 'footer.tt',
});

my $sch = Literature::Schema->get_schema;
Expand Down
8 changes: 5 additions & 3 deletions in/actor.tt
@@ -1,10 +1,11 @@
[% META title = 'Actor' -%]
[% title = actor.name -%]
[% INCLUDE header.tt -%]

<script type="application/ld+json">
[% actor.json_ld %]</script>
<p class="text-muted">[% template.title or 'Literature on TV' %]</hp>
<p class="text-muted">Actor</hp>

<h1 class="display-3">[% actor.name %]</h1>
<h1 class="display-3">[% title %]</h1>
[% IF actor.born OR actor.died %]
<p>[% IF actor.born %]Born: [% actor.born.strftime('%m %B %Y'); END -%]
[% IF actor.born AND actor.died %], [% END %]
Expand All @@ -24,3 +25,4 @@
[% END %]

[% INCLUDE amazon.tt type='DVD', search=actor.name %]
[% INCLUDE footer.tt -%]
8 changes: 4 additions & 4 deletions in/actors.tt
@@ -1,10 +1,10 @@
[% # Provide a title -%]
[% META title = 'List of Actors' -%]

<h1 class="display-3">[% template.title or 'Literature on TV' %]</h1>
[% title = 'Actors' -%]
[% INCLUDE header.tt -%]
<h1 class="display-3">[% title or 'Literature on TV' %]</h1>

<ul>
[% FOREACH a IN actors.all.sort('name')-%]
<li><a href="/actors/[% a.slug %]/">[% a.name %]</a></li>
[% END -%]
</ul>
[% INCLUDE footer.tt -%]
6 changes: 4 additions & 2 deletions in/author.tt
@@ -1,8 +1,9 @@
[% META title = 'Author' %]
[% title = author.name %]
[% INCLUDE header.tt -%]

<script type="application/ld+json">
[% author.json_ld %]</script>
<p class="text-muted">[% template.title or 'Literature on TV' %]</p>
<p class="text-muted">Author</p>

<h1 class="display-3">[% author.name %]</h1>
[% IF author.born OR author.died %]
Expand All @@ -22,3 +23,4 @@
[% END %]

[% INCLUDE amazon.tt type='Books', search=author.name %]
[% INCLUDE footer.tt -%]
7 changes: 5 additions & 2 deletions in/authors.tt
@@ -1,7 +1,10 @@
[% META title = 'List of Authors' -%]
<h1 class="display-3">[% template.title or 'Literature on TV' %]</h1>
[% title = 'Authors' -%]
[% INCLUDE header.tt -%]

<h1 class="display-3">[% title or 'Literature on TV' %]</h1>
<ul>
[% FOREACH author IN authors.all.sort('name') -%]
<li><a href="/authors/[% author.slug %]/">[% author.name %]</a></li>
[% END -%]
</ul>
[% INCLUDE footer.tt -%]
8 changes: 5 additions & 3 deletions in/character.tt
@@ -1,11 +1,12 @@
[% META title = 'Character' %]
[% title = character.name %]
[% INCLUDE header.tt -%]

<script type="application/ld+json">
[% character.json_ld %]</script>
<p class="text-muted">[% template.title or 'Literature on TV' %]</p>
<p class="text-muted">Character</p>

<h1 class="display-3">[% character.name %]</h1>
[% IF character.imdb %]<p><a href="http://imdb.com/character/[% fictionalcharacter.imdb %]">[% fictionalcharacter.name %] on IMDB</a></p>[% END %]
[% IF character.imdb %]<p><a href="http://imdb.com/character/[% character.imdb %]">[% character.name %] on IMDB</a></p>[% END %]
<h3>Appearances</h3>
[% IF character.works.size %]
<ul>
Expand Down Expand Up @@ -33,3 +34,4 @@ by
[% ELSE %]
<p>No-one</p>
[% END %]
[% INCLUDE footer.tt -%]
6 changes: 4 additions & 2 deletions in/characters.tt
@@ -1,9 +1,11 @@
[% META title = 'List of Characters' -%]
[% title = 'Characters' -%]
[% INCLUDE header.tt -%]

<h1 class="display-3">[% template.title or 'Literature on TV' %]</h1>
<h1 class="display-3">[% title or 'Literature on TV' %]</h1>

<ul>
[% FOREACH ch IN characters.all.sort('name')-%]
<li><a href="/characters/[% ch.slug %]/">[% ch.name %]</a></li>
[% END -%]
</ul>
[% INCLUDE footer.tt -%]
4 changes: 3 additions & 1 deletion in/index.tt
@@ -1,4 +1,5 @@
[% META title = '' %]
[% title = '' -%]
[% INCLUDE header.tt -%]

[% INCLUDE modal.tt %]

Expand All @@ -12,3 +13,4 @@
<li>By <a href="/productions/">productions</a></li>
<li>By <a href="/actors/">actors</a></li>
</ul>
[% INCLUDE footer.tt %]
6 changes: 4 additions & 2 deletions in/production.tt
@@ -1,8 +1,9 @@
[% META title = 'Production' %]
[% title = production.title -%]
[% INCLUDE header.tt -%]

<script type="application/ld+json">
[% production.json_ld %]</script>
<p class="text-muted">[% template.title or 'Literature on TV' %]</p>
<p class="text-muted">Production</p>

<h1 class="display-3">[% production.title %]</h1>
<p>[% production.description %]<p>
Expand All @@ -27,3 +28,4 @@ as <a href="/characters/[% a.character.slug %]/">[% a.character.name %]</a></li>
[% END %]

[% INCLUDE amazon.tt type='DVD', search=production.title %]
[% INCLUDE footer.tt -%]
7 changes: 4 additions & 3 deletions in/productions.tt
@@ -1,11 +1,12 @@
[% # Provide a title -%]
[% META title = 'List of Productions' -%]
[% title = 'Productions' -%]
[% INCLUDE header.tt -%]

<h1 class="display-3">[% template.title or 'Literature on TV' %]</h1>
<h1 class="display-3">[% title or 'Literature on TV' %]</h1>

<ul>
[% FOREACH p IN productions.all.sort('year', 'title')-%]
<li><a href="/productions/[% p.slug %]/">[% p.title %]</a>
([% p.description %])</li>
[% END -%]
</ul>
[% INCLUDE footer.tt -%]
6 changes: 4 additions & 2 deletions in/work.tt
@@ -1,8 +1,9 @@
[% META title = 'Work' %]
[% title = work.title -%]
[% INCLUDE header.tt -%]

<script type="application/ld+json">
[% work.json_ld %]</script>
<p class="text-muted">[% template.title or 'Literature on TV' %]</p>
<p class="text-muted">Work</p>

<h1 class="display-3">[% work.title %]</h1>
<p>By [% FOR a IN work.authors; '<a href="/authors/'; a.slug; '/">'; a.name; '</a> '; END %]</p>
Expand All @@ -28,3 +29,4 @@
[% END %]

[% INCLUDE amazon.tt type='Books', search=work.title %]
[% INCLUDE footer.tt -%]
7 changes: 4 additions & 3 deletions in/works.tt
@@ -1,7 +1,7 @@
[% # Provide a title -%]
[% META title = 'List of Works' -%]
[% title = 'Works' -%]
[% INCLUDE header.tt -%]

<h1 class="display-3">[% template.title or 'Literature on TV' %]</h1>
<h1 class="display-3">[% title or 'Literature on TV' %]</h1>

<table>
<tr><th>Title</th><th>Author(s)</th></tr>
Expand All @@ -13,3 +13,4 @@
</tr>
[% END -%]
</table>
[% INCLUDE footer.tt -%]
2 changes: 1 addition & 1 deletion tt_lib/header.tt
Expand Up @@ -16,7 +16,7 @@
<meta name="author" content="">
<link rel="icon" href="../../../../favicon.ico">

<title>Literature on TV[% IF template.title; ': ' _ template.title; END %]</title>
<title>Literature on TV[% IF title; ': ' _ title; END %]</title>

<!-- Bootstrap core CSS -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
Expand Down

0 comments on commit 0d1a12e

Please sign in to comment.