Changes C::V::ByCode
--------------------
0) BUGS/CHANGES:
- add a config directive (or more?) to add tags
block_tags => [qw(section paragraph)],
inline_tags => [qw(audio video)],
head_tags => [qw(foo bar)]
- is there an easier way to create tables?
- is there a way to iterate over lists creating repeating things easier?
eg navigation entries as li-a, error-lists as li
- is there a way to split text and handle the parts in a smart way?
eg. Bold for *xxx* or wrapping www.xxx.tld with a link-tag?
### done 2010-04-06
- ->process(), ->render() -- create a test that verifies Actions with
or without :Args()
### done 2010-03-31
- disabled|checked|selected => 1 as shortcut for x => 'x'
- what about a params() that allows easy key/value pairs for applet/object tags...
### done 2010-03-01
- find a way to add a Devel::Declare Handler if a 'block xxx' defined
sub is imported into another template.
==> @exporting_package::EXPORT_BLOCK -- contains a list of all blocks defined
==> &C::V::B::Renderer::_export_blocks() does the job.
### fixed
- a(href => c->uri_for_action('concept/detail', $concept->ola_concept_id), title => 'Details', class => 'ajax', 'data-target' => '-new', 'data-title' => 'Detail') {
works
### fixed
- a(href => c->uri_for_action('concept/detail', $concept->ola_concept_id),
title => 'Details',
class => 'ajax',
'data-target' => '-new',
'data-title' => 'Detail')
omits everything after href...
### done 2010-02-23
- how would
a(data_target => '-new' , ...)
a(dataTarget => '-new' , ...)
a(style => {zIndex => 999})
look like???
- div { class => '+some_class' }; # add a class name
div { class => '-some_class' }; # remove a class name
div { class => ' -some_class' }; # replace class name (BAD BUT FUNCTIONAL)
1) IDEA: how to build extensible things
directory schema:
lib/My/Stuff/
Thing.pm
Controller/
-- problem: must become MyApp::Controller::Xxx
View/
-- problem: must become MyApp::View::Xxx
root/
-- problem: add on top of /root dir in MyApp main folder
static/
js/
thing.js
css/
thing.css
images/
...
forms/
usage inside app:
(1)
use Catalyst qw( ... SearchPath ...);
__PACKAGE__->add_search_package( ... );
(2)
use Catalyst qw (... APackageWithSearchPath ... );
__PACKAGE__->config(...);
__PACKAGE__->setup();
things to define:
- does first match win? or last? which is better?
example:
block draw_nav {
my $navigation = attr('navigation');
my $selected = attr('selected');
my $id = attr('id');
my $class = attr('class');
return if (!$navigation);
ul {
id $id if ($id);
class $class if ($class);
foreach my $nav (@{$navigation}) {
li {
a(href => nav_uri($nav->parent
? stash->{selected_navigation}->url_part
: (),
$nav->url_part)) {
class 'selected'
if ($selected && $nav->id == $selected->id);
$nav->name;
};
};
}
};
};
block infobox {
my $id = attr('id');
my $headline = attr('headline') || 'untitled';
div.infobox {
id $id if ($id);
div.infobox_head { $headline };
div.infobox_content { block_content };
};
};
template {
doctype 'xhtml';
html {
head {
title { stash->{title} || 'Seite Ohne Titel' };
load Js => 'site.js';
load Css => 'site.css';
};
body {
yield body_start;
div header.class1.class2 {
a(href => c->uri_for_action('/home')) {
img.logo(src => '/static/images/logo.png');
};
draw_nav topnav(navigation => ..., selected => ...);
div.searchform { stash->{searchform}; };
};
div content {
yield;
infobox leftbox(headline => 'just an info') { ... some content ... };
};
div footer {
# something
yield footer;
};
yield body_end;
};
};
};