Bigtop

 view release on metacpan or  search on metacpan

examples/kids.bigtop  view on Meta::CPAN

    Model GantryDBIxClass {  }
    SiteLook GantryDefault {  }
    Conf Gantry { instance kids; }
}
app Kids {
    config {
        dbconn `dbi:SQLite:dbname=app.db` => no_accessor;
        template_wrapper `genwrapper.tt` => no_accessor;
    }
    controller is base_controller {
        method do_main is base_links {
        }
        method site_links is links {
        }
    }
    table child {
        field id {
            is int4, primary_key, auto;
        }
        field name {
            is varchar;
            label Name;
            html_form_type text;
        }
        field birth_day {
            is date;
            label `Birth Day`;
            html_form_type text;
            date_select_text `Select Date`;
        }
        field created {
            is datetime;
        }
        field modified {
            is datetime;
        }
        foreign_display `%name`;
        field family {
            is int4;
            label Family;
            refers_to family;
            html_form_type select;
        }
    }
    controller Child is AutoCRUD {
        controls_table child;
        rel_location child;
        text_description child;
        page_link_label Child;
        method do_main is main_listing {
            cols name, birth_day;
            header_options Add;
            row_options Edit, Delete;
            title Child;
            limit_by family;
        }
        method form is AutoCRUD_form {
            all_fields_but id, created, modified;
            extra_keys
                legend => `$self->path_info =~ /edit/i ? 'Edit' : 'Add'`,
                javascript => `$self->calendar_month_js( 'child' )`;
            form_name child;
        }
        uses Gantry::Plugins::Calendar;
    }
    table family {
        field id {
            is int4, primary_key, auto;
        }
        field parent {
            is varchar;
            label Parent;
            html_form_type text;
            html_form_optional 0;
        }
        field address {
            is varchar;
            label Address;
            html_form_type text;
            html_form_optional 1;
        }
        field created {
            is datetime;
            html_form_optional 1;
        }
        field modified {
            is datetime;
            html_form_optional 1;
        }
        foreign_display `%parent`;
        field city {
            is varchar;
            label City;
            html_form_type text;
            html_form_optional 1;
        }
        field state {
            is varchar;
            label State;
            html_form_type text;
            html_form_optional 1;
        }
        field zip {
            is varchar;
            label Zip;
            html_form_type text;
            html_form_optional 1;
        }
    }
    controller Family is AutoCRUD {
        controls_table family;
        rel_location family;
        text_description family;
        page_link_label Family;
        method do_main is main_listing {
            cols parent, address;
            header_options Add;
            row_options Child => `"/child/main/$id"`, Edit, Delete;
            title Family;
        }
        method form is AutoCRUD_form {



( run in 1.904 second using v1.01-cache-2.11-cpan-ceb78f64989 )