1
0

contribute.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. var h = require('cyclejs').h;
  2. module.exports = function() {
  3. var submitting = false;
  4. var exists = false;
  5. var thanks = false;
  6. return (
  7. h("div", [
  8. h("div.page-header", [
  9. h("h1", [ "Contribute" ])
  10. ]),
  11. h("div.row", [
  12. h("div#main.col-md-8", [
  13. h("h3", [ "Add a card" ]),
  14. h("p", [
  15. "Help make the game! Contribute words and make the game better. Also, please ",
  16. "original work only. Don't just blindly copy a card from any of the Taboo games."
  17. ]),
  18. h("form#cardForm", {
  19. "role": "form",
  20. "ng-submit": "submit()"
  21. }, [
  22. h("div.form-group", [
  23. h("label", {
  24. "for": "inputWord"
  25. }, [ "Word" ]),
  26. h("input#inputWord.form-control", {
  27. "type": "text",
  28. "ng-model": "card.word",
  29. "placeholder": "Word",
  30. "ng-change": "check()",
  31. "required": ""
  32. }),
  33. exists ? h("span", [ "We already have this word" ]) : null
  34. ]),
  35. h("div.form-group", [
  36. h("label", [ "Taboo Words" ]),
  37. h("input.form-control", {
  38. "type": "text",
  39. "ng-model": "card.taboos[0]",
  40. "placeholder": "Taboo Word",
  41. "required": ""
  42. }),
  43. h("input.form-control", {
  44. "type": "text",
  45. "ng-model": "card.taboos[1]",
  46. "placeholder": "Taboo Word",
  47. "required": ""
  48. }),
  49. h("input.form-control", {
  50. "type": "text",
  51. "ng-model": "card.taboos[2]",
  52. "placeholder": "Taboo Word",
  53. "required": ""
  54. }),
  55. h("input.form-control", {
  56. "type": "text",
  57. "ng-model": "card.taboos[3]",
  58. "placeholder": "Taboo Word",
  59. "required": ""
  60. }),
  61. h("input.form-control", {
  62. "type": "text",
  63. "ng-model": "card.taboos[4]",
  64. "placeholder": "Taboo Word",
  65. "required": ""
  66. })
  67. ]),
  68. h("input.btn.btn-primary", {
  69. "disabled": submitting,
  70. "type": "submit",
  71. "value": submitting ? 'Submitting...' : 'Submit'
  72. }),
  73. thanks ? h("span", [ "Thank you!" ]) : null
  74. ])
  75. ]),
  76. h("div.col-md-4.sidebar", [
  77. h("h3", [ "Help code" ]),
  78. h("p", [
  79. "Want to help code instead? Fork the ", h("a", {
  80. "href": "https://github.com/thatsmydoing/gamenchat"
  81. }, [ "repo" ]), " or submit ",
  82. "an ", h("a", {
  83. "href": "https://github.com/thatsmydoing/gamenchat/issues"
  84. }, [ "issue" ]), "."
  85. ]),
  86. h("h3", [ "Help design" ]),
  87. h("p", [
  88. "Yes, it's bootstrap. Not even custom colors. If you like it, maybe you can make it look nicer."
  89. ])
  90. ])
  91. ])
  92. ])
  93. )
  94. }