A corporation manager and dashboard for EVE Online
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

103 lines
4.3 KiB

  1. <%!
  2. from calefaction.format import (
  3. format_quantity, format_isk_compact, format_utctime_compact,
  4. format_security, get_security_class)
  5. %>
  6. <%def name="_killboard_kill(kill)">
  7. <%
  8. victim = kill["victim"]
  9. system = g.eve.universe.system(kill["system"])
  10. killed = g.eve.universe.killable(victim["ship_id"])
  11. %>
  12. <tr>
  13. <td class="fluid">
  14. <abbr title="${kill["date"].strftime("%Y-%m-%d %H:%M")}">${format_utctime_compact(kill["date"]) | h}</abbr><br/>
  15. <a href="https://zkillboard.com/kill/${kill['id']}/">
  16. <abbr title="${"{:,.2f}".format(kill["value"])} ISK">${format_isk_compact(kill["value"]) | h}</abbr>
  17. </a>
  18. </td>
  19. <td class="fluid extra">
  20. <a href="https://zkillboard.com/system/${system.id}/">${system.name | h}</a> <abbr title="${system.security}" class="${get_security_class(system.security)}">${format_security(system.security)}</abbr><br/>
  21. <a href="https://zkillboard.com/region/${system.region.id}/">${system.region.name | h}</a>
  22. </td>
  23. <td class="icon">
  24. <a href="https://zkillboard.com/kill/${kill['id']}/">
  25. <img title="Kill ${kill['id']}: ${killed.name | h}" alt="Kill ${kill['id']}: ${killed.name | h}" src="${g.eve.image.inventory(victim["ship_id"], 64)}"/>
  26. </a>
  27. </td>
  28. <td class="icon extra">
  29. <a href="https://zkillboard.com/character/${victim['char_id']}/">
  30. <img title="${victim['char_name'] | h}" alt="${victim['char_name'] | h}" src="${g.eve.image.character(victim["char_id"], 128)}"/>
  31. </a>
  32. </td>
  33. <td class="icon${' extra' if victim["alliance_id"] and victim["faction_id"] else ''}">
  34. <a href="https://zkillboard.com/corporation/${victim['corp_id']}/">
  35. <img title="${victim['corp_name'] | h}" alt="${victim['corp_name'] | h}" src="${g.eve.image.corp(victim["corp_id"], 128)}"/>
  36. </a>
  37. </td>
  38. <td class="icon${'' if victim["alliance_id"] else ' extra'}">
  39. % if victim["alliance_id"]:
  40. <a href="https://zkillboard.com/alliance/${victim['alliance_id']}/">
  41. <img title="${victim['alliance_name'] | h}" alt="${victim['alliance_name'] | h}" src="${g.eve.image.alliance(victim["alliance_id"], 128)}"/>
  42. </a>
  43. % endif
  44. </td>
  45. <td class="icon${'' if victim["faction_id"] else ' extra'}">
  46. % if victim["faction_id"]:
  47. <a href="https://zkillboard.com/faction/${victim['faction_id']}/">
  48. <img title="${victim['faction_name'] | h}" alt="${victim['faction_name'] | h}" src="${g.eve.image.faction(victim["faction_id"], 128)}"/>
  49. </a>
  50. % endif
  51. </td>
  52. % if not victim["alliance_id"] and not victim["faction_id"]:
  53. <td class="icon spacer"></td>
  54. % endif
  55. </tr>
  56. </%def>
  57. <%def name="_itemboard_item(item)">
  58. <%
  59. type_id, count, value = item
  60. type = g.eve.universe.type(type_id)
  61. %>
  62. <tr>
  63. <td class="icon">
  64. <img title="${type.name | h}" alt="" src="${g.eve.image.inventory(type_id, 64)}"/>
  65. </td>
  66. <td>
  67. <a href="https://eve-central.com/home/quicklook.html?typeid=${type_id | u}">${type.name | h}</a>
  68. </td>
  69. <td>
  70. <span class="count">${format_quantity(count) | h}</span><br/>
  71. <abbr class="price" title="${"{:,.2f}".format(value)} ISK">${format_isk_compact(value) | h}</abbr>
  72. </td>
  73. </tr>
  74. </%def>
  75. <%def name="_killboard_recent(summary)">
  76. <div class="head">Most recent kills:</div>
  77. <div class="contents">
  78. <table class="board killboard">
  79. % for kill in summary:
  80. ${_killboard_kill(kill)}
  81. % endfor
  82. </table>
  83. </div>
  84. </%def>
  85. <%def name="_collection_items(summary)">
  86. <div class="head">Top items:</div>
  87. <div class="contents">
  88. <table class="board itemboard">
  89. % for item in summary:
  90. ${_itemboard_item(item)}
  91. % endfor
  92. </table>
  93. </div>
  94. </%def>
  95. <%def name="render_summary(renderer, summary)"><%
  96. if renderer == "killboard_recent":
  97. return _killboard_recent(summary)
  98. if renderer == "collection_items":
  99. return _collection_items(summary)
  100. raise RuntimeError("Unknown renderer: %s" % renderer)
  101. %></%def>