Skip to content

Instantly share code, notes, and snippets.

View genehack's full-sized avatar
🏠
Working from home

John SJ Anderson genehack

🏠
Working from home
View GitHub Profile
[% MACRO form_block BLOCK %]
[% context.scope = 'guide' %]
[% text_field({ label => 'Your Name', name => 'name',
value => 'This is focused', placeholder => 'Placeholder Text',
required => 1 }) %]
[% text_field({ label => 'Prepended', name => 'prepended_name', prepend => '←',
value => 'This is focused', placeholder => 'Placeholder Text',
required => 1,
@genehack
genehack / macros.tt
Created April 19, 2012 19:34 — forked from jshirley/Guide.pm
Our macro.tt file for handling inputs consistently. Requires YUI3 grids to look proper.
[%~
# Some illustrious documentation to get you started:
#
# The macros defined are to generate markup to save people from copy and pasting
# markup. They copy and paste hashes instead, which should be safer (in theory)
#
# The macros for forms are:
# * text_field - A text field
# * textarea_field - A textarea field
# * password_field - A password field, text_field({ type => 'password', ... })
package MyApp::Model::DataManager;
use Moose;
use Data::Manager;
use Scalar::Util 'blessed';
use Email::Valid;
use Data::Verifier;
package MyApp::Model::DataManager;
use Moose;
extends 'Data::Manager';
sub new_from_schema {
my ( $class, $schema, @classes ) = @_;
my $verifiers = $class->_default_verifiers;
@jshirley
jshirley / Guide.pm
Created January 27, 2012 14:23
Our macro.tt file for handling inputs consistently. Requires YUI3 grids to look proper.
sub guide : Local {
my ( $self, $c ) = @_;
unless ( $c->debug ) {
$c->detach('/error/not_found');
}
my $template = 'index.tt';
if ( @{ $c->req->args } ) {