2024-08-24 05:34:32 +00:00
|
|
|
% # this requires that you pass a category tree object to
|
|
|
|
% # any template that includes this component
|
|
|
|
<% my $cat_header = begin %>
|
|
|
|
% my $_cat_id = shift; my $_name = shift;
|
|
|
|
<div class="category-header category-<%= $_cat_id %>">
|
|
|
|
<b><%= $_name %></b>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% my $subf_item = begin %>
|
|
|
|
% my $_subf_id = shift; my $_cat_id = shift;
|
|
|
|
% my $_name = shift;
|
|
|
|
<div class="
|
|
|
|
subforum-item subforum-<%= $_subf_id %>
|
|
|
|
category-<%= $_cat_id %>
|
|
|
|
"><a href="/board/<%= $_subf_id %>"><%= $_name %></a></div>
|
|
|
|
<% end %>
|
|
|
|
|
2024-08-24 07:25:20 +00:00
|
|
|
% foreach my $category ($category_tree->getAllChildren) {
|
2024-08-24 05:34:32 +00:00
|
|
|
<%= $cat_header->(
|
|
|
|
$category->getNodeValue,
|
|
|
|
$c->schema->resultset('Categories')->
|
|
|
|
title_from_id($category->getNodeValue)) %>
|
2024-08-24 07:25:20 +00:00
|
|
|
|
|
|
|
% foreach my $subforum ($category->getAllChildren) {
|
2024-08-24 05:34:32 +00:00
|
|
|
<%= $subf_item->(
|
|
|
|
$subforum->getNodeValue,
|
|
|
|
$category->getNodeValue,
|
|
|
|
$c->schema->resultset('Subforums')->
|
|
|
|
title_from_id($subforum->getNodeValue)) %>
|
2024-08-24 07:25:20 +00:00
|
|
|
% }}
|