compability.
- fixed search ordering in Maypole::Model::CDBI and parameter
handling in CGI::Maypole (Dave Slack)
+ - sweet new factory templates (Danijel Milicevic)
+ - zero search fix (Dave Slack)
1.7 Sat Jul 17 20:15:26 BST 2004
- Emergency release - we lost the "use Maypole::Constants" from
L<Maypole::Application>,L<Apache::MVC>, L<CGI::Maypole>.
-=head1 MAINTAINER
+=head1 AUTHOR
Sebastian Riedel, c<sri@oook.de>
-=head1 AUTHOR
+=head1 AUTHOR EMERITUS
Simon Cozens, C<simon@cpan.org>
-=head1 THANK YOU
+=head1 THANKS TO
Danijel Milicevic, Dave Slack, Jesse Sheidlower, Jody Belka, Marcus Ramberg,
Mickael Joanne, Simon Flack, Veljko Vidovic and all the others who've
sub import {
my ( $self, @plugins ) = @_;
- return unless $plugins[0];
- my $caller=caller(0);
- no strict 'refs';
- push @{"${caller}::ISA"}, $self;
- "Maypole::$_"->require && unshift @ISA, "Maypole::$_" foreach (@plugins);
+ return unless $plugins[0];
+ my $caller = caller(0);
+ no strict 'refs';
+ push @{"${caller}::ISA"}, $self;
+ "Maypole::$_"->require && unshift @ISA, "Maypole::$_" foreach (@plugins);
}
if ( $ENV{MOD_PERL} ) {
require Apache::MVC;
- push @ISA , qw(Apache::MVC);
+ push @ISA, qw(Apache::MVC);
}
else {
require CGI::Maypole;
- push @ISA , qw(CGI::Maypole);
+ push @ISA, qw(CGI::Maypole);
}
1;
=head1 NAME
-Maypole::Application - all in wonder front-end
+Maypole::Application - Maypole Universal Frontend
=head1 SYNOPSIS
- use base 'Maypole::Application';
+ use Maypole::Application;
=head1 DESCRIPTION
-The all in wonder front-end.
+This is a universal frontend for mod_perl1, mod_perl2 and CGI.
+
+You can omit the Maypole:: prefix from plugins.
+So Maypole::Config::YAML becomes Config::YAML.
+
+ use Maypole::Application qw(Config::YAML);
=head1 AUTHOR
return keys %{ $self->meta_info('has_many') || {} };
}
-#sub related_class {
-# my ( $self, $r, $accessor ) = @_;
-# my $related=$self->related->{$accessor};
-# if ( my $mapping=$related->{args}->{mapping} ) {
-# return $related->{foreign_class}->meta_info('has_a')->{$$mapping[0]}->{foreign_class};
-# } else {
-# return $related->{foreign_class};
-# }
-#}
+sub related_class {
+ my ( $self, $r, $accessor ) = @_;
+ my $related = $self->related->{$accessor};
+ if ( my $mapping = $related->{args}->{mapping} ) {
+ return $related->{foreign_class}->meta_info('has_a')->{ $$mapping[0] }
+ ->{foreign_class};
+ }
+ else {
+ return $related->{foreign_class};
+ }
+}
sub do_edit : Exported {
my ( $self, $r ) = @_;
my $oper = "like"; # For now
my %params = %{ $r->{params} };
my %values = map { $_ => { $oper, $params{$_} } }
- grep { $params{$_} and $fields{$_} } keys %params;
+ grep { defined $params{$_} and $fields{$_} } keys %params;
$r->template("list");
if ( !%values ) { return $self->list($r) }
[% USE element_maker = Class("HTML::Element") %]
+<div id="addnew">
<form method="post" action="[% base %]/[% classmetadata.moniker %]/do_edit/">
<fieldset>
<legend>Add a new [%classmetadata.moniker%]</legend>
<input type="submit" name="create" value="create"/>
</fieldset>
</form>
+</div>
=cut
#%]
-<form id="createform" method="post" action="[% base %]/[% classmetadata.table %]/do_edit/">
+
+<div id="addnew">
+<form method="post" action="[% base %]/[% classmetadata.table %]/do_edit/">
<fieldset>
<legend>Add a new [% classmetadata.moniker %]</legend>
[% FOR col = classmetadata.columns %]
<input type="submit" name="create" value="create"/>
</fieldset>
</form>
+</div>
- </div>
+ </div>
</body>
</html>
#%]
[% INCLUDE header %]
-<h2>
+<div id="title">
[% config.application_name || "A poorly configured Maypole application" %]
-</h2>
-<table border="0" width="70%">
+</div>
+<div id="frontpage_list">
+<ul>
[% FOR table = config.display_tables %]
- <tr>
- <td>
- <a href="[%table%]/list">List by [%table %]</a>
- </td>
- </tr>
+ <li>
+ <a href="[%table%]/list">List by [%table %]</a>
+ </li>
[% END %]
-</table>
-<br/>
+</ul>
+</div>
+
+[% INCLUDE maypole %]
+
[% INCLUDE footer %]
<head>
<title>
[%
- config.application_name ||
+ title || config.application_name ||
"A poorly configured Maypole application"
%]
</title>
[% PROCESS macros %]
[% INCLUDE header %]
-[% IF search %]
- <h2>Search results</h2>
-[% ELSE %]
- <h2>Listing of all [% classmetadata.plural %]</h2>
-[% END %]
+[% INCLUDE title %]
[% INCLUDE navbar %]
-[% INCLUDE search_form %]
<div class="list">
<table id="matrix" width="100%" >
<tr>
END;
"</th>";
END %]
- <th>Actions</th>
+ <th id="actionth">Actions</th>
</tr>
[% SET count = 0;
FOR item = objects;
"</tr>";
END %]
</table>
+
[% INCLUDE pager %]
[% INCLUDE addnew %]
+[% INCLUDE search_form %]
</div>
[% INCLUDE footer %]
END;
"</td>";
END;
- "<td>";
+ "<td nowrap>";
button(item, "edit");
button(item, "delete");
"</td>";
[%
MACRO view_related(object) BLOCK;
FOR accessor = classmetadata.related_accessors.list;
- "<h3>"; accessor | ucfirst; "</h3>\n";
+ "<div id=\"subtitle\">"; accessor | ucfirst; "</div>\n";
"<ul id=\"vlist\">";
FOR thing = object.$accessor;
"<li>"; maybe_link_view(thing); "</li>\n";
--- /dev/null
+<!-- boxes -->
+<div style='position:absolute;top:220px;left:130px;border-bottom-width:260px;border-right-width:370px;' class='deco1'> </div>
+<div style='position:absolute;top:260px;left:190px;border-bottom-width:170px;border-right-width:530px;' class='deco2'> </div>
+<div style='position:absolute;top:240px;left:220px;border-bottom-width:340px;border-right-width:440px;' class='deco4'> </div>
+<div style='position:absolute;top:160px;left:330px;border-bottom-width:160px;border-right-width:280px;' class='deco1'> </div>
+<div style='position:absolute;top:190px;left:290px;border-bottom-width:430px;border-right-width:130px;' class='deco2'> </div>
+<!-- end of boxes -->
+<div id="search">
<form method="get" action="[% base %]/[% classmetadata.moniker %]/search/">
-<fieldset class="search">
+<fieldset>
<legend>Search</legend>
[% FOR col = classmetadata.columns;
NEXT IF col == "id";
<input type="submit" name="search" value="search"/>
</fieldset>
</form>
+</div>
--- /dev/null
+ <a href="[% base %]/frontpage">[% config.application_name %]</a>
+[% IF search %]
+ <div id="title">Search results</div>
+[% ELSE %]
+ <div id="title">Listing of all [% classmetadata.plural %]</div>
+[% END %]
+
[% INCLUDE header %]
[% FOR item = objects %]
[% SET string = item.stringify_column %]
- <h2> [% item.$string %]</h2>
+ <div id="title"> [% item.$string %]</div>
[% INCLUDE navbar %]
<table class="view">
<tr>
displays the results in a table.
#%]
+ <br /><a href="[%base%]/[%item.table%]/list">Back to listing</a>
[% view_related(item); %]
[%
padding-top: 0px
}
body {
+ font-family: sans-serif;
padding-right: 0px;
padding-left: 0px;
padding-bottom: 0px;
margin: 0px; padding-top: 0px;
- background-color: #ffffea;
+ background-color: #fff;
}
+#frontpage_list {
+ position: absolute;
+ z-index: 5;
+ padding: 0px 100px 0px 0px;
+ margin:0 0.5%;
+ margin-bottom:1em;
+ margin-top: 1em;
+ background-color: #fff;
+}
+
+#frontpage_list a:hover {
+ background-color: #d0d8e4;
+}
+
+#frontpage_list ul {
+ list-style-type: square;
+}
+
.content {
padding: 12px;
margin-top: 1px;
border-left: 1px;
border-right: 1px;
}
-h1 {
- font-size: 30pt;
- margin: 0px;
- font-family: Optima, "Lucida Grande",Sans-serif;
- text-align: center;
- padding-bottom: 1em;
-}
-h2 {
- padding-right: 0.25em;
- padding-left: 0.25em;
- font-size: 16pt;
- padding-bottom: 0.5em;
- margin: 0px;
- padding-top: 0.1em;
- font-family: Optima, "Lucida Grande",Sans-serif;
- text-align: center;
-}
A {
text-decoration: none;
color:#222
}
+#title {
+ z-index: 6;
+ width: 100%;
+ height: 18px;
+ margin-top: 10px;
+ font-size: 90%;
+ border-bottom: 1px solid #ddf;
+ text-align: left;
+}
+
+#subtitle {
+ postion: absolute;
+ z-index: 6;
+ padding: 10px;
+ margin-top: 2em;
+ height: 18px;
+ text-align: left;
+ background-color: #fff;
+}
+
+input[type=text] {
+ height: 16px;
+ width: 136px;
+ font-family: sans-serif;
+ font-size: 11px;
+ color: #2E415A;
+ padding: 0px;
+ margin-bottom: 5px;
+}
+
+input[type=submit] {
+ height: 18px;
+ width: 60px;
+ font-family: sans-serif;
+ font-size: 11px;
+ border: 1px outset;
+ background-color: #fff;
+ color: #2E415A;
+ padding: 0px 0px 2px 0px;
+ margin-bottom: 5px;
+}
+
+textarea {
+ width: 136px;
+ font-family: sans-serif;
+ font-size: 11px;
+ color: #2E415A;
+ padding: 0px;
+ margin-bottom: 5px;
+}
+
+select {
+ height: 16px;
+ width: 140px;
+ font-family: sans-serif;
+ font-size: 12px;
+ color: #202020;
+ padding: 0px;
+ margin-bottom: 5px;
+}
+
+.deco1 {
+ font-size: 0px;
+ z-index:1;
+ border:0px;
+ border-style:solid;
+ border-color:#4d6d99;
+ background-color:#4d6d99;
+}
+
+.deco2 {
+ z-index:2;
+ border:0px;
+ border-style:solid;
+ border-color:#627ea5;
+ background-color:#627ea5;
+}
+
+
+.deco3 {
+ z-index:3;
+ border:0px;
+ border-style:solid;
+ border-color:#7d95b5;
+ background-color:#7d95b5;
+}
+
+.deco4 {
+ z-index:4;
+ border:0px;
+ border-style:solid;
+ border-color:#d0d8e4;
+ background-color:#d0d8e4;
+}
+
+
table {
border: 0px solid;
background-color: #ffffff;
}
#matrix th {
- background-color: #DDE;
- border: 1px solid;
+ background-color: #b5cadc;
+ border: 1px solid #778;
font: bold 12px Verdana, sans-serif;
}
-#matrix tr.alternate { background-color:#EEF; }
+#matrix tr.alternate { background-color:#e3eaf0; }
+#matrix tr:hover { background-color: #b5cadc; }
#matrix td { font: 12px Verdana, sans-serif; }
#navlist {
padding: 3px 0;
margin-left: 0;
+ margin-top:3em;
border-bottom: 1px solid #778;
font: bold 12px Verdana, sans-serif;
}
margin-left: 3px;
border: 1px solid #778;
border-bottom: none;
- background: #DDE;
+ background: #b5cadc;
text-decoration: none;
}
#navlist li a:hover {
color: #000;
- background: #AAE;
+ background: #eef;
+ border-top: 4px solid #7d95b5;
border-color: #227;
}
#navlist #active a {
background: white;
border-bottom: 1px solid white;
+ border-top: 4px solid;
}
td { font: 12px Verdana, sans-serif; }
fieldset {
+ margin-top: 1em;
padding: 1em;
+ background-color: #f3f6f8;
font:80%/1 sans-serif;
border:1px solid #8484ce;
}
legend {
padding: 0.2em 0.5em;
+ background-color: #fff;
border:1px solid #8484ce;
font-size:90%;
text-align:right;
#vlist li a {
display: block;
padding: 0.25em 0.5em 0.25em 0.75em;
- border-left: 1em solid #AAB;
- background: #CCD;
+ border-left: 1em solid #7d95b5;
+ background: #d0d8e4;
text-decoration: none;
}
+
#vlist li a:hover {
border-color: #227;
}
-.search {width: 25%;border:1px outset #000;float:right; background: #eef;}
-.search legend {border:none;}
+
+.view .field {
+ background-color: #f3f6f8;
+ border-left: 1px solid #7695b5;
+ border-top: 1px solid #7695b5;
+ padding: 1px 10px 0px 2px;
+}
+
+#addnew {
+ width: 50%;
+ float: left;
+}
+
+#search {
+ width: 50%;
+ float:right;
+}
.error { color: #d00; }
-.list { width: 70%; }
.action {
+ border: 1px outset #7d95b5;
style:block;
}
-.pager { text-align:center;}
+
+.action:hover {
+ text-decoration: none;
+ background-color: #7d95b5;
+}
+
+.pager {
+ font:80%/1 sans-serif;
+ background-color: #f3f6f8;
+ padding: 2px;
+ border: 1px solid #8484ce;
+ text-align:center;
+}
+