A corporation manager and dashboard for EVE Online
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

renderers.mako 3.5 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 | 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="_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="_collection_items(summary)">
  68. <div class="head">XXX:</div>
  69. <div class="contents">
  70. ${summary | h}
  71. </div>
  72. </%def>
  73. <%def name="render_summary(renderer, summary)"><%
  74. if renderer == "killboard_recent":
  75. return _killboard_recent(summary)
  76. if renderer == "collection_items":
  77. return _collection_items(summary)
  78. raise RuntimeError("Unknown renderer: %s" % renderer)
  79. %></%def>