Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 3a1c119f

Von Werner Hahn vor 5 Tagen hinzugefügt

  • ID 3a1c119fbf46327004ea08deb049ca281cf2df91
  • Vorgänger 4dc22cfc
  • Nachfolger 7600a20c

VariantProperty: Eigenschaften-Konfiguration Liste mit Sortierung

Unterschiede anzeigen:

SL/Controller/VariantProperty.pm
57 57
sub action_reorder_properties {
58 58
  my ($self) = @_;
59 59

  
60
  SL::DB::Shop->reorder_list(@{ $::form->{shop_id} || [] });
60
  SL::DB::VariantProperty->reorder_list(@{ $::form->{variant_property_id} || [] });
61 61
  $self->render(\'', { type => 'json' }); # ' emacs happy again
62 62
}
63 63

  
64
#sub action_list_property_values_list {
65
#  my ($self) = @_;
66
#
67
#  $self->_setup_list_action_bar;
68
#  $self->render('variant_property/variant_property_list',
69
#                title             => t8('Variant Property'),
70
#                VARIANTPROPERTIES => SL::DB::Manager::VariantProperty->get_all_sorted,
71
#               );
72
#}
73

  
74
#sub action_reorder {
75
#  my ($self) = @_;
76
#
77
#  SL::DB::DeliveryTerm->reorder_list(@{ $::form->{delivery_term_id} || [] });
78
#
79
#  $self->render(\'', { type => 'json' });     # ' make Emacs happy
80
#}
81
#
64 82
#
65 83
#inits
66 84
#
SL/DB/VariantProperty.pm
7 7

  
8 8
use SL::DB::MetaSetup::VariantProperty;
9 9
use SL::DB::Manager::VariantProperty;
10
use SL::DB::Helper::ActsAsList;
11
use SL::DB::Helper::TranslatedAttributes;
10 12

  
11 13
__PACKAGE__->meta->add_relationships(
12 14
  parent_variants => {
templates/design40_webpages/variant_property/variant_property_list.html
2 2
[% USE HTML %]
3 3
[% USE L %]
4 4
[% USE LxERP %]
5
[% USE date %]
6 5

  
7
<div id="variant_properties">
6

  
7
[%- INCLUDE 'common/flash.html' %]
8

  
9
<h1>[% title %]</h1>
8 10

  
9 11
<div class="wrapper">
10
<table class="tbl-list width-moderate">
11
  <caption>[% 'Variant Properties' | $T8 %]</caption>
12
  <thead>
13
    <tr>
14
      <th>[% 'Name'         | $T8 %]</th>
15
      <th>[% 'Unique Name'  | $T8 %]</th>
16
      <th>[% 'Abbreviation' | $T8 %]</th>
17
    </tr>
18
  </thead>
19
  <tbody>
20
    [% FOREACH row = VARIANTPROPERTIES %]
21
      <tr>
22
        <td>[% row.name         | html %]</td>
23
        <td>[% row.unique_name  | html %]</td>
24
        <td>[% row.abbreviation | html %]</td>
12
  [% IF !VARIANTPROPERTIES.size %] 
13
  <p>
14
    [%- 'No Variantproperty has been created yet.' | $T8 %] 
15
  </p>
16
  [%- ELSE %] 
17
  <table id="variant_properties" class="tbl-list width-moderate">
18
    <caption>[% 'Variant Properties' | $T8 %]</caption>
19
    <thead>
20
        <th><img src="image/updown.png" alt="[% LxERP.t8('reorder item') %]"></th>
21
        <th>[% 'Name'         | $T8 %]</th>
22
        <th>[% 'Unique Name'  | $T8 %]</th>
23
        <th>[% 'Abbreviation' | $T8 %]</th>
25 24
      </tr>
26
    [% END %]
27
  </tbody>
28
</table>
25
    </thead>
26
    <tbody>
27
      [% FOREACH variant_property = VARIANTPROPERTIES %]
28
      <tr id="variant_property_id_[% variant_property.id %]">
29
        <td class="dragdrop"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></td>
30
        <td>[% L.link(SELF.url_for(action="edit_property",
31
          id=variant_property.id), variant_property.name) %]</td>
32
        <td>[% variant_property.unique_name  | html %]</td>
33
        <td>[% variant_property.abbreviation | html %]</td>
34
        </tr>
35
      [% END %]
36
    </tbody>
37
  </table>
38
  [%- END %] 
39
</div>
40

  
41
[% L.sortable_element('#variant_properties tbody', url =>
42
SELF.url_for(action='reorder_properties'), with => 'variant_property_id') %]
29 43

  

Auch abrufbar als: Unified diff