<%= &subs::format_name($att) %>

<% use Mojo::JSON qw/decode_json/; my $settings = &subs::settings_grabber({ app => $a }); my $category = $settings->{'category' }; my $manufacturer = $settings->{'manufacturer' }; my $option_categories = &subs::db_query('select * from option_category where app = ? or app = ? or app = ?', $category, $a, $manufacturer)->hashes; my $manufact = &subs::db_query('select * from settings where setting=? and value like ?','categories','%' . $category . '%')->hashes; my $manufacturers = []; foreach my $man ( @{$manufact} ) { my $m = eval { return decode_json $man->{'value'} } || []; if (grep { $_ eq $category } @{$m}) { push @{$manufacturers}, $man->{'app'}; } } my $atts = &subs::db_select($att, undef, { app => $a }, { '-asc' => 'name' })->hashes; if ($manufacturer ne '') { # @{$atts} = grep { $_->{'manufacturer'} eq $manufacturer } @{$atts}; } # @{$atts} = sort { $a->{'name'} cmp $b->{'name'} } @{$atts}; unshift @{$atts}, { uuid => 'new' }; foreach my $a ( @{$atts} ) { my $chars = eval { return decode_json $a->{'characteristics'} } || []; my @option_category = grep { $_->{'name'} eq 'option_category' } @{$chars}; my @option_grouping = grep { $_->{'name'} eq 'option_grouping' } @{$chars}; @{$chars} = grep { $_->{'name'} ne 'option_category' && $_->{'name'} ne 'option_grouping' } @{$chars}; # @{$chars} = sort { $a->{'timestamp'} cmp $b->{'timestamp'} } @{$chars}; @{$chars} = sort { $a->{'name'} cmp $b->{'name'} } @{$chars}; unshift @{$chars}, { uuid => 'new' }; %>
<% if ($a->{'uuid'} ne 'new') { %> <%= &subs::format_name($a->{'name'} || 'new') %> <% } %>
<% if ($a->{'uuid'} ne 'new') { %> {'def'} eq 'on' ) { %>checked="true"<% } %>>
<% if (scalar @{$option_categories} > 0 && $att eq 'option') { %> <% } %> <% if ($att eq 'option_category') { %> <% } %>


<% foreach my $char ( @{$chars} ) { %>
<% if ($char->{'uuid'} ne 'new') { %> {'save_appt'} eq 'on') { %>checked <% } %>> <% } %>

<% } %> {'save_app'} eq 'on') { %>checked="true"<% } %>>
<% my $files = eval { return decode_json $a->{'file'} } || []; %> <% foreach my $fi ( @{$files} ) { %> <% } %>
<% } %>
<% } %>