Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

HTMLTemplates.py

By: a guest on Oct 22nd, 2011  |  syntax: Python  |  size: 2.44 KB  |  views: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #########################################
  2. # Template for generateHTMLTimeline()
  3. #
  4. #
  5. #
  6.  
  7. timelineHTML = """
  8. <table width=200 border=0>
  9. <tr><td width=50>Tick</td><td>Acting Players</td></tr>
  10. <tr><td>0</td><td> %(0)s </td></tr>
  11. <tr><td>1</td><td> %(1)s </td></tr>
  12. <tr><td>3</td><td> %(2)s </td></tr>
  13. <tr><td>4</td><td> %(3)s </td></tr>
  14. <tr><td>5</td><td> %(4)s </td></tr>
  15. <tr><td>6</td><td> %(5)s </td></tr>
  16. <tr><td>7</td><td> %(6)s </td></tr>
  17. <tr><td>8</td><td> %(7)s </td></tr>
  18. <tr><td>9</td><td> %(8)s </td></tr>
  19. <tr><td>10</td><td> %(9)s </td></tr>
  20. <tr><td>11</td><td> %(10)s </td></tr>
  21. </table>
  22. """
  23.  
  24. #########################################
  25. # Template for generateEditPlayersScreen()
  26. #
  27. #    Format string with dict with the following STRINGS for players[i]
  28. #        playerNumber : i
  29. #        name : players[i].name
  30. #        ticks : players[i].ticks
  31. #        dv_penalty : players[i].dv_penalty
  32. #
  33.  
  34.  
  35. editPlayersRow = """
  36. <tr>
  37.        <td class="playerName">%(name)s</td>
  38.        <td class="playerTicks">%(ticks)s</td>
  39.        <td class="playerDV">%(dv_penalty)s</td>
  40.        <td class="playerAbort">
  41.                <a href="#" onClick="playerAbort(%(playerNumber)s);">Abort</a></td>
  42.        <td class="playerDelete">
  43.                <a href="#" onClick="playerDelete(%playerNumber)s);">Delete</a></td>
  44. </tr>
  45. """
  46.  
  47. ###############################################3
  48. #
  49. #  Template for the Edit Players Screen
  50. #
  51. #  STILL NEEDS JAVASCRIPT
  52. #
  53. #  Format with a string containing all player rows
  54. #
  55. #
  56.  
  57. editPlayersScreen = """
  58. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  59.  
  60. <html>
  61. <head>
  62. <title>Edit Players</title>
  63.  
  64. <style type="text/css">
  65.  
  66. table {font-family: sans-serif;}
  67.  
  68. tr.heading {background=lightgrey;}
  69.  
  70. td.playerName {width=100px;}
  71. td.playerTicks {width=50px; text-align:center;}
  72. td.playerDV {width=50px; text-align:center;}
  73. td.playerAbort {width=50px; text-align:center;}
  74. td.playerDelete {width=50px; text-align:center;}
  75.  
  76.  
  77.  
  78. </style>
  79.  
  80.  
  81. </head>
  82. <body>
  83.  
  84. <table summary="">
  85. <tr class="heading">
  86.        <td class="headingName">Name</td>
  87.        <td align="center" class="headingTicks">Ticks</td>
  88.        <td align="center" class="headingDV">DV</td>
  89.        <td align="center" class="headingAbort">Abort</td>
  90.        <td align="center" class="headingDelete">Delete</td>
  91. </tr>
  92.  
  93. %s
  94.  
  95. </table>
  96.  
  97.  
  98. </body>
  99. </html>
  100. """
  101.  
  102. playerNameHTML = """
  103. <html>
  104. <body>
  105. <font size="+3">%s</font>
  106.  
  107. """
  108.  
clone this paste RAW Paste Data