[Jifty-commit] r2914 - in jifty/branches/template-declare: .
examples/Chat/etc examples/Chat/lib/Chat examples/Clock/etc
examples/Clock/lib/Clock examples/Ping/etc
examples/Ping/lib/Ping lib/Jifty lib/Jifty/Manual
lib/Jifty/Mason lib/Jifty/Script lib/Jifty/Server
lib/Jifty/Web lib/Jifty/Web/Form
plugins/EditInPlace/lib/Jifty/Plugin
plugins/Login/lib/Jifty/Plugin/Login/Action
plugins/Login/share/web/templates plugins/Users
plugins/Users-Identity-File share/web/static/css
share/web/templates/__jifty
share/web/templates/__jifty/error/_elements
share/web/templates/_elements
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Mon Mar 5 20:23:12 EST 2007
Author: hlb
Date: Mon Mar 5 20:23:11 2007
New Revision: 2914
Added:
jifty/branches/template-declare/lib/Jifty/Script/ModPerl2.pm (contents, props changed)
jifty/branches/template-declare/lib/Jifty/Server/
jifty/branches/template-declare/lib/Jifty/Server/Fork.pm
Removed:
jifty/branches/template-declare/examples/Chat/lib/Chat/Server.pm
jifty/branches/template-declare/examples/Clock/lib/Clock/Server.pm
jifty/branches/template-declare/examples/Ping/lib/Ping/Server.pm
jifty/branches/template-declare/plugins/Users/
jifty/branches/template-declare/plugins/Users-Identity-File/
Modified:
jifty/branches/template-declare/ (props changed)
jifty/branches/template-declare/AUTHORS
jifty/branches/template-declare/Makefile.PL
jifty/branches/template-declare/examples/Chat/etc/config.yml
jifty/branches/template-declare/examples/Clock/etc/config.yml
jifty/branches/template-declare/examples/Ping/etc/config.yml
jifty/branches/template-declare/lib/Jifty/Manual/AccessControl.pod
jifty/branches/template-declare/lib/Jifty/Manual/Cookbook.pod
jifty/branches/template-declare/lib/Jifty/Manual/UsingCSSandJS.pod
jifty/branches/template-declare/lib/Jifty/Mason/Halo.pm
jifty/branches/template-declare/lib/Jifty/Script/Schema.pm
jifty/branches/template-declare/lib/Jifty/Server.pm
jifty/branches/template-declare/lib/Jifty/Test.pm
jifty/branches/template-declare/lib/Jifty/Web.pm
jifty/branches/template-declare/lib/Jifty/Web/Form.pm
jifty/branches/template-declare/lib/Jifty/Web/Form/Field.pm
jifty/branches/template-declare/lib/Jifty/Web/Menu.pm
jifty/branches/template-declare/plugins/EditInPlace/lib/Jifty/Plugin/EditInPlace.pm
jifty/branches/template-declare/plugins/Login/lib/Jifty/Plugin/Login/Action/Signup.pm
jifty/branches/template-declare/plugins/Login/share/web/templates/login
jifty/branches/template-declare/share/web/static/css/base.css
jifty/branches/template-declare/share/web/static/css/context-menus.css
jifty/branches/template-declare/share/web/static/css/forms.css
jifty/branches/template-declare/share/web/static/css/halos.css
jifty/branches/template-declare/share/web/static/css/notices.css
jifty/branches/template-declare/share/web/static/js/context_menu.js
jifty/branches/template-declare/share/web/static/js/jifty.js
jifty/branches/template-declare/share/web/templates/__jifty/error/_elements/wrapper
jifty/branches/template-declare/share/web/templates/__jifty/halo
jifty/branches/template-declare/share/web/templates/_elements/wrapper
Log:
r26548 at heaven (orig r2854): sterling | 2007-02-28 06:33:21 +0800
small improvement to Jifty::Test documentation
r26549 at heaven (orig r2855): alexmv | 2007-02-28 07:00:24 +0800
r17439 at zoq-fot-pik: chmrr | 2007-02-27 18:00:14 -0500
* Typo nits, on otherwise very nice documentation fixes
r26550 at heaven (orig r2856): alexmv | 2007-02-28 07:01:56 +0800
r17441 at zoq-fot-pik: chmrr | 2007-02-27 18:01:50 -0500
* Revert mistaken parts of that commit
r26562 at heaven (orig r2866): sterling | 2007-02-28 23:34:16 +0800
added mutual dependencies recipe
r26617 at heaven (orig r2874): audreyt | 2007-03-01 17:57:30 +0800
* Jifty::Server::Fork - New module to conveniently express
a forking builtin server.
r26618 at heaven (orig r2875): audreyt | 2007-03-01 18:02:41 +0800
* Add Net::Server::Fork as one of the features we support via Makefile.PL.
r26619 at heaven (orig r2876): audreyt | 2007-03-01 18:03:27 +0800
* examples/{Chat,Clock,Ping}/: Use Jifty::Server::Fork instead of
stub ::Server subclasses.
r26621 at heaven (orig r2878): rodi | 2007-03-02 04:29:28 +0800
added as an author
r26622 at heaven (orig r2879): rodi | 2007-03-02 06:57:20 +0800
Basic handler for running Jifty under mod_perl2. Tested under Unbuntu
Feisty, with a default Apache2/MP2 install. Requires a config change,
explained in the perldoc.
r26658 at heaven (orig r2881): bartb | 2007-03-03 11:24:21 +0800
Add note to cookbook showing how to change other fields using ajax canonicalization
r26659 at heaven (orig r2882): trs | 2007-03-03 11:39:00 +0800
r19864 at zot: tom | 2007-03-02 22:38:49 -0500
Add Apache2::Const as an optional dep for the ModPerl2 handler
r26703 at heaven (orig r2906): dpavlin | 2007-03-05 06:32:46 +0800
fix Can't locate Jifty/Plugin/Login/Action/Signup/SUPER.pm in @INC
r26705 at heaven (orig r2907): alexmv | 2007-03-05 15:51:11 +0800
r17684 at zoq-fot-pik: chmrr | 2007-03-05 02:50:57 -0500
* Deal with subclassing epsilon better; should really be a class
method on the handle
r26706 at heaven (orig r2908): yves | 2007-03-05 17:04:18 +0800
remove experimental plugin Users and Users-Identity-File
plugins in od branche will be better
r26707 at heaven (orig r2909): hlb | 2007-03-05 23:23:44 +0800
Changes in id & class name. Please check your own css rules before update.
- use hyphen instead of underscore for consistency
- add "jifty-" to avoid conflicting with users' apps ( suggested by jpollack )
id & class name affected:
admin_mode, canonicalization_note, context_menu, dismiss_error, dismiss_messages, down_select, error, errors, form_field, halo_actions, halo_button, halo_comp_info, inline_create, inline_edit, jifty_admin, jifty_admin_header, message, messages, render_info, render_info_tree, submit_button, submit_button, up_select, warning
r26708 at heaven (orig r2910): yves | 2007-03-05 23:31:09 +0800
* add doc to manage a superuser group
* add doc to emulate updated_on
r26709 at heaven (orig r2911): yves | 2007-03-06 00:01:19 +0800
* a simplest way to manage signup argument, now usable with an additional schema definition as in "Expanding the Model" in Jifty::Manual::AccessControl
r26710 at heaven (orig r2912): hlb | 2007-03-06 01:20:10 +0800
* change back to "canonicalization_note" to avoid bugs
* fix dismiss message link
r26748 at heaven (orig r2913): rodi | 2007-03-06 05:46:20 +0800
added /i to test for database existence, to work with MySQL 5.x.
Modified: jifty/branches/template-declare/AUTHORS
==============================================================================
--- jifty/branches/template-declare/AUTHORS (original)
+++ jifty/branches/template-declare/AUTHORS Mon Mar 5 20:23:11 2007
@@ -25,3 +25,4 @@
Andrew Sterling Hanenkamp <sterling at hanenkamp.com>
Edgar Whipple <jifty at misterwhipple.com>
Christian Ternus <ternus at mit.edu>
+David Brunton <dbrunton at yahoo.com>
Modified: jifty/branches/template-declare/Makefile.PL
==============================================================================
--- jifty/branches/template-declare/Makefile.PL (original)
+++ jifty/branches/template-declare/Makefile.PL Mon Mar 5 20:23:11 2007
@@ -85,7 +85,7 @@
'Administrative Interface (web)' => [
-default => 1,
requires( 'Pod::Simple') # Pod::Simple::Text Pod::Simple::HTML
- ],
+ ],
'Development of a jifty application' => [
-default => 1,
recommends('DBD::SQLite' => 1.11 ),
@@ -109,6 +109,14 @@
recommends('Module::CoreList'),
recommends('Module::Install::Admin' => '0.50')
],
+ 'Forking jifty server' => [
+ -default => 0,
+ recommends('Net::Server::Fork'),
+ ],
+ 'Apache2/ModPerl2 handler' => [
+ -default => 0,
+ recommends('Apache2::Const'),
+ ],
'Experimental features' => [
-default => 0,
recommends('PAR::Dist::FromCPAN'),
Modified: jifty/branches/template-declare/examples/Chat/etc/config.yml
==============================================================================
--- jifty/branches/template-declare/examples/Chat/etc/config.yml (original)
+++ jifty/branches/template-declare/examples/Chat/etc/config.yml Mon Mar 5 20:23:11 2007
@@ -34,4 +34,4 @@
ServeStaticFiles: 1
StaticRoot: share/web/static
TemplateRoot: share/web/templates
- ServerClass: Chat::Server
+ ServerClass: Jifty::Server::Fork
Modified: jifty/branches/template-declare/examples/Clock/etc/config.yml
==============================================================================
--- jifty/branches/template-declare/examples/Clock/etc/config.yml (original)
+++ jifty/branches/template-declare/examples/Clock/etc/config.yml Mon Mar 5 20:23:11 2007
@@ -34,4 +34,4 @@
ServeStaticFiles: 1
StaticRoot: share/web/static
TemplateRoot: share/web/templates
- ServerClass: Clock::Server
+ ServerClass: Jifty::Server::Fork
Modified: jifty/branches/template-declare/examples/Ping/etc/config.yml
==============================================================================
--- jifty/branches/template-declare/examples/Ping/etc/config.yml (original)
+++ jifty/branches/template-declare/examples/Ping/etc/config.yml Mon Mar 5 20:23:11 2007
@@ -37,4 +37,4 @@
ServeStaticFiles: 1
StaticRoot: share/web/static
TemplateRoot: share/web/templates
- ServerClass: Ping::Server
+ ServerClass: Jifty::Server::Fork
Modified: jifty/branches/template-declare/lib/Jifty/Manual/AccessControl.pod
==============================================================================
--- jifty/branches/template-declare/lib/Jifty/Manual/AccessControl.pod (original)
+++ jifty/branches/template-declare/lib/Jifty/Manual/AccessControl.pod Mon Mar 5 20:23:11 2007
@@ -70,16 +70,69 @@
use App::Record schema {
column 'extra_column_name';
+ column 'group' =>
+ valid_values are qw/admin moderator user/,
+ default is 'user';
+
# more columns if necessary
};
The full syntax for defining a schema can be found in
L<Jifty::Manual::Models> or in L<Jifty::DBI::Schema>.
+If you want to manage an admin group, you must protect the group column
+as only a superuser can change it.
+Then, you override C<current_user_can> in C<App::Model::User>
+
+ sub current_user_can {
+ my $self = shift;
+ my $type = shift;
+ my %args = (@_);
+
+ return 0
+ if ( $type eq 'update'
+ and !$self->current_user->is_superuser
+ and $args{'column'} eq 'group' );
+
+
+ return $self->SUPER::current_user_can($type, %args);
+ }
+
Defining a method C<_init> in your C<App::CurrentUser> class gives you
a chance to add more data to the C<CurrentUser> object. This method
will automatically get called after the Plugin's C<_init> is done.
+ package App::CurrentUser;
+
+ use strict;
+ use warnings;
+
+ use base qw(Jifty::CurrentUser);
+
+ __PACKAGE__->mk_accessors(qw(group));
+
+ sub _init {
+ my $self = shift;
+ my %args = (@_);
+
+ if (delete $args{'_bootstrap'} ) {
+ $self->is_bootstrap_user(1);
+ } elsif (keys %args) {
+ $self->user_object(App::Model::User->new(current_user => $self));
+ $self->user_object->load_by_cols(%args);
+
+ if ( $self->user_object->group eq 'admin') {
+ $self->is_superuser(1);
+ };
+
+ $self->status($self->user_object->group);
+ };
+ $self->SUPER::_init(%args);
+ };
+
+With your C<App::CurrentUser>, users in group admin are superuser and you can
+use C<< Jifty->web->current_user->group >> in your application.
+
=head2 Templates defined by the C<Login> plugin
To avoid the need for repetitive work, the C<Login> plugin already
Modified: jifty/branches/template-declare/lib/Jifty/Manual/Cookbook.pod
==============================================================================
--- jifty/branches/template-declare/lib/Jifty/Manual/Cookbook.pod (original)
+++ jifty/branches/template-declare/lib/Jifty/Manual/Cookbook.pod Mon Mar 5 20:23:11 2007
@@ -153,6 +153,21 @@
$attr->{'created_on'} = DateTime->now;
};
+=head2 How do I emulate 'updated_on' ?
+
+If a lot of column could change, you can override C<_set> method:
+
+ sub _set {
+ my $self = shift;
+ my ($val, $msg) = $self->SUPER::_set(@_);
+
+ $self->SUPER::_set(column => 'changed_on', value => defer {DateTime->now});
+ $self->SUPER::_set(column => 'from',
+ value => $ENV{REMOTE_HOST}. " / ". Jifty->web->current_user->user_object->name );
+
+ return ($val, $msg);
+ }
+
=head2 Limit access to pages to logged-in users
The best place to do this is probably in your application's
@@ -271,6 +286,13 @@
Of course, you can apply the same trick to your own Action classes.
+You can use the canonicalization to change data in other fields. For
+example you might want to update the postcode field when the suburb
+field is changed.
+
+ $self->argument_value( other_field => "new value" )
+
+
=head2 Get the "Edit" links to work in the "Page info" tool
If you click on "Page info", follow an "Edit" link for a fragment,
@@ -321,3 +343,30 @@
Check details from Angus himself. ( http://www.twinhelix.com/ )
+=head2 Create mutually dependent models
+
+Sometimes you need two tables that both depend upon each other. That is, you have model A that needs to have a column pointing to Model B and a column in Model B pointing back to model A. The solution is very straight forward, just make sure you setup the base class I<before> you load dependent model and this will just work. For example:
+
+ package ModelA;
+ use base qw/ MyApp::Record /;
+
+ # Note that "use base..." comes first
+ use ModelB;
+
+ use Jifty::DBI::Schema;
+ use MyApp::Record schema {
+ column b_record => refers_to ModelB;
+ };
+
+ package ModelB;
+ use base qw/ MyApp::Record /;
+
+ # Note that "use base..." comes first
+ use ModelA;
+
+ use Jifty::DBI::Schema;
+ use MyApp::Record schema {
+ column a_record => refers_to ModelA;
+ };
+
+Otherwise, everything should work as expected.
Modified: jifty/branches/template-declare/lib/Jifty/Manual/UsingCSSandJS.pod
==============================================================================
--- jifty/branches/template-declare/lib/Jifty/Manual/UsingCSSandJS.pod (original)
+++ jifty/branches/template-declare/lib/Jifty/Manual/UsingCSSandJS.pod Mon Mar 5 20:23:11 2007
@@ -92,7 +92,7 @@
=item widget, button, button_as_link, combobox,
combo-text, combo-button, combo-list, date, label, password
-submit_button, reset, text, hidden, ajaxvalidation,
+jifty-submit-button, reset, text, hidden, ajaxvalidation,
ajaxcanonicalization, ajaxautocompletes
These class names are used depending on the type of widget getting
@@ -102,7 +102,7 @@
used for the autocomplete div.
-=item toplevel, menu, context_menu, submenu, title, expand
+=item toplevel, menu, context-menu, submenu, title, expand
These classes are used in navigation bars.
Modified: jifty/branches/template-declare/lib/Jifty/Mason/Halo.pm
==============================================================================
--- jifty/branches/template-declare/lib/Jifty/Mason/Halo.pm (original)
+++ jifty/branches/template-declare/lib/Jifty/Mason/Halo.pm Mon Mar 5 20:23:11 2007
@@ -102,7 +102,7 @@
$context->request->out(
Jifty->web->link(
label => _( 'Edit %1', $comp_name ),
- class => 'inline_edit',
+ class => 'inline-edit',
onclick => [
{ element => "#halo-" . $frame->{id},
replace_with =>
Added: jifty/branches/template-declare/lib/Jifty/Script/ModPerl2.pm
==============================================================================
--- (empty file)
+++ jifty/branches/template-declare/lib/Jifty/Script/ModPerl2.pm Mon Mar 5 20:23:11 2007
@@ -0,0 +1,58 @@
+package Jifty::Script::ModPerl2;
+use strict;
+use warnings;
+
+use Apache2::Const -compile => qw(OK);
+use Jifty::Everything;
+use CGI;
+
+=head1 NAME
+
+Jifty::Script::ModPerl2 - a ModPerl2 handler for your jifty app.
+
+=head1 DESCRIPTION
+
+This handler should be used with Apache2 and ModPerl2. It requires the
+DocumentRoot of its VirtualHost to be set to the base directory of your
+jifty application.
+
+Here is the relevant minimal httpd.conf section:
+
+ <VirtualHost *:80>
+ DocumentRoot /path/to/base/dir/of/app
+ SetHandler perl-script
+ PerlHandler Jifty::Script::ModPerl2
+ </VirtualHost>
+
+It would not necessarily need to be a VirtualHost- could be a Directory,
+and should configure about the same.
+
+TODO: This should be set up to serv the static files without mod_perl.
+
+=head2 handler
+
+The mod_perl handler for the app
+
+=cut
+
+sub handler {
+
+ ##
+ # Fire up jifty
+ chdir($ENV{'DOCUMENT_ROOT'});
+ Jifty->new() unless (Jifty->handler());
+
+ ##
+ # Fix the path to work with CGI
+ $ENV{'PATH_INFO'} = $ENV{'REQUEST_URI'};
+ my $cgi = new CGI;
+
+ Jifty->handler->handle_request(cgi => $cgi);
+
+ ##
+ # Oll Korrect
+ return Apache2::Const::OK;
+
+}
+
+1;
Modified: jifty/branches/template-declare/lib/Jifty/Script/Schema.pm
==============================================================================
--- jifty/branches/template-declare/lib/Jifty/Script/Schema.pm (original)
+++ jifty/branches/template-declare/lib/Jifty/Script/Schema.pm Mon Mar 5 20:23:11 2007
@@ -161,7 +161,7 @@
# No version table. Assume the DB is empty.
$self->{create_all_tables} = 1;
} elsif ( $@ =~ /database .*? does not exist/i
- or $@ =~ /unknown database/ ) {
+ or $@ =~ /unknown database/i ) {
# No database exists; we'll need to make one and fill it up
$self->{create_database} = 1;
@@ -500,8 +500,8 @@
# Everything but the template1 database is assumed
my %connect_args;
- $connect_args{'database'} = 'template1' if ( $driver eq 'Pg' );
- $connect_args{'database'} = '' if ( $driver eq 'mysql' );
+ $connect_args{'database'} = 'template1' if ( $handle->isa("Jifty::DBI::Handle::Pg") );
+ $connect_args{'database'} = '' if ( $handle->isa("Jifty::DBI::Handle::mysql") );
$handle->connect(%connect_args);
return $handle;
}
Modified: jifty/branches/template-declare/lib/Jifty/Server.pm
==============================================================================
--- jifty/branches/template-declare/lib/Jifty/Server.pm (original)
+++ jifty/branches/template-declare/lib/Jifty/Server.pm Mon Mar 5 20:23:11 2007
@@ -3,10 +3,6 @@
package Jifty::Server;
-=head1 NAME
-
-Jifty::Server - Standalone web server for Jifty applications
-
=head1 SYNOPSIS
use Jifty::Server;
Added: jifty/branches/template-declare/lib/Jifty/Server/Fork.pm
==============================================================================
--- (empty file)
+++ jifty/branches/template-declare/lib/Jifty/Server/Fork.pm Mon Mar 5 20:23:11 2007
@@ -0,0 +1,28 @@
+package Jifty::Server::Fork;
+use Net::Server::Fork ();
+use base 'Jifty::Server';
+
+=head1 NAME
+
+Jifty::Server::Fork - Jifty::Server that supports multiple connections
+
+=head1 SYNOPSIS
+
+In your F<etc/config.yml>:
+
+ framework:
+ Web:
+ ServerClass: Jifty::Server::Fork
+
+=head1 METHODS
+
+=head2 net_server
+
+This module depends on the L<Net::Server::Fork> module, which is part of
+the L<Net::Server> CPAN distribution.
+
+=cut
+
+sub net_server { 'Net::Server::Fork' }
+
+1;
Modified: jifty/branches/template-declare/lib/Jifty/Test.pm
==============================================================================
--- jifty/branches/template-declare/lib/Jifty/Test.pm (original)
+++ jifty/branches/template-declare/lib/Jifty/Test.pm Mon Mar 5 20:23:11 2007
@@ -21,13 +21,20 @@
use Jifty::Test tests => 5;
- ...all of Test::More's functionality...
-
- ...any class methods defined below...
+ # ...all of Test::More's functionality...
+ my $model = MyApp::Model::MyModel->new;
+ $model->create();
+ ok($model->id, 'model works');
+ is($model->foo, 'some default', 'default works');
+
+ # Startup an external server (see Jifty::TestServer)
+ my $server = Jifty::Test->make_server;
+ my $server_url = $server->started_ok;
+ # You're probably also interested in Jifty::Test::WWW::Mechanize
=head1 DESCRIPTION
-Jifty::Test is a superset of Test::More. It provides all of
+Jifty::Test is a superset of L<Test::More>. It provides all of
Test::More's functionality in addition to the class methods defined
below.
@@ -39,9 +46,21 @@
Check if the test is currently in a passing state.
-* All tests run so far have passed
-* We have run at least one test
-* We have not run more than we planned (if we planned at all)
+=over
+
+=item *
+
+All tests run so far have passed
+
+=item *
+
+We have run at least one test
+
+=item *
+
+We have not run more than we planned (if we planned at all)
+
+=back
=cut
@@ -421,4 +440,10 @@
unlink $Test->{test_config} if $Test->{test_config};
}
+=head1 SEE ALSO
+
+L<Jifty::Test::WWW::Mechanize>, L<Jifty::TestServer>
+
+=cut
+
1;
Modified: jifty/branches/template-declare/lib/Jifty/Web.pm
==============================================================================
--- jifty/branches/template-declare/lib/Jifty/Web.pm (original)
+++ jifty/branches/template-declare/lib/Jifty/Web.pm Mon Mar 5 20:23:11 2007
@@ -872,12 +872,12 @@
return unless grep {$_->$type()} values %results;
- my $plural = $type . "s";
- $self->out(qq{<div class="jifty results messages" id="$plural">});
+ my $plural = "jifty-" . $type . "s";
+ $self->out(qq{<div class="jifty results jifty-messages" id="$plural">});
foreach my $moniker ( sort keys %results ) {
if ( $results{$moniker}->$type() ) {
- $self->out( qq{<div class="$type $moniker">}
+ $self->out( qq{<div class="jifty-$type $moniker">}
. $results{$moniker}->$type()
. qq{</div>} );
}
Modified: jifty/branches/template-declare/lib/Jifty/Web/Form.pm
==============================================================================
--- jifty/branches/template-declare/lib/Jifty/Web/Form.pm (original)
+++ jifty/branches/template-declare/lib/Jifty/Web/Form.pm Mon Mar 5 20:23:11 2007
@@ -219,7 +219,7 @@
my $self = shift;
my $button = Jifty::Web::Form::Clickable->new(submit => undef, @_)->generate;
- Jifty->web->out(qq{<div class="submit_button">});
+ Jifty->web->out(qq{<div class="jifty-submit-button">});
$button->render_widget;
Jifty->web->out(qq{</div>});
Modified: jifty/branches/template-declare/lib/Jifty/Web/Form/Field.pm
==============================================================================
--- jifty/branches/template-declare/lib/Jifty/Web/Form/Field.pm (original)
+++ jifty/branches/template-declare/lib/Jifty/Web/Form/Field.pm Mon Mar 5 20:23:11 2007
@@ -327,7 +327,7 @@
=head2 render
-Outputs this form element in a span with class C<form_field>. This
+Outputs this form element in a span with class C<form-field>. This
outputs the label, the widget itself, any hints, any errors, and any
warnings using L</render_label>, L</render_widget>, L</render_hints>,
L</render_errors>, and L</render_warnings>, respectively. Returns an
@@ -412,7 +412,7 @@
sub render_wrapper_start {
my $self = shift;
- my @classes = qw(form_field);
+ my @classes = qw(form-field);
if ($self->mandatory) { push @classes, 'mandatory' }
if ($self->name) { push @classes, 'argument-'.$self->name }
Jifty->web->out('<div class="'.join(' ', @classes).'">' ."\n");
Modified: jifty/branches/template-declare/lib/Jifty/Web/Menu.pm
==============================================================================
--- jifty/branches/template-declare/lib/Jifty/Web/Menu.pm (original)
+++ jifty/branches/template-declare/lib/Jifty/Web/Menu.pm Mon Mar 5 20:23:11 2007
@@ -204,7 +204,7 @@
sub render_as_context_menu {
my $self = shift;
- Jifty->web->out( qq{<ul class="context_menu">});
+ Jifty->web->out( qq{<ul class="context-menu">});
$self->render_as_hierarchical_menu_item();
Jifty->web->out(qq{</ul>});
'';
Modified: jifty/branches/template-declare/plugins/EditInPlace/lib/Jifty/Plugin/EditInPlace.pm
==============================================================================
--- jifty/branches/template-declare/plugins/EditInPlace/lib/Jifty/Plugin/EditInPlace.pm (original)
+++ jifty/branches/template-declare/plugins/EditInPlace/lib/Jifty/Plugin/EditInPlace.pm Mon Mar 5 20:23:11 2007
@@ -20,7 +20,7 @@
comp_source =>
"
<span id=\"create-component-$comp_name\">
-<% Jifty->web->link(class => 'inline_create', label => 'Create $comp_name', onclick => [ { element => \"#create-component-$comp_name\", replace_with => '/__jifty/edit_inline/mason_component/$comp_name' } ]) %>
+<% Jifty->web->link(class => 'inline-create', label => 'Create $comp_name', onclick => [ { element => \"#create-component-$comp_name\", replace_with => '/__jifty/edit_inline/mason_component/$comp_name' } ]) %>
</span>
");
Modified: jifty/branches/template-declare/plugins/Login/lib/Jifty/Plugin/Login/Action/Signup.pm
==============================================================================
--- jifty/branches/template-declare/plugins/Login/lib/Jifty/Plugin/Login/Action/Signup.pm (original)
+++ jifty/branches/template-declare/plugins/Login/lib/Jifty/Plugin/Login/Action/Signup.pm Mon Mar 5 20:23:11 2007
@@ -29,22 +29,33 @@
=cut
sub arguments {
- my $self = shift;
- my $args = $self->SUPER::arguments;
-
- my %fields = (
- name => 1,
- email => 1,
- password => 1,
- password_confirm => 1,
+ return (
+ {
+ name => {
+ label => _('Name'),
+ mandatory => 1
+ },
+ email => {
+ label => _('Email address'),
+ ajax_validates => 1,
+ },
+ password => {
+ type => 'password',
+ sticky => 0,
+ label => _('Password'),
+ mandatory => 1
+ },
+ password_confirm => {
+ type => 'password',
+ sticky => 0,
+ label => _('Type that again?'),
+ mandatory => 1
+ },
+ }
);
-
- $args->{'email'}{'ajax_validates'} = 1;
- $args->{'password_confirm'}{'label'} = _("Type that again?");
- $args->{'name'}{'label'} = _("Name");
- return $args;
}
+
=head2 validate_email
Make sure their email address looks sane
Modified: jifty/branches/template-declare/plugins/Login/share/web/templates/login
==============================================================================
--- jifty/branches/template-declare/plugins/Login/share/web/templates/login (original)
+++ jifty/branches/template-declare/plugins/Login/share/web/templates/login Mon Mar 5 20:23:11 2007
@@ -10,7 +10,7 @@
<% $action->form_field('email') %>
<% $action->form_field('password') %>
<% $action->form_field('remember') %>
-<div class="submit_button">
+<div class="jifty-submit-button">
<% Jifty->web->return(label => _('Login'), to => '/', submit => $action) %>
</div>
<% Jifty->web->form->end %>
Modified: jifty/branches/template-declare/share/web/static/css/base.css
==============================================================================
--- jifty/branches/template-declare/share/web/static/css/base.css (original)
+++ jifty/branches/template-declare/share/web/static/css/base.css Mon Mar 5 20:23:11 2007
@@ -4,7 +4,7 @@
body.calpopup {
}
-.error {
+.jifty-error {
color: #a00000;
}
@@ -20,11 +20,11 @@
clear: both;
}
-.messages .message {
+.jifty-messages .jifty-message {
display: block;
}
-div#messages, div#errors {
+div#jifty-messages, div#jifty-errors {
background-color: rgb(240,234,183);
border: 1px solid rgb(230,224,173);
margin-top: 10px;
@@ -62,7 +62,7 @@
-div.warning {
+div.jifty-warning {
position: absolute;
top: 0;
left: 0;
@@ -74,7 +74,7 @@
border-bottom: 1px solid #000;
}
-div.warning a {
+div.jifty-warning a {
color: white;
}
Modified: jifty/branches/template-declare/share/web/static/css/context-menus.css
==============================================================================
--- jifty/branches/template-declare/share/web/static/css/context-menus.css (original)
+++ jifty/branches/template-declare/share/web/static/css/context-menus.css Mon Mar 5 20:23:11 2007
@@ -1,15 +1,15 @@
-ul.context_menu {
+ul.context-menu {
clear: none;
float: left;
}
-ul.context_menu, ul.context_menu ul {
+ul.context-menu, ul.context-menu ul {
list-style: none;
margin-left: 0;
padding-left: 0;
}
-.context_menu li.toplevel {
+.context-menu li.toplevel {
float: left;
margin: 0 0.5em 0 0;
padding: 0.2em;
@@ -21,15 +21,15 @@
color: #793300;
}
-.context_menu li.toplevel ul li {
+.context-menu li.toplevel ul li {
color: gray;
}
-.context_menu li.toplevel .title {
+.context-menu li.toplevel .title {
font-weight: bold;
}
-.context_menu li.toplevel ul {
+.context-menu li.toplevel ul {
font-size: 0.9em;
display: none;
@@ -41,16 +41,16 @@
border-bottom: 1px solid grey;
}
-.context_menu li.toplevel ul a {
+.context-menu li.toplevel ul a {
width: 100%;
display: block;
}
-.context_menu .open span.expand a {
+.context-menu .open span.expand a {
background-image: url(/static/images/silk/bullet_arrow_up.png);
}
-.context_menu span.expand a {
+.context-menu span.expand a {
background: url(/static/images/silk/bullet_arrow_down.png) no-repeat center center;
padding-left: 16px;
border: 1px solid transparent;
@@ -59,29 +59,29 @@
min-height: 1em;
}
-.context_menu li.toplevel:hover .expand a {
+.context-menu li.toplevel:hover .expand a {
border-top: 1px solid grey;
border-left: 1px solid grey;
border-right: 1px solid lightgrey;
border-bottom: 1px solid lightgrey;
}
-.context_menu li.open a {
+.context-menu li.open a {
border-bottom-color: transparent;
}
-.context_menu li.open, .context_menu li.closed:hover {
+.context-menu li.open, .context-menu li.closed:hover {
border-top: 1px solid lightgrey;
border-left: 1px solid lightgrey;
border-right: 1px solid grey;
border-bottom-color: transparent;
}
-.context_menu li.closed:hover {
+.context-menu li.closed:hover {
border-bottom-color: grey;
}
-.context_menu li.toplevel span.expand a:active {
+.context-menu li.toplevel span.expand a:active {
border-top: 1px solid white;
border-left: 1px solid white;
border-right: 1px solid grey;
@@ -92,11 +92,11 @@
left: 1px;
}
-.context_menu li ul li {
+.context-menu li ul li {
padding: 0.2em;
}
-.context_menu li.open ul li:hover {
+.context-menu li.open ul li:hover {
background: #eee;
}
Modified: jifty/branches/template-declare/share/web/static/css/forms.css
==============================================================================
--- jifty/branches/template-declare/share/web/static/css/forms.css (original)
+++ jifty/branches/template-declare/share/web/static/css/forms.css Mon Mar 5 20:23:11 2007
@@ -4,7 +4,7 @@
margin: 0 auto;
}
-div.form_field {
+div.form-field {
clear: both;
padding-top: 0.5em;
}
@@ -14,7 +14,7 @@
float: left;
}
-div.form_field label.label, div.form_field span.label {
+div.form-field label.label, div.form-field span.label {
float: left;
width: 15%;
text-align: right;
@@ -22,7 +22,7 @@
padding: 0.2em 0.5em 0 0;
}
-div.form_field .hints {
+div.form-field .hints {
width: 83%;
font-size: 80%;
padding-top: 0.2em;
@@ -31,13 +31,13 @@
color: #999999;
}
-div.form_field .error, div.form_field .warning, div.form_field .canonicalization_note {
+div.form-field .error, div.form-field .warning, div.form-field .canonicalization_note {
float: right;
width: 88%;
text-align: left;
}
-div.form_field span.formw {
+div.form-field span.formw {
float: right;
width: 88%;
text-align: left;
@@ -61,12 +61,12 @@
width: 10em;
}
-.submit_button {
+.jifty-submit-button {
display: block;
clear: both;
}
-.submit_button input {
+.jifty-submit-button input {
clear: both;
margin: 0.5em 0 0 16%;
}
@@ -86,11 +86,11 @@
be overridden. ".inline" is our inline form class.
*/
-div.inline .submit_button
+div.inline .submit-button
{
}
-div.inline div.form_field {
+div.inline div.form-field {
float: left;
/* to counter previous rules */
@@ -100,8 +100,8 @@
margin-right: 0.5em;
}
-div.inline div.form_field label.label,
-div.inline div.form_field span,
+div.inline div.form-field label.label,
+div.inline div.form-field span,
div.inline .hints,
div.inline .error
{
@@ -119,7 +119,7 @@
}
-div.inline div.form_field label.label {
+div.inline div.form-field label.label {
/* aesthetic */
padding-bottom: 0.1em;
}
@@ -127,19 +127,19 @@
/* So the admin ui is one row per line */
-.jifty_admin.item.inline {
+.jifty-admin.item.inline {
clear: both;
}
-.jifty_admin .editlink {
+.jifty-admin .editlink {
float: right;
}
-.jifty_admin_header {
+.jifty-admin-header {
display: inline;
}
-.jifty_admin_header a {
+.jifty-admin-header a {
color: black;
display: block;
font-size: 0.6em;
@@ -161,14 +161,14 @@
margin-right: 0.2em;
}
-.down_select {
+.down-select {
height : 1.5em;
float: left;
background: url(/static/images/css/bullet_arrow_down.png) no-repeat bottom center;
margin-right: 0.2em;
}
-.down_select a {
+.down-select a {
font-weight: bold;
color: #900;
}
@@ -180,14 +180,14 @@
margin-right: 0.2em;
}
-.up_select {
+.up-select {
height : 1.5em;
float: left;
background: url(/static/images/css/bullet_arrow_up.png) no-repeat bottom center;
margin-right: 0.2em;
}
-.up_select a {
+.up-select a {
font-weight: bold;
color: #900;
}
Modified: jifty/branches/template-declare/share/web/static/css/halos.css
==============================================================================
--- jifty/branches/template-declare/share/web/static/css/halos.css (original)
+++ jifty/branches/template-declare/share/web/static/css/halos.css Mon Mar 5 20:23:11 2007
@@ -1,10 +1,10 @@
-.halo_actions {
+.halo-actions {
position: fixed;
border: 1px solid black;
background: #ccc;
}
-.halo_actions h1 {
+.halo-actions h1 {
color: #fff;
background-color: #600;
border-bottom: 1px solid black;
@@ -14,11 +14,11 @@
font-size: 120%;
}
-.halo_actions h1 a {
+.halo-actions h1 a {
color: #fff;
}
-.halo_actions .resize {
+.halo-actions .resize {
border: 5px solid #ccc;
border-bottom-color: #000;
border-right-color: #666;
@@ -31,7 +31,7 @@
overflow: hidden;
}
-.halo_actions .section {
+.halo-actions .section {
color: #ccc;
background-color: #300;
border-top: 1px solid black;
@@ -40,46 +40,46 @@
font-weight: bold;
}
-.halo_actions .section a {
+.halo-actions .section a {
text-align: center;
color: #ccc;
}
-.halo_actions .body {
+.halo-actions .body {
font-size: 110%;
margin:0;
padding:0 1em;
}
-.halo_actions .body ul {
+.halo-actions .body ul {
margin:0;
padding:0;
margin-left: 1em;
}
-.halo_actions .body .path {
+.halo-actions .body .path {
font-family: monospace;
font-size: 120%;
text-align: center;
}
-.halo_actions .body .time {
+.halo-actions .body .time {
font-style: italic;
text-align: center;
}
-.halo_actions .body .fixed {
+.halo-actions .body .fixed {
font-family: monospace;
}
-.halo_button {
+.halo-button {
color: yellow;
position: absolute;
z-index: 9999;
font-size:2em;
}
-#render_info_tree {
+#jifty-render-info-tree {
position: fixed;
background: white;
border: 1px solid yellow;
@@ -89,18 +89,18 @@
padding: 1em;
}
-#render_info_tree ul {
+#jifty-render-info-tree ul {
list-style: none;
padding-left: 1em;
}
-#render_info {
+#jifty-render-info {
position: fixed;
right:0.5em;
bottom:0;
}
-a.inline_edit {
+a.inline-edit {
display: block;
width: 0;
@@ -111,7 +111,7 @@
background: url(/static/images/silk/pencil.png) no-repeat 0 0;
}
-a.inline_create {
+a.inline-create {
display: block;
width: 0;
Modified: jifty/branches/template-declare/share/web/static/css/notices.css
==============================================================================
--- jifty/branches/template-declare/share/web/static/css/notices.css (original)
+++ jifty/branches/template-declare/share/web/static/css/notices.css Mon Mar 5 20:23:11 2007
@@ -1,20 +1,20 @@
/* IE can't handle this nicely w/ AJAX validation */
-html>body .message {
+html>body .jifty-message {
background: url(/static/images/silk/information.png) no-repeat center left;
padding-left: 20px;
}
-html>body .error {
+html>body .jifty-error {
background: url(/static/images/silk/error.png) no-repeat center left;
padding-left: 20px;
}
-.error {
+.jifty-error {
color: #a00000;
}
-div#messages, div#errors {
+div#jifty-messages, div#jifty-errors {
background-color: rgb(240,234,183);
border: 1px solid rgb(230,224,173);
margin-top: 10px;
@@ -24,8 +24,8 @@
position: relative;
}
-#dismiss_messages,
-#dismiss_errors
+#dismiss-jifty-messages,
+#dismiss-jifty-errors
{
padding-left: 16px;
background: url(/static/images/silk/cancel_grey.png) no-repeat;
@@ -36,4 +36,3 @@
display: block;
text-indent: -9999em;
}
-
Modified: jifty/branches/template-declare/share/web/static/js/context_menu.js
==============================================================================
--- jifty/branches/template-declare/share/web/static/js/context_menu.js (original)
+++ jifty/branches/template-declare/share/web/static/js/context_menu.js Mon Mar 5 20:23:11 2007
@@ -11,7 +11,7 @@
Jifty.ContextMenu = {
behaviourRules: {
"ul.menu li.toplevel span.expand a": prepExpandButton,
- "ul.context_menu li.toplevel span.expand a": prepExpandButton
+ "ul.context-menu li.toplevel span.expand a": prepExpandButton
},
currently_open: "",
Modified: jifty/branches/template-declare/share/web/static/js/jifty.js
==============================================================================
--- jifty/branches/template-declare/share/web/static/js/jifty.js (original)
+++ jifty/branches/template-declare/share/web/static/js/jifty.js Mon Mar 5 20:23:11 2007
@@ -475,10 +475,10 @@
Element.addClassName( e, "jifty_enter_handler_attached" );
}
},
- ".messages": function(e) {
+ ".jifty-messages": function(e) {
if ( !Element.hasClassName( e, "jifty_enter_handler_attached" ) ) {
e.innerHTML=
- '<a href="#" id="dismiss_'+e.id+'" title="Dismiss" onmousedown="this.onfocus=this.blur;" onmouseup="this.onfocus=window.clientInformation?null:window.undefined" onclick="Effect.Fade(this.parentNode); return false;">Dismiss</a>' + e.innerHTML;
+ '<a href="#" id="dismiss-'+e.id+'" title="Dismiss" onmousedown="this.onfocus=this.blur;" onmouseup="this.onfocus=window.clientInformation?null:window.undefined" onclick="Effect.Fade(this.parentNode); return false;">Dismiss</a>' + e.innerHTML;
Element.addClassName( e, "jifty_enter_handler_attached" );
}
Modified: jifty/branches/template-declare/share/web/templates/__jifty/error/_elements/wrapper
==============================================================================
--- jifty/branches/template-declare/share/web/templates/__jifty/error/_elements/wrapper (original)
+++ jifty/branches/template-declare/share/web/templates/__jifty/error/_elements/wrapper Mon Mar 5 20:23:11 2007
@@ -11,7 +11,7 @@
<div id="content">
<a name="content"></a>
% if (Jifty->config->framework('AdminMode') ) {
-<div class="warning admin_mode">
+<div class="warning admin-mode">
Alert: Jifty <% Jifty->web->tangent( label => 'administration mode' , url => '/__jifty/admin/')%> is enabled.
</div>
% }
@@ -27,4 +27,4 @@
This exists as a fallback wrapper, in case the mason error in question
is caused by the Jifty app's wrapper, for instance.
-</%doc>
\ No newline at end of file
+</%doc>
Modified: jifty/branches/template-declare/share/web/templates/__jifty/halo
==============================================================================
--- jifty/branches/template-declare/share/web/templates/__jifty/halo (original)
+++ jifty/branches/template-declare/share/web/templates/__jifty/halo Mon Mar 5 20:23:11 2007
@@ -1,5 +1,5 @@
-<div><a href="#" id="render_info" onclick="Element.toggle('render_info_tree'); return false"><%_('Page info')%></a></div>
-<div style="display: none" id="render_info_tree">
+<div><a href="#" id="jifty-render-info" onclick="Element.toggle('jifty-render-info-tree'); return false"><%_('Page info')%></a></div>
+<div style="display: none" id="jifty-render-info-tree">
% foreach my $item (@stack) {
% if ( $item->{depth} > $depth ) {
<ul>
@@ -12,7 +12,7 @@
</li>
% }
-<li><a href="#" class="halo_comp_info" onmouseover="halo_over('<% $item->{id} %>')"
+<li><a href="#" class="halo-comp-info" onmouseover="halo_over('<% $item->{id} %>')"
onmouseout="halo_out('<% $item->{id} %>')"
onclick="halo_toggle('<% $item->{id} %>'); return false;">
<% $item->{'name'} %> - <% $item->{'render_time'} %></a>
@@ -57,7 +57,7 @@
<%def .frame>
-<div class="halo_actions" id="halo-<% $id %>-menu" style="display: none; top: 5px; left: 500px; min-width: 200px; width: 300px; z-index: 5;">
+<div class="halo-actions" id="halo-<% $id %>-menu" style="display: none; top: 5px; left: 500px; min-width: 200px; width: 300px; z-index: 5;">
<h1 id="halo-<% $id %>-title">
<span style="float: right;"><a href="#" onclick="halo_toggle('<% $id %>'); return false">[ X ]</a></span>
<% $frame->{name} %>
@@ -71,7 +71,7 @@
% if ($frame->{parent}) {
<div class="section"><%_('Parent')%></div>
<div class="body"><ul>
-<li><a href="#" class="halo_comp_info" onmouseover="halo_over('<% $frame->{parent}{id} %>')"
+<li><a href="#" class="halo-comp-info" onmouseover="halo_over('<% $frame->{parent}{id} %>')"
onmouseout="halo_out('<% $frame->{parent}{id} %>')"
onclick="halo_toggle('<% $frame->{parent}{id} %>'); return false;">
<% $frame->{parent}{'path'} %> - <% $frame->{parent}{'render_time'} %></a></li>
@@ -81,7 +81,7 @@
<div class="section"><%_('Children')%></div>
<div class="body"><ul>
% for my $item (@{$frame->{kids}}) {
-<li><a href="#" class="halo_comp_info" onmouseover="halo_over('<% $item->{id} %>')"
+<li><a href="#" class="halo-comp-info" onmouseover="halo_over('<% $item->{id} %>')"
onmouseout="halo_out('<% $item->{id} %>')"
onclick="halo_toggle('<% $item->{id} %>'); return false;">
<% $item->{'path'} %> - <% $item->{'render_time'} %></a></li>
Modified: jifty/branches/template-declare/share/web/templates/_elements/wrapper
==============================================================================
--- jifty/branches/template-declare/share/web/templates/_elements/wrapper (original)
+++ jifty/branches/template-declare/share/web/templates/_elements/wrapper Mon Mar 5 20:23:11 2007
@@ -7,7 +7,7 @@
<div id="content">
<a name="content"></a>
% if (Jifty->config->framework('AdminMode') ) {
-<div class="warning admin_mode">
+<div class="jifty-warning admin-mode">
<%_('Alert')%>: <% Jifty->web->tangent( label => _('Administration mode is enabled.') , url => '/__jifty/admin/')%>
</div>
% }
More information about the Jifty-commit
mailing list