| 1 | package Strehler::FormFu::Element::DisplayOrder; | ||
| 2 | 4 | $Strehler::FormFu::Element::DisplayOrder::VERSION = '1.6.8'; | |
| 3 | 4 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 4 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 4 | extends 'HTML::FormFu::Element::Fieldset'; | |
| 7 | |||
| 8 | 14 | ▶ | after BUILD => sub { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 9 | 14 | my $self = shift; | |
| 10 | 14 | my $root_path = __FILE__; | |
| 11 | 14 | $root_path =~ s/FormFu\/Element\/DisplayOrder\.pm//; | |
| 12 | 14 | $self->load_config_file($root_path . "forms/admin/elements/display_order.yml"); | |
| 13 | 14 | $self->name("orderblock"); | |
| 14 | 14 | return; | |
| 15 | 4 | }; | |
| 16 | |||
| 17 | =encoding utf8 | ||
| 18 | |||
| 19 | =head1 NAME | ||
| 20 | |||
| 21 | Strehler::FormFu::Element::DisplayOrder - FormFu Element for Strehler Display order field. | ||
| 22 | |||
| 23 | =head1 DESCRIPTION | ||
| 24 | |||
| 25 | A FormFu element to encapsulate all the frontend logic for display order field with "Next!" button. It's just a Fieldset element with a particular configuration file hard-coded in it. | ||
| 26 | Display order field needs to be identified in a clear way and needs a fixed structure because it has to interact with Strehler javascript library. | ||
| 27 | |||
| 28 | This element hasn't the standard HTML::FormFu elements namespace because it makes sense only in a Strehler system. | ||
| 29 | |||
| 30 | =head1 SYNOPSIS | ||
| 31 | |||
| 32 | In article form: | ||
| 33 | |||
| 34 | - type: "+Strehler::FormFu::Element::DisplayOrder" | ||
| 35 | |||
| 36 | No parameters, no labels. | ||
| 37 | |||
| 38 | =head1 GENERATED HTML | ||
| 39 | |||
| 40 | <fieldset class="order-widget"> | ||
| 41 | <div> | ||
| 42 | <label for="order">Order</label> | ||
| 43 | <input type="text" id="order" value="2" name="display_order"> | ||
| 44 | </div> | ||
| 45 | <button type="button" id="last" class="btn btn-warning"> | ||
| 46 | Next! | ||
| 47 | </button> | ||
| 48 | </fieldset> | ||
| 49 | |||
| 50 | |||
| 51 | =head1 YAML CONFIGURATION | ||
| 52 | |||
| 53 | For the complete configuration see in the package: forms/admin/elements/display_order.yml | ||
| 54 | |||
| 55 | =cut | ||
| 56 | |||
| 57 | 4 | 1; | |