%!
from calefaction.format import format_isk
%>
<%inherit file="../_default.mako"/>
<%namespace file="renderers.mako" import="render_summary"/>
<%block name="title">
${self.support.maketitle(campaign["title"], "Campaigns")}
%block>
<%block name="extracss">
${self.support.makecss("campaigns.css")}
%block>
<%block name="extrajs">
${self.support.makejs("campaigns.js")}
%block>
Campaign:
${campaign["title"] | h}
% if not enabled:
✘
% endif
<% mod = g.config.modules.campaigns %>
% for section in campaign["layout"]:
% for opname in section:
<%
operation = campaign["operations"][opname]
primary, secondary = mod.get_overview(name, opname)
summary, renderer = mod.get_summary(name, opname, limit=5)
klass = "big" if primary < 1000 else "medium" if primary < 1000000 else "small"
punit = mod.get_unit(operation, primary)
sunit = mod.get_unit(operation, secondary, primary=False)
%>
${"{:,}".format(primary)}
${punit}
% if secondary is not None:
${format_isk(secondary) | h}
${sunit}
% endif
% if summary:
${render_summary(renderer, summary)}
% endif
% endfor
% endfor