Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
392b97e81a | ||
|
|
a5e276f633 | ||
|
|
fc453fe4fb | ||
|
|
32c83d6109 | ||
|
|
5e5c23d786 | ||
|
|
fa30565b6b |
@@ -1,6 +1,12 @@
|
||||
Revision history for MojoX-Renderer-TT
|
||||
|
||||
{{$NEXT}}
|
||||
- Support Mojolicious 'layout'/'extends' (Maxim Vuets, Marcus
|
||||
Ramberg)
|
||||
- Fix Strawberry Perl tests (RT#65282, Christiaan Kras, Ask)
|
||||
- Update bugtracker URL in META.yml
|
||||
|
||||
1.0 January 22, 2011
|
||||
- Require (and be compatible with) Mojolicious 1.0+
|
||||
- Added inline template support (Viacheslav Tykhanovskyi & Ask)
|
||||
- Fix inline rendering and test failures (Marcus Ramberg)
|
||||
|
||||
@@ -21,12 +21,11 @@ bundle = @Basic
|
||||
remove = Readme
|
||||
remove = Manifest
|
||||
|
||||
[Repository]
|
||||
repository = git://github.com/abh/mojox-renderer-tt.git
|
||||
web = https://github.com/abh/mojox-renderer-tt
|
||||
|
||||
[Bugtracker]
|
||||
web = https://github.com/abh/mojox-renderer-tt/issues
|
||||
[MetaResources]
|
||||
bugtracker.web = https://github.com/abh/mojox-renderer-tt/issues
|
||||
repository.web = http://github.com/abh/mojox-renderer-tt
|
||||
repository.url = git://github.com/abh/mojox-renderer-tt.git
|
||||
repository.type = git
|
||||
|
||||
[Homepage]
|
||||
|
||||
|
||||
@@ -71,6 +71,9 @@ sub _render {
|
||||
|
||||
my $helper = MojoX::Renderer::TT::Helper->new(ctx => $c);
|
||||
|
||||
# Purge previous result
|
||||
$$output = '';
|
||||
|
||||
my @params = ({%{$c->stash}, c => $c, h => $helper}, $output, {binmode => ':utf8'});
|
||||
$self->tt->{SERVICE}->{CONTEXT}->{LOAD_TEMPLATES}->[0]->ctx($c);
|
||||
|
||||
@@ -152,7 +155,7 @@ sub _template_content {
|
||||
my $self = shift;
|
||||
my ($path) = @_;
|
||||
|
||||
my ($t) = ($path =~ m{templates\/(.*)$});
|
||||
my ($t) = ($path =~ m{templates[\/|\\](.*)$});
|
||||
|
||||
if (-r $path) {
|
||||
return $self->SUPER::_template_content(@_);
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
/tmp/
|
||||
*.ttc
|
||||
+24
-3
@@ -5,7 +5,7 @@ use warnings;
|
||||
|
||||
use utf8;
|
||||
|
||||
use Test::More tests => 25;
|
||||
use Test::More tests => 31;
|
||||
|
||||
use Mojolicious::Lite;
|
||||
use Mojo::ByteStream 'b';
|
||||
@@ -24,7 +24,11 @@ get '/with_include' => 'include';
|
||||
|
||||
get '/with_wrapper' => 'wrapper';
|
||||
|
||||
#get '/with_auto_wrapper' => sub { shift->render(auto_wrapper => layout => 'layout') };
|
||||
get '/with_auto_wrapper' => 'auto_wrapper';
|
||||
|
||||
get '/inheritance_base' => 'inheritance_base';
|
||||
|
||||
get '/inheritance_derived' => 'inheritance_derived';
|
||||
|
||||
get '/unicode' => 'unicode';
|
||||
|
||||
@@ -53,7 +57,11 @@ $t->get_ok('/with_include')->content_is("HelloInclude!Hallo");
|
||||
$t->get_ok('/with_wrapper')->content_is("wrapped");
|
||||
|
||||
# With auto wrapper
|
||||
#$t->get_ok('/with_auto_wrapper')->content_is("wrapped");
|
||||
$t->get_ok('/with_auto_wrapper')->content_is("wrapped");
|
||||
|
||||
# Inheritance
|
||||
$t->get_ok('/inheritance_base')->content_is("untouched");
|
||||
$t->get_ok('/inheritance_derived')->content_is("edited");
|
||||
|
||||
# Unicode
|
||||
$t->get_ok('/unicode')->content_is("привет");
|
||||
@@ -100,9 +108,22 @@ w[%- content -%]d
|
||||
rappe
|
||||
[%- END -%]
|
||||
|
||||
@@ layouts/auto_layout.html.tt
|
||||
w[%- h.content -%]d
|
||||
|
||||
@@ auto_wrapper.html.tt
|
||||
[% CALL h.layout('auto_layout') %]
|
||||
rappe
|
||||
|
||||
@@ inheritance_base.html.tt
|
||||
[% verb = BLOCK %]untouch[% END %]
|
||||
[% h.content('verb', verb) %]ed
|
||||
|
||||
@@ inheritance_derived.html.tt
|
||||
[% CALL h.extends('inheritance_base') %]
|
||||
[% verb = BLOCK %]edit[% END %]
|
||||
[% h.content('verb', verb) %]
|
||||
|
||||
@@ unicode.html.tt
|
||||
привет
|
||||
|
||||
|
||||
Reference in New Issue
Block a user