A corporation manager and dashboard for EVE Online
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

renderers.mako 2.5 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <%!
  2. from calefaction.format import format_isk_compact, format_utctime_compact
  3. %>
  4. <%def name="_killboard_kill(kill)">
  5. <% victim = kill["victim"] %>
  6. <tr>
  7. <td class="fluid">
  8. <span>
  9. <abbr title="${kill["date"].strftime("%Y-%m-%d %H:%M")}">${format_utctime_compact(kill["date"]) | h}</abbr><br/>
  10. <abbr title="${"{:,.2f}".format(kill["value"])} ISK">${format_isk_compact(kill["value"]) | h}</abbr>
  11. </span>
  12. </td>
  13. <td class="fluid extra">
  14. <span>
  15. ${kill["system"]} 0.3<br/><!-- ... -->
  16. Region<!-- ... -->
  17. </span>
  18. </td>
  19. <td class="icon">
  20. <a href="https://zkillboard.com/kill/${kill['id']}/"><img title="" alt="<!-- ... -->" src="${g.eve.image.inventory(victim["ship_id"], 64)}"/></a>
  21. </td>
  22. <td class="icon extra">
  23. <a href="https://zkillboard.com/character/${victim['char_id']}/"><img title="" alt="<!-- ... -->" src="${g.eve.image.character(victim["char_id"], 128)}"/></a>
  24. </td>
  25. <td class="icon${' extra' if victim["alliance_id"] and victim["faction_id"] else ''}">
  26. <a href="https://zkillboard.com/corporation/${victim['corp_id']}/"><img title="" alt="<!-- ... -->" src="${g.eve.image.corp(victim["corp_id"], 128)}"/></a>
  27. </td>
  28. <td class="icon${'' if victim["alliance_id"] else ' extra'}">
  29. % if victim["alliance_id"]:
  30. <a href="https://zkillboard.com/alliance/${victim['alliance_id']}/"><img title="" alt="<!-- ... -->" src="${g.eve.image.alliance(victim["alliance_id"], 128)}"/></a>
  31. % endif
  32. </td>
  33. <td class="icon${'' if victim["faction_id"] else ' extra'}">
  34. % if victim["faction_id"]:
  35. <a href="https://zkillboard.com/faction/${victim['faction_id']}/"><img title="" alt="<!-- ... -->" src="${g.eve.image.faction(victim["faction_id"], 128)}"/></a>
  36. % endif
  37. </td>
  38. % if not victim["alliance_id"] and not victim["faction_id"]:
  39. <td class="icon spacer"></td>
  40. % endif
  41. </tr>
  42. </%def>
  43. <%def name="_killboard_recent(summary)">
  44. <div class="head">Most recent kills:</div>
  45. <div class="contents">
  46. <table class="killboard">
  47. % for kill in summary:
  48. ${_killboard_kill(kill)}
  49. % endfor
  50. </table>
  51. </div>
  52. </%def>
  53. <%def name="render_summary(renderer, summary)"><%
  54. if renderer == "killboard_recent":
  55. return _killboard_recent(summary)
  56. raise RuntimeError("Unknown renderer: %s" % renderer)
  57. %></%def>