Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
226 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package MyFeedReader::View::TT; | ||
|
||
use strict; | ||
use base 'Catalyst::View::TT'; | ||
|
||
__PACKAGE__->config({ | ||
INCLUDE_PATH => [ | ||
MyFeedReader->path_to( 'root', 'src' ), | ||
MyFeedReader->path_to( 'root', 'lib' ) | ||
], | ||
PRE_PROCESS => 'config/main', | ||
WRAPPER => 'site/wrapper', | ||
ERROR => 'error.tt2', | ||
TIMER => 0, | ||
TEMPLATE_EXTENSION => '.tt2', | ||
}); | ||
|
||
=head1 NAME | ||
MyFeedReader::View::TT - Catalyst TTSite View | ||
=head1 SYNOPSIS | ||
See L<MyFeedReader> | ||
=head1 DESCRIPTION | ||
Catalyst TTSite View. | ||
=head1 AUTHOR | ||
,,, | ||
=head1 LICENSE | ||
This library is free software, you can redistribute it and/or modify | ||
it under the same terms as Perl itself. | ||
=cut | ||
|
||
1; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[% site.rgb = { | ||
black = '#000000' | ||
white = '#ffffff' | ||
grey1 = '#46494c' | ||
grey2 = '#c6c9cc' | ||
grey3 = '#e3e6ea' | ||
red = '#CC4444' | ||
green = '#66AA66' | ||
blue = '#89b8df' | ||
orange = '#f08900' | ||
}; | ||
|
||
site.col = { | ||
page = site.rgb.white | ||
text = site.rgb.grey1 | ||
head = site.rgb.grey3 | ||
line = site.rgb.orange | ||
message = site.rgb.green | ||
error = site.rgb.red | ||
}; | ||
-%] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[% # config/main | ||
# | ||
# This is the main configuration template which is processed before | ||
# any other page, by virtue of it being defined as a PRE_PROCESS | ||
# template. This is the place to define any extra template variables, | ||
# macros, load plugins, and perform any other template setup. | ||
|
||
IF Catalyst.debug; | ||
# define a debug() macro directed to Catalyst's log | ||
MACRO debug(message) CALL Catalyst.log.debug(message); | ||
END; | ||
|
||
# define a data structure to hold sitewide data | ||
site = { | ||
title => 'MyFeedReader - a simple feed reader', | ||
}; | ||
|
||
# load up any other configuration items | ||
PROCESS config/col | ||
+ config/url; | ||
|
||
# set defaults for variables, etc. | ||
DEFAULT | ||
message = 'There is no message'; | ||
|
||
-%] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[% base = Catalyst.req.base; | ||
|
||
site.url = { | ||
base = base | ||
home = "${base}welcome" | ||
message = "${base}message" | ||
} | ||
-%] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<!-- BEGIN site/footer --> | ||
<!-- END site/footer --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<!-- BEGIN site/header --> | ||
<h1 class="title">[% template.title or site.title %]</h1> | ||
<!-- END site/header --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | ||
<html> | ||
<head> | ||
<title>[% template.title or site.title %]</title> | ||
<style type="text/css"> | ||
[% PROCESS ttsite.css %] | ||
</style> | ||
</head> | ||
<body> | ||
[% content %] | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div id="header">[% PROCESS site/header %]</div> | ||
|
||
<div id="content"> | ||
[% content %] | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[% IF template.name.match('\.(css|js|txt)'); | ||
debug("Passing page through as text: $template.name"); | ||
content; | ||
ELSE; | ||
debug("Applying HTML page layout wrappers to $template.name\n"); | ||
content WRAPPER site/html + site/layout; | ||
END; | ||
-%] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<h1><a href="[% entry.permalink %]">[% entry.title %]</a></h1> | ||
<span>Posted [% entry.date %] by [% entry.author %]</span> | ||
<div id="content"> | ||
[% entry.content %] | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[% META title = 'Catalyst/TT Error' %] | ||
<p> | ||
An error has occurred. We're terribly sorry about that, but it's | ||
one of those things that happens from time to time. Let's just | ||
hope the developers test everything properly before release... | ||
</p> | ||
<p> | ||
Here's the error message, on the off-chance that it means something | ||
to you: <span class="error">[% error %]</span> | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<ul> | ||
[% FOREACH feed IN feeds %] | ||
<li><a href="/feed/view/[% feed.id %]">[% feed.url %]</a></li> | ||
[% END %] | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<h1>[% feed.url %]</h1> | ||
|
||
<h3>entries</h3> | ||
<ul> | ||
[% FOREACH entry IN feed.entries %] | ||
<li><a href="/entry/[% entry.id %]">[% entry.permalink %]</a></li> | ||
[% END %] | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
to <a href="/feed/">your feeds</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[% META title = 'Catalyst/TT View!' %] | ||
<p> | ||
Yay! You're looking at a page generated by the Catalyst::View::TT | ||
plugin module. | ||
</p> | ||
<p> | ||
We have a message for you: <span class="message">[% message %]</span>. | ||
</p> | ||
<p> | ||
Why not try updating the message? Go on, it's really exciting, honest! | ||
</p> | ||
<form action="[% site.url.message %]" | ||
method="POST" enctype="application/x-www-form-urlencoded"> | ||
<input type="text" name="message" value="[% message %]" /> | ||
<input type="submit" name="submit" value=" Update Message "/> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
html { | ||
height: 100%; | ||
} | ||
|
||
body { | ||
background-color: [% site.col.page %]; | ||
color: [% site.col.text %]; | ||
margin: 0px; | ||
padding: 0px; | ||
height: 100%; | ||
} | ||
|
||
#header { | ||
background-color: [% site.col.head %]; | ||
border-bottom: 1px solid [% site.col.line %]; | ||
} | ||
|
||
#footer { | ||
background-color: [% site.col.head %]; | ||
text-align: center; | ||
border-top: 1px solid [% site.col.line %]; | ||
position: absolute; | ||
bottom: 0; | ||
left: 0px; | ||
width: 100%; | ||
padding: 4px; | ||
} | ||
|
||
#content { | ||
padding: 10px; | ||
} | ||
|
||
h1.title { | ||
padding: 4px; | ||
margin: 0px; | ||
} | ||
|
||
.message { | ||
color: [% site.col.message %]; | ||
} | ||
|
||
.error { | ||
color: [% site.col.error %]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[% META title = 'Catalyst/TT View!' %] | ||
<p> | ||
Yay! You're looking at a page generated by the Catalyst::View::TT | ||
plugin module. | ||
</p> | ||
<p> | ||
This is the welcome page. Why not try the equally-exciting | ||
<a href="[% site.url.message %]">Message Page</a>? | ||
</p> |