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.
 
 
 
 
 

72 lines
3.3 KiB

  1. <%!
  2. from calefaction.format import (
  3. format_isk_compact, format_utctime_compact, format_security,
  4. 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}</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}</a>
  22. </td>
  23. <td class="icon">
  24. <a href="https://zkillboard.com/kill/${kill['id']}/">
  25. <img title="Kill ${kill['id']}: ${killed.name}" alt="Kill ${kill['id']}: ${killed.name}" 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']}" alt="${victim['char_name']}" 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']}" alt="${victim['corp_name']}" 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']}" alt="${victim['alliance_name']}" 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']}" alt="${victim['faction_name']}" 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="_killboard_recent(summary)">
  58. <div class="head">Most recent kills:</div>
  59. <div class="contents">
  60. <table class="killboard">
  61. % for kill in summary:
  62. ${_killboard_kill(kill)}
  63. % endfor
  64. </table>
  65. </div>
  66. </%def>
  67. <%def name="render_summary(renderer, summary)"><%
  68. if renderer == "killboard_recent":
  69. return _killboard_recent(summary)
  70. raise RuntimeError("Unknown renderer: %s" % renderer)
  71. %></%def>