/design/templates/OpenGame/planet_list.tpl

https://github.com/myrtus/SuperNova · Smarty Template · 176 lines · 156 code · 20 blank · 0 comment · 14 complexity · 79091dc179b7a6a5493da5989360559b MD5 · raw file

  1. <!-- IF $OVERVIEW -->
  2. <!-- DEFINE $CELL_CLASS = 'class="tr"' -->
  3. <!-- ENDIF -->
  4. <!-- IF $OVERVIEW && .planet > 5 -->
  5. <!-- DEFINE $TWO_COLUMN = true -->
  6. <!-- ENDIF -->
  7. <!-- BEGIN planet -->
  8. <!-- IF ($TWO_COLUMN && planet.S_ROW_COUNT is even) || ( $OVERVIEW && ! $TWO_COLUMN) -->
  9. <!-- IF $OVERVIEW -->
  10. <!-- ENDIF -->
  11. <tr>
  12. <!-- ENDIF -->
  13. <th valign="top" {$CELL_CLASS} width="{$CELL_PLANET}"><center>
  14. <!-- IF planet.ID -->
  15. <!-- IF $OVERVIEW -->
  16. <!-- IF planet.MOON_ID == PLANET_ID -->{L_sys_moon} {planet.MOON_NAME}<!-- ELSE -->{planet.NAME}<!-- ENDIF --><br />[{planet.GALAXY}:{planet.SYSTEM}:{planet.PLANET}]<br>
  17. <!-- ENDIF -->
  18. <!-- IF planet.ID == PLANET_ID || (planet.MOON_ID == PLANET_ID && $OVERVIEW) -->
  19. <!-- DEFINE $PLANET_IMG_SIZE = 100 -->
  20. <!-- DEFINE $RESOURCE_BAR = 4 -->
  21. <!-- DEFINE $METAL_BAR = 100 -->
  22. <!-- DEFINE $CRYSTAL_BAR = 103 -->
  23. <!-- DEFINE $DEUTERIUM_BAR = 106 -->
  24. <!-- DEFINE $OVERALL_BAR = 109 -->
  25. <!-- DEFINE $FRAME_WIDTH = 112 -->
  26. <!-- ELSE -->
  27. <!-- DEFINE $PLANET_IMG_SIZE = 75 -->
  28. <!-- DEFINE $RESOURCE_BAR = 4 -->
  29. <!-- DEFINE $METAL_BAR = 75 -->
  30. <!-- DEFINE $CRYSTAL_BAR = 79 -->
  31. <!-- DEFINE $DEUTERIUM_BAR = 83 -->
  32. <!-- DEFINE $OVERALL_BAR = 87 -->
  33. <!-- DEFINE $FRAME_WIDTH = 91 -->
  34. <!-- ENDIF -->
  35. <!-- IF planet.MOON_ID == PLANET_ID -->
  36. <!-- DEFINE $MOON_IMG_SIZE = '66%' -->
  37. <!-- ELSE -->
  38. <!-- DEFINE $MOON_IMG_SIZE = '32%' -->
  39. <!-- ENDIF -->
  40. <div style="position: relative; height: {$DEUTERIUM_BAR}px; width: {$FRAME_WIDTH}px; border: 0px solid blue;">
  41. <div style="position: absolute; height: {$PLANET_IMG_SIZE}px; width: {$PLANET_IMG_SIZE}px; border: 0px solid yellow; left: 0px;">
  42. <span style="position: absolute; left: 0px; top: 0px; width: 100%; height: 100%">
  43. <!-- IF planet.IMAGE -->
  44. <a href="overview.php?cp={planet.ID}&re=0"><img style="border-style: none;" src="{dpath}planeten/{planet.IMAGE}.jpg" height="100%" width="100%"></a>
  45. <!-- ELSE -->
  46. &nbsp;
  47. <!-- ENDIF -->
  48. </span>
  49. <!-- IF planet.BUILDING -->
  50. <span title="{planet.BUILDING_TIP}" style="position: absolute; top: 0px; left: 0px; width: 25%; height: 25%" class="icon_alpha">
  51. <a href="buildings.php?cp={planet.ID}&re=0"><img src="{D_SN_ROOT_VIRTUAL}design/images/build_building.png" height="100%" width="100%"></a>
  52. </span>
  53. <!-- ENDIF -->
  54. <!-- IF planet.TECH -->
  55. <span title="{planet.TECH}" style="position: absolute; top: 25%; left: 0px; width: 25%; height: 25%" class="icon_alpha">
  56. <a href="buildings.php?mode=research&cp={planet.ID}&re=0"><img src="{D_SN_ROOT_VIRTUAL}design/images/build_tech.png" height="100%" width="100%"></a>
  57. </span>
  58. <!-- ENDIF -->
  59. <!-- IF planet.HANGAR -->
  60. <span title="{planet.HANGAR}" style="position: absolute; top: 50%; left: 0px; width: 25%; height: 25%;" class="icon_alpha">
  61. <a href="buildings.php?mode=fleet&cp={planet.ID}&re=0"><img src="{D_SN_ROOT_VIRTUAL}design/images/build_hangar.png" height="100%" width="100%"></a>
  62. </span>
  63. <!-- ENDIF -->
  64. <span style="position: absolute; bottom: 0; right: 0; cursor: pointer;" title="{L_flt_gather_all}" class="icon_alpha" onclick="document.location='fleet.php?fleet_page=5&cp={planet.ID}&re=0'">
  65. <div class="icons icon-gather"></div>
  66. </span>
  67. <!-- IF planet.FLEET_OWN -->
  68. <span style="position: absolute; top: 0px; left: 25%; width: 25%; height: 25%; cursor: pointer;" class="icon_alpha" onmouseover="fleet_dialog_show(this, '{planet.PLANET_FLEET_ID}')" onclick="document.location='fleet.php?cp={planet.ID}&re=0'">
  69. <img src="{D_SN_ROOT_VIRTUAL}design/images/icon_fleet_own.png" height="100%" width="100%">
  70. </span>
  71. <!-- ENDIF -->
  72. <!-- IF planet.FLEET_ENEMY -->
  73. <span style="position: absolute; top: 26%; left: 26%; width: 48%; height: 48%;">
  74. <img src="{D_SN_ROOT_VIRTUAL}design/images/icon_warning.png" height="100%" width="100%" style="border-style: none; cursor: pointer;" onclick="javascript:window.location = '?cp={planet.ID}&re=0'">
  75. </span>
  76. <!-- ENDIF -->
  77. <!-- IF planet.MOON_ID -->
  78. <div style="position: absolute; top: 0; right: 0; width: {$MOON_IMG_SIZE}; height: {$MOON_IMG_SIZE};">
  79. <a href="overview.php?cp={planet.MOON_ID}&re=0" title="{planet.MOON_NAME} [{planet.GALAXY}:{planet.SYSTEM}:{planet.PLANET}]"><img style="border-style: none;" src="{dpath}planeten/small/s_{planet.MOON_IMG}.jpg" height="100%" width="100%"></a>
  80. <span style="position: absolute; bottom: 0; right: 0; cursor: pointer;" title="{L_flt_gather_all}" class="icon_alpha" onclick="document.location='fleet.php?fleet_page=5&cp={planet.MOON_ID}&re=0'">
  81. <div class="icons icon-gather"></div>
  82. </span>
  83. <span style="position: absolute; left: 0; width: 100%; top: 90%; height: 10%; overflow: hidden;">
  84. <div class="fl" style="position: relative; left: 0px; height: 100%; width: {planet.MOON_FILL}%; background-color: <!-- IF planet.MOON_FILL >= 100 -->red<!-- ELSEIF planet.MOON_FILL > 80 -->yellow<!-- ELSE -->green<!-- ENDIF -->;"></div>
  85. </span>
  86. <!-- IF planet.MOON_ENEMY != 0 -->
  87. <span style="position: absolute; top: 15%; left: 15%; width: 70%; height: 70%;">
  88. <img src="{D_SN_ROOT_VIRTUAL}design/images/icon_warning.png" height="100%" width="100%" style="border-style: none; cursor: pointer;" onclick="javascript:window.location = '?cp={planet.MOON_ID}&re=0'">
  89. </span>
  90. <!-- ENDIF -->
  91. </div>
  92. <!-- ENDIF -->
  93. </div>
  94. <!-- IF planet.METAL_PERCENT < 50 -->
  95. <!-- DEFINE $FIELD_COLOR = 'negative_bg' -->
  96. <!-- ELSEIF planet.METAL_PERCENT < 80 -->
  97. <!-- DEFINE $FIELD_COLOR = 'warning_bg' -->
  98. <!-- ELSEIF planet.METAL_PERCENT < 100 -->
  99. <!-- DEFINE $FIELD_COLOR = 'neutral_bg' -->
  100. <!-- ELSE -->
  101. <!-- DEFINE $FIELD_COLOR = 'positive_bg' -->
  102. <!-- ENDIF -->
  103. <div class="{$FIELD_COLOR}" style="position: absolute; top: 0px; left: {$METAL_BAR}px; height: {$PLANET_IMG_SIZE}px; width: {$RESOURCE_BAR}px; overflow: hidden;">
  104. <div class="metal_bg" style="position: absolute; bottom: 0px; left: 0px; width: 100%; height: {planet.METAL_PERCENT}%"></div>
  105. </div>
  106. <!-- IF planet.CRYSTAL_PERCENT < 50 -->
  107. <!-- DEFINE $FIELD_COLOR = 'negative_bg' -->
  108. <!-- ELSEIF planet.CRYSTAL_PERCENT < 80 -->
  109. <!-- DEFINE $FIELD_COLOR = 'warning_bg' -->
  110. <!-- ELSEIF planet.CRYSTAL_PERCENT < 100 -->
  111. <!-- DEFINE $FIELD_COLOR = 'neutral_bg' -->
  112. <!-- ELSE -->
  113. <!-- DEFINE $FIELD_COLOR = 'positive_bg' -->
  114. <!-- ENDIF -->
  115. <div class="{$FIELD_COLOR}" style="position: absolute; top: 0px; left: {$CRYSTAL_BAR}px; height: {$PLANET_IMG_SIZE}px; width: {$RESOURCE_BAR}px; overflow: hidden;">
  116. <div class="crystal_bg" style="position: absolute; bottom: 0px; left: 0px; width: 100%; height: {planet.CRYSTAL_PERCENT}%"></div>
  117. </div>
  118. <!-- IF planet.DEUTERIUM_PERCENT < 50 -->
  119. <!-- DEFINE $FIELD_COLOR = 'negative_bg' -->
  120. <!-- ELSEIF planet.DEUTERIUM_PERCENT < 80 -->
  121. <!-- DEFINE $FIELD_COLOR = 'warning_bg' -->
  122. <!-- ELSEIF planet.DEUTERIUM_PERCENT < 100 -->
  123. <!-- DEFINE $FIELD_COLOR = 'neutral_bg' -->
  124. <!-- ELSE -->
  125. <!-- DEFINE $FIELD_COLOR = 'positive_bg' -->
  126. <!-- ENDIF -->
  127. <div class="{$FIELD_COLOR}" style="position: absolute; top: 0px; left: {$DEUTERIUM_BAR}px; height: {$PLANET_IMG_SIZE}px; width: {$RESOURCE_BAR}px; overflow: hidden;">
  128. <div class="deuterium_bg" style="position: absolute; bottom: 0px; left: 0px; width: 100%; height: {planet.DEUTERIUM_PERCENT}%"></div>
  129. </div>
  130. <!-- IF planet.FILL < 50 -->
  131. <!-- DEFINE $FIELD_COLOR = 'positive_bg' -->
  132. <!-- ELSEIF planet.FILL < 80 -->
  133. <!-- DEFINE $FIELD_COLOR = 'neutral_bg' -->
  134. <!-- ELSEIF planet.FILL < 100 -->
  135. <!-- DEFINE $FIELD_COLOR = 'warning_bg' -->
  136. <!-- ELSE -->
  137. <!-- DEFINE $FIELD_COLOR = 'negative_bg' -->
  138. <!-- ENDIF -->
  139. <div style="width: {$PLANET_IMG_SIZE}px; height: 9px; overflow: hidden; top: {$PLANET_IMG_SIZE}px; left: 0px; position: absolute;">
  140. <div style="position: absolute; left: 0px; top: 0px; height: 100%; width: {planet.FILL}%;" class="{$FIELD_COLOR}"></div>
  141. <div style="position: absolute; left: 0px; top: -1px; height: 100%; width: 100%; font-size: 9px; font-weight: bold;">{planet.FIELDS_CUR}&nbsp;/&nbsp;{planet.FIELDS_MAX}</div>
  142. </div>
  143. </div>
  144. <!-- IF planet.BUILDING -->{planet.BUILDING}<div style="width: 75; white-space: normal;" id="ov_building{planet.ID}"></div>
  145. <div id="ov_building{planet.ID}_timer" style="color: darkgrey;"></div><!-- ELSE -->{L_sys_no_task}<!-- ENDIF -->
  146. <!-- IF $OVERVIEW -->
  147. <br><br>
  148. <!-- ENDIF -->
  149. <!-- ENDIF -->
  150. </center></th>
  151. <!-- IF ($TWO_COLUMN && planet.S_ROW_COUNT is odd) || ( $OVERVIEW && ! $TWO_COLUMN) -->
  152. <!-- IF $OVERVIEW -->
  153. <!-- ENDIF -->
  154. </tr>
  155. <!-- ENDIF -->
  156. <!-- END planet -->