Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 33801bdb

Von Cem Aydin vor fast 2 Jahren hinzugefügt

  • ID 33801bdb707947e9b120463fb4a18f4085f51cea
  • Vorgänger d11ed75b
  • Nachfolger a205073e

Generische Presenter Testseite für einfache Presenter

Enthält:
- P.date_tag
- P.date_period.picker

Unterschiede anzeigen:

SL/Controller/GenericPresenterTest.pm
1
package SL::Controller::GenericPresenterTest;
2

  
3
use strict;
4

  
5
use parent qw(SL::Controller::Base);
6

  
7
sub action_show {
8
  my ($self) = @_;
9

  
10
  $self->render(
11
    'presenter/test_page',
12
    defaults => {
13
      from_date => '1.2.2022',
14
      to_date => '3.4.2022',
15
      dialog => {
16
          year => '2022',                 # numeric year
17
          type => 'monthly',              # the radio button selection:
18
                                          # 'yearly', 'monthly', 'quarterly'
19
          quarter => 'B',                 # the quarter as a letter code:
20
                                          # 'A', 'B', 'C', 'D' A being 1st quarter etc.
21
          month => '6',                   # numeric month
22
      }
23
    }
24
  );
25
}
26

  
27
1;
locale/de/all
1759 1759
  'General settings'            => 'Allgemeine Einstellungen',
1760 1760
  'Generate and print sales delivery orders' => 'Erzeuge und drucke Lieferscheine',
1761 1761
  'Generating the document failed: #1' => 'Das Dokument konnte nicht erzeugt werden: #1',
1762
  'Generic Presenter Test'      => 'Generisch-Presenter-Test',
1762 1763
  'Generic email send address for this record type.' => 'Generischer E-Mail-Absenderadresse für diesen Belegtyp.',
1763 1764
  'Germany'                     => 'Deutschland',
1764 1765
  'Get one order'               => 'Hole eine Bestellung',
locale/en/all
1758 1758
  'General settings'            => '',
1759 1759
  'Generate and print sales delivery orders' => '',
1760 1760
  'Generating the document failed: #1' => '',
1761
  'Generic Presenter Test'      => '',
1761 1762
  'Generic email send address for this record type.' => '',
1762 1763
  'Germany'                     => '',
1763 1764
  'Get one order'               => '',
menus/user/00-erp.yaml
1627 1627
  icon: developer
1628 1628
  order: 1200
1629 1629
  access: developer
1630
- parent: develop
1631
  id: generic_presenter_test
1632
  name: Generic Presenter Test
1633
  access: developer
1634
  order: 100
1635
  params:
1636
    action: GenericPresenterTest/show
1630 1637
- parent: develop
1631 1638
  id: part_test
1632 1639
  name: Part Test
1633 1640
  access: developer
1634 1641
  icon: part
1635
  order: 100
1642
  order: 150
1636 1643
  params:
1637 1644
    action: Part/test_page
1638 1645
- parent: develop
templates/design40_webpages/presenter/test_page.html
1
[% USE L %]
2
[% USE P %]
3

  
4
<h1>Generic-Presenter-Testpage</h1>
5

  
6
<div class="wrapper">
7

  
8
  <h3>Date</h3>
9

  
10
  [% P.date_tag('my-date-id') %]<br><br>
11

  
12
  [% P.date_tag('my-date-id', defaults.from_date) %]
13
  <pre>presets: '1.2.2022'</pre>
14

  
15
  <h3>Date Period</h3>
16

  
17
  [% P.date_period.picker('my-picker-id', '', '') %]<br>
18

  
19
  [% P.date_period.picker('my-other-picker-id',
20
                            defaults.from_date,
21
                            defaults.to_date,
22
                            dialog_defaults => defaults.dialog) %]
23
  <pre>presets: '1.2.2022', '3.4.2022', dialog: '2022', 'monthly', 'B', '6'</pre>
24

  
25
</div>
templates/webpages/presenter/test_page.html
1
[% USE L %]
2
[% USE P %]
3

  
4
<h1>Generic-Presenter-Testpage</h1>
5

  
6
<h2>Date</h2>
7

  
8
[% P.date_tag('my-date-id') %]<br><br>
9

  
10
[% P.date_tag('my-date-id', defaults.from_date) %]
11
<pre>presets: '1.2.2022'</pre>
12

  
13
<h2>Date Period</h2>
14

  
15
[% P.date_period.picker('my-picker-id', '', '') %]<br>
16

  
17
[% P.date_period.picker('my-other-picker-id',
18
                          defaults.from_date,
19
                          defaults.to_date,
20
                          dialog_defaults => defaults.dialog) %]
21

  
22
<pre>presets: '1.2.2022', '3.4.2022', dialog: '2022', 'monthly', 'B', '6'</pre>

Auch abrufbar als: Unified diff