% if ($s) {
logo
% } else {
logo
% }
<& .breadcrumbs, s => $s, t => $t, c => $c &>
% if (@errors) {
% foreach (@errors) {

<% $_ | h %>

% }
% } % if ( $s && $m->request_comp->attr('show_tables') ) { % my @t = $s->tables; % } % if ( $t && $m->request_comp->attr('show_columns') ) { % my @c = $t->columns; % } % $m->call_next( %args, %ARGS );

Tables

% for ( my $x = 0; $x < @t; $x++ ) {

\ % if ($x) { <& href, text => '«', escape => 0, path => 'move_table' . Alzabo::GUI::Mason::Config::mason_extension(), query => { table => $t[$x]->name, before => $t[$x - 1]->name, schema => $s->name, }, &>\ % } else { «\ % }  \ <& href, text => $t[$x]->name, path => 'view_table' . Alzabo::GUI::Mason::Config::mason_extension(), query => { table => $t[$x]->name, schema => $s->name, }, &>\  \ % if ( $x != $#t ) { <& href, text => '»', escape => 0, path => 'move_table' . Alzabo::GUI::Mason::Config::mason_extension(), query => { table => $t[$x]->name, after => $t[$x + 1]->name, schema => $s->name, }, &>\ % }

% }

<& href, text => 'jump to foreign keys/indexes', path => 'view_table_other' . Alzabo::GUI::Mason::Config::mason_extension(), query => { table => $t->name, schema => $s->name, }, &>

Columns

% for ( my $x = 0; $x < @c; $x++ ) {

\ % if ($x) { <& href, text => '«', escape => 0, path => 'move_column' . Alzabo::GUI::Mason::Config::mason_extension(), query => { column => $c[$x]->name, before => $c[$x - 1]->name, table => $c[$x]->table->name, schema => $s->name, }, &>\ % } else { «\ % }  \ <& href, text => $c[$x]->name, path => 'view_column' . Alzabo::GUI::Mason::Config::mason_extension(), query => { column => $c[$x]->name, table => $c[$x]->table->name, schema => $s->name, }, &>\ % if ( $c[$x]->is_primary_key ) {  - pk\ % }  \ % if ( $x != $#c ) { <& href, text => '»', escape => 0, path => 'move_column' . Alzabo::GUI::Mason::Config::mason_extension(), query => { column => $c[$x]->name, after => $c[$x + 1]->name, table => $c[$x]->table->name, schema => $s->name, }, &>\ % }

% }
<%args> $schema => undef $table => undef $column => undef $foreign_key_table_to => undef $foreign_key_columns_from => undef $foreign_key_columns_to => undef @errors => () <%init> my $s; my %args; my ($comp, @args); if ( defined $schema ) { eval{ $s = Alzabo::Create::Schema->load_from_file( name => $schema ); }; my $e = $@; $m->comp( 'exception', $e ) if $e; $args{s} = $s; } my $t; if ( defined $table ) { eval{ $t = $s->table($table); }; my $e = $@; $m->comp( 'exception', $e ) if $e; $args{t} = $t; } my $c; if ( defined $column ) { eval{ $c = $t->column($column); }; my $e = $@; $m->comp( 'exception', $e ) if $e; $args{c} = $c; } <%def .breadcrumbs> <& href, text => 'Schema Editor', path => 'index' . Alzabo::GUI::Mason::Config::mason_extension(), &> % if ($s) { > <& href, text => $s->name, path => 'view_schema' . Alzabo::GUI::Mason::Config::mason_extension(), query => { schema => $s->name }, &> % } % if ($t) { > <& href, text => $t->name, path => 'view_table' . Alzabo::GUI::Mason::Config::mason_extension(), query => { table => $t->name, schema => $s->name }, &> % } % if ($c) { > <& href, text => $c->name, path => 'view_column' . Alzabo::GUI::Mason::Config::mason_extension(), query => { column => $c->name, table => $t->name, schema => $s->name }, &> % } <%args> $s $t $c <%flags> inherit => 'syshandler' <%attr> show_tables => 1 show_columns => 1