<%! from calefaction.format import ( format_quantity, format_isk_compact, format_utctime_compact, format_security, get_security_class) %> <%def name="_killboard_kill(kill, detail, any_alliances, any_factions)"> <% victim = kill["victim"] system = g.eve.universe.system(kill["system"]) killed = g.eve.universe.killable(victim["ship_id"]) %> ${format_utctime_compact(kill["date"]) | h}
${format_isk_compact(kill["value"]) | h} ${system.name | h} ${format_security(system.security)}
${system.region.name | h} Kill ${kill['id']}: ${killed.name | h} ${victim['char_name'] | h} % if detail: ${victim['char_name'] | h} (${killed.name | h}) % endif ${victim['corp_name'] | h} % if any_alliances: % if victim["alliance_id"]: ${victim['alliance_name'] | h} % endif % endif % if any_factions: % if victim["faction_id"]: ${victim['faction_name'] | h} % endif % endif % if not detail and (any_alliances or any_factions) and not victim["alliance_id"] and not victim["faction_id"]: % endif % if detail: ${victim['corp_name'] | h} % if victim['alliance_name']: ${victim['alliance_name'] | h} % endif % if victim['faction_name']: ${victim['faction_name'] | h} % endif % endif <%def name="_itemboard_item(item)"> <% type_id, count, value = item type = g.eve.universe.type(type_id) %> ${type.name | h} ${format_quantity(count) | h}
${format_isk_compact(value) | h} <%def name="_killboard_recent(summary, detail)"> % if detail:

Kills:

% else:
Most recent kills:
% endif <% any_alliances = any(kill["victim"]["alliance_id"] for kill in summary) any_factions = any(kill["victim"]["faction_id"] for kill in summary) %>
% for kill in summary: ${_killboard_kill(kill, detail, any_alliances, any_factions)} % endfor
<%def name="_collection_items(summary, detail)"> % if detail:

Items:

% else:
Top items:
% endif
% for item in summary: ${_itemboard_item(item)} % endfor
<%def name="render_summary(renderer, summary, detail=False)"><% if renderer == "killboard_recent": return _killboard_recent(summary, detail) if renderer == "collection_items": return _collection_items(summary, detail) raise RuntimeError("Unknown renderer: %s" % renderer) %>