+++ /dev/null
-=head1 NAME
-
-Reaction::Class - Reaction class declaration syntax
-
-=head1 SYNOPSIS
-
-In My/Person.pm:
-
-=for example My::Person setup
-
- package My::Person;
-
- use Reaction::Class;
- use Reaction::Types::Core qw/Str/;
-
- class Person which {
-
- has 'name' => Str;
-
- has 'nickname' => optional Str;
-
- implements 'preferred_name' which {
- accepts nothing;
- returns Str;
- guarantees when { $self->has_nickname } returns { $self->nickname };
- guarantees when { !$self->has_nickname } returns { $self->name };
- } with {
- return ($self->has_nickname ? $self->nickname : $self->name);
- };
-
- };
-
-=for example My::Person tests
-
-=begin tests
-
-my $meta = My::Person->meta;
-
-isa_ok($meta, 'Reaction::Meta::Class');
-
-my $attr_map = $meta->get_attribute_map;
-
-foreach my $attr_name (qw/name nickname/) {
- isa_ok($attr_map->{$attr_name}, 'Reaction::Meta::Attribute');
-}
-
-ok($attr_map->{name}->is_required, 'name is required');
-ok(!$attr_map->{nickname}->is_required, 'nickname is optional');
-
-=end tests
-
-In your code -
-
-=for example My::Person usage
-
- my $jim = My::Person->new(name => 'Jim');
-
- print $jim->name."\n"; # prints "Jim\n"
-
- print $jim->preferred_name."\n"; # prints "Jim\n"
-
- $jim->name('James'); # returns 'James'
-
- $jim->nickname('Jim'); # returns 'Jim'
-
- print $jim->preferred_name."\n"; # prints "Jim\n"
-
- $jim->preferred_name('foo'); # throws Reaction::Exception::MethodArgumentException
-
-=for example My::Person end
-
-=head1 DESCRIPTION
-
-=head1 AUTHORS
-
-See L<Reaction::Class> for authors.
-
-=head1 LICENSE
-
-See L<Reaction::Class> for the license.
-
-=cut
+++ /dev/null
-package Reaction::UI::Renderer::XHTML;
-
-use strict;
-use base qw/Catalyst::View::TT Reaction::Object/;
-use Reaction::Class;
-
-use HTML::Entities;
-
-__PACKAGE__->config({
- CATALYST_VAR => 'ctx',
- RECURSION => 1,
-});
-
-sub render_window {
- my ($self, $window) = @_;
- my $root_vp = $window->focus_stack->vp_head;
- confess "Can't flush view for window with empty focus stack"
- unless defined($root_vp);
- $self->render_viewport($window, $root_vp);
-}
-
-sub render_viewport {
- my ($self, $window, $vp) = @_;
- my $ctx = $window->ctx;
- my %args = (
- self => $vp,
- ctx => $ctx,
- window => $window,
- type => $vp->layout
- );
- unless (length $args{type}) {
- my $type = (split('::', ref($vp)))[-1];
- $args{type} = lc($type);
- }
- return $self->render($ctx, 'component', \%args);
-}
-
-around 'render' => sub {
- my $super = shift;
- my ($self,$args) = @_[0,3];
- local $self->template->{SERVICE}{CONTEXT}{BLKSTACK};
- local $self->template->{SERVICE}{CONTEXT}{BLOCKS};
- $args->{process_attrs} = \&process_attrs;
- return $super->(@_);
-};
-
-sub process_attrs{
- my $attrs = shift;
- return $attrs unless ref $attrs eq 'HASH';
-
- my @processed_attrs;
- while( my($k,$v) = each(%$attrs) ){
- my $enc_v = $v;
- next if ($enc_v eq "");
- if ($k eq 'class' && ref $v eq 'ARRAY'){
- $enc_v = join ' ', map { encode_entities($_) } @$v;
- } elsif ($k eq 'style' && ref $v eq 'HASH'){
- $enc_v = join '; ', map{ "${_}: ".encode_entities($v->{$_}) } keys %{$v};
- }
- push(@processed_attrs, "${k}=\"${enc_v}\"");
- }
-
- return ' '.join ' ', @processed_attrs if (scalar(@processed_attrs) > 0);
- return;
-}
-
-1;
-
-=head1 NAME
-
-Reaction::UI::Renderer::XHTML
-
-=head1 DESCRIPTION
-
-=head1 METHODS
-
-=head2 render
-
-=head2 process_attrs
-
-=head1 AUTHORS
-
-See L<Reaction::Class> for authors.
-
-=head1 LICENSE
-
-See L<Reaction::Class> for the license.
-
-=cut
+++ /dev/null
-[%
-
-attrs.enctype = 'multipart/form-data';
-PROCESS form_base;
-
-%]
+++ /dev/null
-[%
-
-PROCESS listview;
-
-table_end_block = 'bar_list_table_end';
-
-BLOCK bar_list_table_end;
-
- "\n</table>\n";
- include( 'create_link_block' );
- "\n<br />\n";
-
- enctype = attrs.enctype || 'application/x-www-form-urlencoded';
- %]<form action="[% connect_form %]" method="post" enctype="[% enctype %]"[%
- attrs.enctype = ''; process_attrs(self.attrs); '>';
- INCLUDE component type = 'search_base' attrs.value = 'xxx';
- "\n</form>";
-
-END;
-
-%]
+++ /dev/null
-[% PROCESS form_base %]
+++ /dev/null
-[%
-
-PROCESS field_base;
-
-main_block = 'button_control';
-
-BLOCK button_control;
-
- %]<input type="[% button_type || 'submit' %]" [%
- IF attrs.value == '';
- 'value="'; loc(self.value) | html; '" ';
- END;
- connect_control(self, self.event);
- process_attrs(attrs) %] />[%
-# IF self.img_src;
-# INCLUDE component type = 'image';
-# ELSE;
-
-END;
-
-%]
+++ /dev/null
-[%
-
-PROCESS button;
-
-control_block = 'cancelbtn_control';
-
-BLOCK cancelbtn_control;
-
- INCLUDE button_control attrs.value = 'Cancel' self.event = 'close';
-
-END;
-
-%]
+++ /dev/null
-[%
-
-PROCESS field_base;
-
-control_block = 'checkbox_control';
-
-BLOCK checkbox_control;
-
- %]<input type="checkbox" id="[% id_attr %]" [%
- connect_control(self, 'value');
- process_attrs(attrs);
- IF self.value;
- ' checked="checked"';
- END;
- UNLESS attrs.value;
- ' value="1"';
- END;
- %] />[%
-
-END;
-
-%]
+++ /dev/null
-[%
-
-PROCESS field_base;
-
-control_block = 'checkbox_group_control';
-
-BLOCK checkbox_group_control;
-
- FOREACH v_name IN self.valid_value_names;
- v_val = self.name_to_value_map.$v_name;
- %]<input type="checkbox" id="[% id_attr %]" [% connect_control(self, 'value');
- ' value="'; v_val; '"';
- IF self.is_current_value(v_val); ' checked="checked"'; END;
- process_attrs(attrs); ' />'; v_name; "\n";
- END;
-
-END;
-
-%]
+++ /dev/null
-[%-
-
-GLOBAL_DEBUG = ctx.debug;
-
-MACRO loc(text, args) BLOCK;
-
- ctx.localize(text, args);
-
-END;
-
-MACRO include(name, args) BLOCK;
-
- filename = ${name};
-
- IF filename;
- IF GLOBAL_DEBUG;
- '<!-- Start block '; name | html; ' calling '; filename | html; " -->\n";
- END;
- INCLUDE $filename args;
- IF GLOBAL_DEBUG;
- '<!-- End block '; name | html; " -->\n";
- END;
- ELSE;
- error = 'Chosen INCLUDE ' _ name _ ' is empty';
- THROW file error;
- END;
-
-END;
-
-MACRO connect_form(vp, event) BLOCK;
-
- '';
-
-END;
-
-MACRO connect_control(vp, event, value) BLOCK;
-
- 'name="'; vp.event_id_for(event); '"';
-
-END;
-
-MACRO connect_href(vp, events) BLOCK;
-
- FOREACH event = events.keys;
- evt_args.${vp.event_id_for(event)} = events.$event;
- END;
- 'href="'; ctx.req.uri_with(evt_args); '"';
-
-END;
-
-UNLESS type;
- errmsg = "type is empty rendering " _ self;
- THROW file errmsg;
-END;
-
-PROCESS $type;
-
-IF GLOBAL_DEBUG; '<!-- Rendering component '; type | html; " -->\n"; END;
-
-include( 'main_block' );
-
-IF GLOBAL_DEBUG; '<!-- End component '; type | html; " -->\n"; END;
-
--%]
+++ /dev/null
-[%
-
-PROCESS displayfield_base;
-
-control_block = 'list_control';
-
-BLOCK list_control;
-
- "<ul>\n";
- FOREACH v_val IN self.value_names;
- ' <li>'; v_val | html; "</li>\n";
- END;
- "</ul>\n";
-
-END;
-
-%]
+++ /dev/null
-[%
-
-PROCESS displayfield_base;
-
-control_block = 'string_control';
-
-BLOCK string_control;
-
- self.value | html;
-
-END;
-
-%]
+++ /dev/null
-[%
-
-PROCESS displayfield_base;
-
-control_block = 'text_control';
-
-BLOCK text_control;
-
- self.value | html;
-
-END;
-
-%]
+++ /dev/null
-[%
-
-PROCESS displayfield_base;
-
-control_block = 'vstring_control';
-
-BLOCK vstring_control;
-
- self.value_string | html;
-
-END;
-
-%]
+++ /dev/null
-[%-
-
-main_block = 'displayfield_base_field';
-
-control_block = 'displayfield_base_control';
-
-BLOCK displayfield_base_field;
-
- IF self.label;
- '<label>'; loc(self.label); '</label>: ';
- END;
-
- include( 'control_block' );
-
-END;
-
-BLOCK displayfield_base_control;
-
- "CONTROL";
-
-END;
-
--%]
+++ /dev/null
-[%
-
-PROCESS field_base;
-
-control_block = 'textfield_control';
-
-BLOCK textfield_control;
-
- attrs.maxlength = '255'; # SimpleStr requires <= 255
- %]<input type="text" [% IF id_attr; 'id="'; id_attr; '"'; END; connect_control(self, 'value_string');
- ' value="'; self.value_string | html; '"'; process_attrs(attrs) %] />[%
- attrs.maxlength = '';
-
-END;
-
-%]
+++ /dev/null
-[%
-
-PROCESS select_group;
-
-control_block = 'dual_select_group_control';
-
-BLOCK dual_select_group_control;
-
- -%]</p><table[% process_attrs(attrs) %]>
- <tr>
- <td>
-[%- self.label = ''; self.tmp_message = self.message; self.message = '';
- values_list_type = 'available_values';
- INCLUDE component type = 'select_group' self.hide_selected = 1 attrs.size = 10 attrs.name = 'add_values' | indent(4);
- attrs.name = ''; attrs.size = ''; %]
- </td><td align="center">[%
- INCLUDE component type = 'submitbtn' attrs.value = '>>' self.event = 'add_all_values' | indent(4);
- '<br />';
- INCLUDE component type = 'submitbtn' attrs.value = '>' self.event = 'do_add_values' | indent(4);
- '<br />';
- INCLUDE component type = 'submitbtn' attrs.value = '<' self.event = 'do_remove_values' | indent(4);
- '<br />';
- INCLUDE component type = 'submitbtn' attrs.value = '<<' self.event = 'remove_all_values' | indent(4); %]
- </td><td>
-[%- attrs.value = '';
- values_list_type = 'current_values';
- INCLUDE component type = 'select_group' self.hide_selected = 1 attrs.size = 10 attrs.name = 'remove_values' | indent(4);
- attrs.name = ''; attrs.size = '';
-
- FOREACH v_val IN self.current_values;
- v_val = self.obj_to_str(v_val);
- INCLUDE component type = 'hidden' self.val = v_val attrs = '' | indent(4);
- END;
-
-# self.message = self.tmp_message; self.tmp_message = ''; %]
- </td>
- </tr>[%
- %]</table><p>[%
-
-END;
-
-%]
+++ /dev/null
-[%
-
-main_block = 'error_404_main';
-
-BLOCK error_404_main;
-
- loc("404 Not Found");
-
- %] <a href="[% ctx.uri_for(ctx.action.chain.0.attributes.Chained.0) %]">[%
-
- loc("Return to root");
-
- %]</a>[%
-
-END;
-
-%]
+++ /dev/null
-[%-
-
-main_block = 'field_base_field';
-
-control_block = 'field_base_control';
-
-BLOCK field_base_field;
-
- IF self.label;
- '<label>'; loc(self.label); '</label>: ';
- END;
-
- include( 'control_block' );
-
- IF self.message;
- "\n<span>"; loc(self.message); '</span>';
- END;
-
-END;
-
-BLOCK field_base_control;
-
- "CONTROL";
-
-END;
-
--%]
+++ /dev/null
-[%
-
-PROCESS field_base;
-
-control_block = 'fieldset_control';
-
-BLOCK fieldset_control;
-
- %]<fieldset id="[% self.field_name | html %]"[% process_attrs(attrs) %] />[%
- IF self.text;
- '<legend>'; self.text; '</legend>';
- END;
-
-# INCLUDE( 'control_block' );
-
- %]</fieldset>[%
-
-END;
-
-%]
+++ /dev/null
-[%
-
-PROCESS field_base;
-
-control_block = 'fileselect_control';
-
-BLOCK fileselect_control;
-
- %]<input type="file" [% IF id_attr; 'id="'; id_attr; '"'; END; connect_control(self, 'value');
- # browsers ignore this for security reasons, can be uncommented for testing.
- # ' value="'; self.value.filename | html; '"';
- process_attrs(attrs) %] />[%
-
-END;
-
-%]
+++ /dev/null
-[%-
-
-#main_block = 'footer';
-
-#BLOCK footer;
-
- %]<p>FOOTER</p>
- [%
-
-#END;
-
--%]
+++ /dev/null
-[%
-
-main_block = 'form_base_control';
-
-control_block = 'form_base_control';
-
-header_block = 'form_base_header';
-fields_block = 'form_base_fields';
-button_block = 'form_base_buttons';
-footer_block = 'form_base_footer';
-
-form_id = 0;
-
-BLOCK form_base_control;
-
- form_id = form_id + 1;
-
- enctype = attrs.enctype || 'multipart/form-data';
- %]<form action="[% attrs.action || connect_form %]" method="post" id="element_[% form_id %]" enctype="[% enctype %]"[%
- IF attrs.name != ""; ' name="'; attrs.name; attrs.name = ''; '"'; END;
- attrs.enctype = ''; attrs.action = '';
- process_attrs(self.attrs) %]>[% "\n";
-
- include( 'header_block' );
- include( 'fields_block' );
-
- id_attr = ''; '<p>';
- include( 'button_block' );
- include( 'footer_block' );
-
- "</p>\n</form>";
-
-END;
-
-BLOCK form_base_header;
-
- '';
-
-END;
-
-BLOCK form_base_fields;
-
- FOREACH f_name = self.field_names;
- field = self.fields.$f_name;
- id = form_id _ '_' _ loop.count;
- '<p>'; window.render_viewport(field); "</p>\n";
- END;
-
-END;
-
-BLOCK form_base_buttons;
-
- allowed_events = self.accept_events;
-
- IF allowed_events.grep('^ok$').size;
- INCLUDE component type = 'submitbtn' self.value = 'ok' self.event = 'ok' self.label = self.ok_label;
- END;
-
- IF (self.field_names.size != 0) && (allowed_events.grep('^apply$').size);
- INCLUDE component type = 'submitbtn' self.value = 'apply' self.event = 'apply' self.label = self.apply_label;
- END;
-
- IF allowed_events.grep('^close$').size;
- INCLUDE component type = 'cancelbtn' self.value = 'cancel' self.event = 'close' self.label = self.cancel_label;
- END;
-
-END;
-
-BLOCK form_base_footer;
-
- IF self.message;
- ' <span>'; self.message; '</span>';
- END;
-
-END;
-
-%]
+++ /dev/null
-[%-
-
-#main_block = 'header_block';
-
-#BLOCK header_block;
-
- %]<p>HEADER</p>[%
-
-#END;
-
--%]
+++ /dev/null
-[%
-
-PROCESS field_base;
-
-control_block = 'hidden_control';
-
-BLOCK hidden_control;
-
- name = attrs.name || 'value'; attrs.name = '';
- %]<input type="hidden" [% IF id_attr; 'id="'; id_attr; '"'; END; connect_control(self, name);
- ' value="'; self.val; '"'; process_attrs(attrs) %] />[%
-
-END;
-
-%]
+++ /dev/null
-[%
-
-PROCESS field_base;
-
-control_block = 'hiddenarray_control';
-
-BLOCK hiddenarray_control;
-
- name = attrs.name || 'value'; attrs.name = '';
- FOREACH val IN self.value;
- %]<input type="hidden" [% IF id_attr; 'id="'; id_attr; '"'; END; connect_control(self, name);
- ' value="'; val; '"'; process_attrs(attrs) %] />[% "\n";
- END;
-
-END;
-
-%]
+++ /dev/null
-[%
-
-main_block = 'image_base';
-
-BLOCK image_base;
-
- %]<img src="[% self.img_src | html %]" alt="[% self.text | html %]"[% process_attrs(attrs) %] />[%
-
-END;
-
-%]
+++ /dev/null
-[%
-
-PROCESS field_base;
-
-control_block = 'label_control';
-
-BLOCK label_control;
-
- %]<label id="[% self.field_name | html %]" [% connect_control(self, 'value') %] value="[% self.field_value | html %]" />[%
-
-# INCLUDE( 'control_block' );
-
- '</label>';
-
-END;
-
-%]
+++ /dev/null
-[%
-
-PROCESS listview_base;
-
-header_field_block = 'listview_header_field';
-
-BLOCK listview_header_field;
-
- desc = 0;
- IF (self.order_by == field_name && !self.order_by_desc);
- desc = 1;
- ELSE;
- desc = 0;
- END;
-
- "\n <th"; process_attrs(attrs); '><a '; connect_href(self, order_by => field_name, order_by_desc => desc); '>';
- loc(self.field_label(field_name)); '</a></th>';
-
-END;
-
-header_block = 'listview_header';
-
-BLOCK listview_header;
-
- INCLUDE listview_base_header;
- IF self.row_action_prototypes.size;
- %]
- <th colspan="[% self.row_action_prototypes.size %]"[%
- process_attrs(attrs); %]>[% loc('Actions'); %]</th>[%
- END;
-
-END;
-
-row_block = 'listview_row';
-
-BLOCK listview_row;
-
- INCLUDE listview_base_row;
- FOREACH action IN self.row_actions_for(row);
- %] <td[% process_attrs(attrs); %]><a href="[% action.uri %]">[%
- loc(action.label) %]</a></td>[%
- IF loop.last == 0; "\n"; END;
- END;
-
-END;
-
-row_field_block = 'listview_row_field';
-
-BLOCK listview_row_field;
-
- field_value = field_value || row.$f_name;
-
- IF field_value.isa('DateTime');
- field_value = field_value.strftime("%F %H:%M:%S");
- END;
- INCLUDE listview_base_row_field;
-
-END;
-
-%]
+++ /dev/null
-[%
-
-main_block = 'listview_base_main';
-
-table_start_block = 'listview_base_table_start';
-table_end_block = 'listview_base_table_end';
-row_block = 'listview_base_row';
-row_field_block = 'listview_base_row_field';
-header_block = 'listview_base_header';
-header_field_block = 'listview_base_header_field';
-footer_block = 'listview_base_footer';
-footer_field_block = 'listview_base_footer_field';
-create_link_block = 'listview_base_create';
-
-show_footer = 1;
-
-BLOCK listview_base_main;
-
- include( 'table_start_block' ); %]
- <thead>
- <tr>[% include( 'header_block' ) | indent(4); %]
- </tr>
- </thead>[%
-
- IF show_footer && self.footer_field_names.size != '';
- "\n <tfoot>";
- include( 'footer_block' ) | indent(4);
- "\n </tfoot>";
- END;
-
- %]
- <tbody>
- [%
-
- FOREACH row = self.current_rows;
- "<tr>\n";
- include( 'row_block' ) | indent(4);
- "\n </tr>";
- END; %]
- </tbody>[%
-
- include( 'table_end_block' );
-
-END;
-
-BLOCK listview_base_table_start;
-
- #IF self.has_per_page;
- IF self.has_per_page && self.pager.last_page > self.pager.first_page;
- INCLUDE component type = 'pager';
- END;
-
- %]<table>[%
-
-END;
-
-BLOCK listview_base_table_end;
-
- "\n</table>\n";
- include( 'create_link_block' );
-
-END;
-
-BLOCK listview_base_row;
-
- FOREACH f_name = self.field_names;
- include( 'row_field_block' );
- END;
-
-END;
-
-BLOCK listview_base_row_field;
-
- field_value = field_value || row.$f_name;
- IF field_value.can('display_name'); field_value = field_value.display_name; END;
- ' <td'; process_attrs(attrs); '>'; field_value || row.$f_name; "</td>\n";
-
-END;
-
-BLOCK listview_base_header;
-
- FOREACH field_name = self.field_names;
- include( 'header_field_block' );
- END;
-
-END;
-
-BLOCK listview_base_header_field;
-
- "\n<th>"; self.field_label(field_name); '</th>';
-
-END;
-
-BLOCK listview_base_footer;
-
- "\n<tr>";
-
- FOREACH footer_field_name = self.footer_field_names;
- include( 'footer_field_block' );
- END;
-
- '</tr>';
-
-END;
-
-BLOCK listview_base_footer_field;
-
- "\n <td>"; self.field_label(footer_field_name); '</td>';
-
-END;
-
-BLOCK listview_base_create;
-
- '<p>';
- action = ctx.controller.action_for('create');
- IF action;
- action = ctx.uri_for(action);
- '<a href="'; action; '">'; loc("Create record"); '</a>';
- END;
- '</p>';
-
-END;
-
-%]
+++ /dev/null
-[% PROCESS view_base %]
+++ /dev/null
-[%
-
-main_block = 'pager_main';
-
-start_block = 'pager_start';
-prev_block = 'pager_prev';
-current_block = 'pager_current';
-next_block = 'pager_next';
-end_block = 'pager_end';
-list_block = 'pager_list';
-
-start_label_block = 'pager_start_label';
-prev_label_block = 'pager_prev_label';
-current_label_block = 'pager_current_label';
-next_label_block = 'pager_next_label';
-end_label_block = 'pager_end_label';
-list_label_block = 'pager_list_label';
-
-BLOCK pager_main;
-
- '<div>[ ';
- data = [];
-
- str = BLOCK; include( 'start_block' ); END;
- data.push(str) IF str;
-
- str = BLOCK; include( 'prev_block' ); END;
- data.push(str) IF str;
-
- str = BLOCK; include( 'current_block' ); END;
- data.push(str) IF str;
-
- str = BLOCK; include( 'next_block' ); END;
- data.push(str) IF str;
-
- str = BLOCK; include( 'end_block' ); END;
- data.push(str) IF str;
-
- data.join(" |\n");
- " ]</div>\n";
-
-END;
-
-BLOCK pager_start;
-
- %]<a [% connect_href(self, 'page' => self.pager.first_page); process_attrs(attrs) %]>[%
- include( 'start_label_block' ) %]</a>[%
-
-END;
-
-BLOCK pager_start_label;
-
- loc('Start'); ' ('; self.pager.first_page; ')';
-
-END;
-
-BLOCK pager_prev;
-
- IF self.pager.current_page != 1;
- %]<a [% connect_href(self, 'page' => self.pager.previous_page); process_attrs(attrs) %]>[%
- include( 'prev_label_block' ) %]</a>[%
- END;
-
-END;
-
-BLOCK pager_prev_label;
-
- loc('Previous'); ' ('; self.pager.previous_page; ')';
-
-END;
-
-BLOCK pager_current;
-
- %]<a [% connect_href(self, 'page' => self.pager.current_page); process_attrs(attrs) %]>[%
- include( 'current_label_block' ) %]</a>[%
-
-END;
-
-BLOCK pager_current_label;
-
- loc('Current'); ' ('; self.pager.current_page; ')';
-
-END;
-
-BLOCK pager_next;
-
- IF self.pager.current_page != self.pager.last_page;
- %]<a [% connect_href(self, 'page' => self.pager.next_page); process_attrs(attrs) %]>[%
- include( 'next_label_block' ) %]</a>[%
- END;
-
-END;
-
-BLOCK pager_next_label;
-
- loc('Next'); ' ('; self.pager.next_page; ')';
-
-END;
-
-BLOCK pager_end;
-
- %]<a [% connect_href(self, 'page' => self.pager.last_page); process_attrs(attrs) %]>[%
- include( 'end_label_block' ) %]</a>[%
-
-END;
-
-BLOCK pager_end_label;
-
- loc('End'); ' ('; self.pager.last_page; ')';
-
-END;
-
-BLOCK pager_list;
-
- FOREACH page IN self.pager.list;
- '<a'; connect_href(self, 'page' => page); process_attrs(attrs); '>';
- include( 'list_label_block' ); "</a>\n";
- END;
-
-END;
-
-BLOCK pager_list_label;
-
- page;
-
-END;
-
-%]
+++ /dev/null
-[%
-
-PROCESS field_base;
-
-control_block = 'passwordfield_control';
-
-BLOCK passwordfield_control;
-
- %]<input type="password" [% IF id_attr; 'id="'; id_attr; '"'; END; connect_control(self, 'value');
- ' value="'; self.value | html; '"'; process_attrs(attrs) %] />[%
-
-END;
-
-%]
+++ /dev/null
-[%
-
-PROCESS field_base;
-
-control_block = 'radio_control';
-
-BLOCK radio_control;
-
- %]<input type="radio" id="[% id_attr %]" [% connect_control(self, 'value');
- process_attrs(attrs) %] />[%
-
-END;
-
-%]
+++ /dev/null
-[%
-
-PROCESS field_base;
-
-control_block = 'radiogroup_control';
-
-BLOCK radiogroup_control;
-
- FOREACH value IN self.values.keys;
- '<input type="radio" id="[% id_attr %]" [% connect_control(self, 'value');
- IF self.default == value; ' checked="checked"'; END;
- process_attrs(attrs); " />\n";
- END;
-
-END;
-
-%]
+++ /dev/null
-[%
-
-PROCESS button;
-
-control_block = 'resetbtn_control';
-
-BLOCK resetbtn_control;
-
- INCLUDE button_control button_type = 'reset' attrs.value = 'Reset';
-
-END;
-
-%]
+++ /dev/null
-[%
-
-PROCESS field_base;
-
-control_block = 'search_base_control';
-
-BLOCK search_base_control;
-
- INCLUDE component type = 'textfield';
- INCLUDE component type = 'submitbtn' attrs.value = 'Search';
-
-END;
-
-%]
+++ /dev/null
-[%
-
-PROCESS field_base;
-
-control_block = 'select_control';
-
-BLOCK select_control;
-
- IF values_list_type;
- values_list = self.${values_list_type};
- ELSE;
- values_list = self.valid_values;
- END;
-
- name = attrs.name || 'value'; attrs.name = '';
- '<select ';
- IF id_attr; 'id="'; id_attr; '"'; END;
- connect_control(self, name); process_attrs(attrs); ">\n";
-
- IF attrs.nullable == 1 || !(self.attribute.required);
- attrs.nullable = '';
- " <option value=\"\">--</option>\n";
- END;
-
- FOREACH v_val IN values_list;
- v_val = self.obj_to_str(v_val);
- v_name = self.value_to_name_map.${v_val} || v_val;
- ' <option value="'; v_val | html; '"';
- IF (self.is_current_value(v_val) || self.value == v_val ) && !self.hide_selected;
- ' selected="selected"';
- END;
- '>'; v_name | html; "</option>\n";
- END;
- '</select>';
-
-END;
-
-%]
+++ /dev/null
-[%
-
-PROCESS select;
-
-control_block = 'select_group_control';
-
-BLOCK select_group_control;
-
- INCLUDE select_control attrs.multiple = 'multiple';
- attrs.multiple = '';
-
-END;
-
-%]
+++ /dev/null
-[%
-
-PROCESS button;
-
-control_block = 'submitbtn_control';
-
-BLOCK submitbtn_control;
-
- INCLUDE button_control button_type = 'submit' attrs.value = 'Submit' self.event = 'ok';
-
-END;
-
-%]
+++ /dev/null
-[%
-
-PROCESS field_base;
-
-control_block = 'textarea_control';
-
-BLOCK textarea_control;
-
- attrs.maxlength = '';
- %]<textarea id="[% id_attr %]" [% connect_control(self, 'value');
- process_attrs(attrs) %]>[% self.value | html; '</textarea>';
-
-END;
-
-%]
+++ /dev/null
-[%
-
-PROCESS field_base;
-
-control_block = 'textfield_control';
-
-BLOCK textfield_control;
-
- attrs.maxlength = '255'; # SimpleStr requires <= 255
- name = attrs.name || 'value'; attrs.name = '';
- %]<input type="text" [% IF id_attr; 'id="'; id_attr; '"'; END; connect_control(self, name);
- ' value="'; self.value | html; '"'; process_attrs(attrs) %] />[%
- attrs.maxlength = '';
-
-END;
-
-%]
+++ /dev/null
-[%
-
-main_block = 'timerange_field';
-
-BLOCK timerange_field;
-
- include( 'control_block' );
-
- IF self.message;
- "\n<span>"; loc(self.message); '</span>';
- END;
-
-END;
-
-control_block = 'timerange_control';
-
-BLOCK timerange_control;
-
- name = attrs.name || 'value_string'; attrs.name = '';
- self.label = '';
- data = self.value_string.split(',');
- #USE dumper; dumper.dump(data);
- data.0.replace('T', ' ') | ucfirst; ' to '; data.1.replace('T', ' ');
- IF data.2 == 'none'; data.2 = ''; END;
- IF data.2 != '';
- ' every '; data.4.replace('dai', 'day').replace('ly', '');
- ' between '; data.2.replace('T', ' '); ' and '; data.3.replace('T', ' ');
- END;
- inner = {
- value => self.delete_label,
- event => 'delete',
- location => self.location,
- };
-# INCLUDE component type = 'button' button_type = 'submit' self = inner;
- '<input type="submit" value="'; self.delete_label; ;'" '; connect_control(self, 'delete'); ' />';
- "<br />\n";
- '<input type="hidden" '; connect_control(self, name); ' value="'; self.value_string; '"'; process_attrs(attrs); ' />';
- "\n";
-
-# INCLUDE component type = 'hiddenarray' self.value = ctx.stash.ranges;
-
-END;
-
-%]
+++ /dev/null
-[%
-
-PROCESS form_base;
-
-fields_block = 'timerangecollection_control';
-
-BLOCK timerangecollection_control;
-
- include( 'error_block' );
- include( 'results_block' );
- FOREACH f_name = self.field_names;
- NEXT IF f_name.match('range');
- field = self.fields.$f_name;
- '<p>'; window.render_viewport(field); "</p>\n";
- END;
-
-END;
-
-results_block = 'timerangecollection_results';
-
-BLOCK timerangecollection_results;
-
- FOREACH field = self.range_vps;
- '<p>'; window.render_viewport(field); "</p>\n";
- END;
- '<input type="hidden"'; connect_control(self, 'max_range_vps'); ' value="'; self.range_vps.size; '" />';
-# INCLUDE component type = 'hidden' self.name = 'max_range_vps' self.val = self.range_vps.size;
-
-END;
-
-error_block = 'timerangecollection_error';
-
-BLOCK timerangecollection_error;
-
- IF self.warning;
- '<p>'; self.warning; '</p>';
- END;
- IF self.error;
- '<p>'; self.error; '</p>';
- END;
-
-END;
-
-button_block = 'timerangecollection_buttons';
-
-BLOCK timerangecollection_buttons;
-
- INCLUDE component type = 'submitbtn' self.value = 'add' self.event = 'add_range_vp' self.label = '';
-
- IF self.has_on_next_callback;
- INCLUDE component type = 'submitbtn' self.value = 'next' self.event = 'next' self.label = '';
- END;
-
- IF self.is_changed; self.value = 'cancel'; ELSE; self.value = 'close'; END;
- INCLUDE component type = 'cancelbtn' self.label = '' self.event = 'close';
- '<br />';
-
-END;
-
-%]
+++ /dev/null
-[%
-
-main_block = 'view_base_control';
-control_block = 'view_base_control';
-fields_block = 'view_base_fields';
-
-BLOCK view_base_control;
-
- include( 'fields_block' );
-
-END;
-
-BLOCK view_base_fields;
-
- FOREACH f_name = self.field_names;
- field = self.fields.$f_name;
- window.render_viewport(field); "<br />\n";
- END;
-
-END;
-
-%]
+++ /dev/null
-[% BLOCK xhtml_main; -%]
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-
-<head>
- <title>[% window.title %]</title>
-
- [%- FOREACH stylesheet IN stylesheets; -%]
- <link rel="stylesheet" type="text/css" href="[% ctx.uri_for('/stylesheets', stylesheet) %]" />
- [%- END; -%]
- [%- FOREACH javascript IN javascripts; -%]
- <script src="[% ctx.uri_for('/javascript', javascript) %]" type="text/javascript"></script>
- [%- END; -%]
-
- <meta http-equiv="Content-Type" content="text/html; charset=utf8" />
- <meta name="GENERATOR" content="Catalyst/TT" />
-</head>
-
-<body>
-[% INCLUDE header;
-window.render_viewport(self.inner); %]
-[% INCLUDE footer; %]
-</body>
-</html>
-[%- END;
-main_block = 'xhtml_main';
--%]
+++ /dev/null
-[%
-
-main_block = 'index';
-
-BLOCK index;
-
-%]
-
-<h2>Using InterfaceModel, Reflector</h2>
-<p><a href="[% ctx.uri_for('/testmodel/foo') %]">foo</a></p>
-<p><a href="[% ctx.uri_for('/testmodel/bar') %]">bar</a></p>
-<p><a href="[% ctx.uri_for('/testmodel/baz') %]">baz</a></p>
-
-[%
-
-END;
-
-%]