Mailing List Archive

How to style CatalystX::Controller::Auth?
Hi,

I would like to style login form with Twitter Bootstrap without
change sent html in browser using js.

I don't understand how to do this in CatalystX::Controller::Auth.

Is there any example of customization of it?


Thank you in advance for your anwser or hint. \ferz

_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
Re: How to style CatalystX::Controller::Auth? [ In reply to ]
Hi Ferz,

I'm a little confused as to what you're trying to do exactly.

Here's a simple typical TT example of the login form using
CatalystX::Controller::Auth...


<form method="post" action="[%
c.uri_for_action('/auth/login') | html %]" autocomplete="off"
id="loginform" >

[% form.field('email').render %]

[% form.field('password').render %]

[% form.field('submit').render %]

</form>

If modifications are needed to CatalystX::Controller::Auth to achieve
your goals and work better with Twitter Bootstrap let me know, it's not
something I've worked with before.

Cheers,
Rob




On 09/10/2013 09:30 AM, Ferruccio Zamuner wrote:
> Hi,
>
> I would like to style login form with Twitter Bootstrap without
> change sent html in browser using js.
>
> I don't understand how to do this in CatalystX::Controller::Auth.
>
> Is there any example of customization of it?
>
>
> Thank you in advance for your anwser or hint. \ferz
>
> _______________________________________________
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/


_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
Re: How to style CatalystX::Controller::Auth? [ In reply to ]
Hi Rob Brown.

thank you for your reply.

On 09/10/13 10:55, Rob Brown wrote:
> Hi Ferz,
>
> I'm a little confused as to what you're trying to do exactly.
>
> Here's a simple typical TT example of the login form using
> CatalystX::Controller::Auth...
>
>
> If modifications are needed to CatalystX::Controller::Auth to achieve
> your goals and work better with Twitter Bootstrap let me know, it's not
> something I've worked with before.

Yes, I would like to override the form definition to include:

with 'HTML::FormHandler::Widget::Theme::BootstrapFormMessages';
has '+widget_wrapper' => ( default => 'Bootstrap' );
has '+is_html5' => (default=>1);


so widgets will get bootstrap wrapper for validation errors and
bootstrap css classes.


Thank you in advance, \ferz

_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
Re: How to style CatalystX::Controller::Auth? [ In reply to ]
Hi,

I have never worked with C::C::Auth or Twitter Bootstrap. So please ignore
me if my comment is not helpful...

If you just need to add something to the form definition, isn't it
possible to just subclass HFH::Form::Login, add or modify whatever you
need, and configure C::C::Auth to use your own Form class instead of
HFH::Form::Login?

in your form:

package LoginForm::Bootstrap;
use HTML::FormHandler::Moose;
extends 'HTML::FormHandlerX::Form::Login';
with 'HTML::FormHandler::Widget::Theme::BootstrapFormMessages';
has '+widget_wrapper' => ( default => 'Bootstrap' );
has '+is_html5' => (default=>1);
__PACKAGE__->meta->make_immutable;
use namespace::autoclean;
1;

and in your config:

<Controller::Auth>

form_handler LoginForm::Bootstrap
...
</Controller::Auth>

cheers, Lukas

> Hi Rob Brown.
>
> thank you for your reply.
>
> On 09/10/13 10:55, Rob Brown wrote:
>> Hi Ferz,
>>
>> I'm a little confused as to what you're trying to do exactly.
>>
>> Here's a simple typical TT example of the login form using
>> CatalystX::Controller::Auth...
>>
>>
>> If modifications are needed to CatalystX::Controller::Auth to achieve
>> your goals and work better with Twitter Bootstrap let me know, it's not
>> something I've worked with before.
>
> Yes, I would like to override the form definition to include:
>
> with 'HTML::FormHandler::Widget::Theme::BootstrapFormMessages';
> has '+widget_wrapper' => ( default => 'Bootstrap' );
> has '+is_html5' => (default=>1);
>
>
> so widgets will get bootstrap wrapper for validation errors and
> bootstrap css classes.
>
>
> Thank you in advance, \ferz
>
> _______________________________________________
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>



_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
Re: How to style CatalystX::Controller::Auth? [ In reply to ]
Thanks Lukas, just what I was going to suggest :)

Wasn't sure if I'd made the form module a config option, but thankfully
I did, so the sub-classing approach should work fine.


On 09/11/2013 10:09 AM, spamcatcher@thiemeier.net wrote:
> Hi,
>
> I have never worked with C::C::Auth or Twitter Bootstrap. So please ignore
> me if my comment is not helpful...
>
> If you just need to add something to the form definition, isn't it
> possible to just subclass HFH::Form::Login, add or modify whatever you
> need, and configure C::C::Auth to use your own Form class instead of
> HFH::Form::Login?
>
> in your form:
>
> package LoginForm::Bootstrap;
> use HTML::FormHandler::Moose;
> extends 'HTML::FormHandlerX::Form::Login';
> with 'HTML::FormHandler::Widget::Theme::BootstrapFormMessages';
> has '+widget_wrapper' => ( default => 'Bootstrap' );
> has '+is_html5' => (default=>1);
> __PACKAGE__->meta->make_immutable;
> use namespace::autoclean;
> 1;
>
> and in your config:
>
> <Controller::Auth>
>
> form_handler LoginForm::Bootstrap
> ...
> </Controller::Auth>
>
> cheers, Lukas
>
>> Hi Rob Brown.
>>
>> thank you for your reply.
>>
>> On 09/10/13 10:55, Rob Brown wrote:
>>> Hi Ferz,
>>>
>>> I'm a little confused as to what you're trying to do exactly.
>>>
>>> Here's a simple typical TT example of the login form using
>>> CatalystX::Controller::Auth...
>>>
>>>
>>> If modifications are needed to CatalystX::Controller::Auth to achieve
>>> your goals and work better with Twitter Bootstrap let me know, it's not
>>> something I've worked with before.
>> Yes, I would like to override the form definition to include:
>>
>> with 'HTML::FormHandler::Widget::Theme::BootstrapFormMessages';
>> has '+widget_wrapper' => ( default => 'Bootstrap' );
>> has '+is_html5' => (default=>1);
>>
>>
>> so widgets will get bootstrap wrapper for validation errors and
>> bootstrap css classes.
>>
>>
>> Thank you in advance, \ferz
>>
>> _______________________________________________
>> List: Catalyst@lists.scsys.co.uk
>> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>> Searchable archive:
>> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
>> Dev site: http://dev.catalyst.perl.org/
>>
>
>
> _______________________________________________
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/


_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/