Implement admin peering widget.

Also fix singular/plural handling in names.
agranig/1_0_subfix
Andreas Granig 12 years ago
parent 761aab3220
commit f7433e3b8a

@ -22,7 +22,16 @@ has 'priority' => (
around handle => sub {
my ($foo, $self, $c) = @_;
$c->log->debug("AdminPeeringOverview::handle");
my $peer_groups = $c->model('provisioning')->resultset('voip_peer_groups')->search_rs({});
my $peer_hosts = $peer_groups->search_related_rs('voip_peer_hosts');
my $peer_rules = $peer_groups->search_related_rs('voip_peer_rules');
$c->stash(
groups => $peer_groups,
hosts => $peer_hosts,
rules => $peer_rules,
);
return;
};

@ -3,14 +3,14 @@
<div class="plan-header">
<div class="plan-title">Peerings</div>
<div class="plan-price">
<span>7</span>
<span class="term">Peering Groups</span>
<span>[% groups.count %]</span>
<span class="term">Peering Group[% groups.count == 1 ? "" : "s" %]</span>
</div>
</div>
<div class="plan-features">
<ul>
<li><strong>12</strong> Peering Servers</li>
<li><strong>24</strong> Peering Rules</li>
<li><strong>[% hosts.count %]</strong> Peering Server[% hosts.count == 1 ? "" : "s" %]</li>
<li><strong>[% rules.count %]</strong> Peering Rule[% rules.count == 1 ? "" : "s" %]</li>
</ul>
</div>
<div class="plan-actions">

@ -4,14 +4,14 @@
<div class="plan-title">Resellers</div>
<div class="plan-price">
<span>[% resellers.count %]</span>
<span class="term">Resellers</span>
<span class="term">Reseller[% resellers.count == 1 ? "" : "s" %]</span>
</div>
</div>
<div class="plan-features">
<ul>
<li><strong>[% domains.count %]</strong> Domains</li>
<li><strong>[% customers.count %]</strong> Customers</li>
<li><strong>[% subscribers.count %]</strong> Subscribers</li>
<li><strong>[% domains.count %]</strong> Domain[% domains.count == 1 ? "" : "s" %]</li>
<li><strong>[% customers.count %]</strong> Customer[% customers.count == 1 ? "" : "s" %]</li>
<li><strong>[% subscribers.count %]</strong> Subscriber[% subscribers.count == 1 ? "" : "s" %]</li>
</ul>
</div>
<div class="plan-actions">

Loading…
Cancel
Save