<% my $constructs = []; %> <% if ($category_search) { %> <% $constructs = &subs::db_query('select distinct(app),* from settings where (setting=? or setting=?) and device=? and app like ?','pos', 'mab', &subs::device_setter(), '%' . $category_search . '%')->hashes; %> <% } else { %> <% $constructs = &subs::db_query('select distinct(app),* from settings where (setting=? or setting=?) and value=? and device=?','pos','mab',$sc->{'sing'}, &subs::device_setter())->hashes; %> <% } %> <% my $c = app->build_controller; %> <% my $cd = &subs::cache_get({ app => 'relational', context => 'bubbles' }); <% if (scalar @{$constructs} > 0) { %>
<% if ($category_search ne '') { %>

<%= &subs::format_name($sc->{'sing'}) %>

<% } %> <% if (scalar @{$pconstructs->{'list'}} > 0) { %>
<% } %> <% $pconstructs = $sc; %> <% my $new_count = 0; %> <% foreach my $const ( sort { $a->{'app'} cmp $b->{'app'} } @{$constructs} ) { %> <% if ($cd->{$const->{'app'}}) { %> <%== $cd->{$const->{'app'}} %> <% } else { $new_count++; $cd->{$const->{'app'}} = $c->render_to_string( template => 'relational/bubble', const => $const, all_settings => $all_settings, settings => $settings, sc => $sc ); %> <%= $cd->{$const->{'app'}} %> <% } %> <% &subs::cache_set({ app => 'relational', context => 'bubbles', warranty => '-5y' }, $cd) if $new_count > 0; %> <% } %>
<% } %>