Changes C::V::ByCode
--------------------

0) BUGS/CHANGES:
   ### 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;
       };
   };
};




