1
0

contribute.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. var h = require('cyclejs').h;
  2. module.exports = function(props) {
  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", { "role": "form" }, [
  19. h("div.form-group", [
  20. h("label", { "htmlFor": "inputWord" }, [ "Word" ]),
  21. h("input#inputWord.form-control", {
  22. "type": "text",
  23. "placeholder": "Word",
  24. "required": "true"
  25. }),
  26. exists ? h("span", [ "We already have this word" ]) : null
  27. ]),
  28. h("div.form-group",
  29. [ h("label", [ "Taboo Words" ]) ]
  30. .concat([0,1,2,3,4].map(function(item) {
  31. return h('input.form-control', {
  32. id: 'taboo'+item,
  33. type: 'text',
  34. placeholder: 'Taboo Word',
  35. value: props.contribute['taboo'+item],
  36. required: true
  37. });
  38. }))
  39. ),
  40. h("input.btn.btn-primary", {
  41. "disabled": submitting,
  42. "type": "submit",
  43. "value": submitting ? 'Submitting...' : 'Submit'
  44. }),
  45. thanks ? h("span", [ "Thank you!" ]) : null
  46. ])
  47. ]),
  48. h("div.col-md-4.sidebar", [
  49. h("h3", [ "Help code" ]),
  50. h("p", [
  51. "Want to help code instead? Fork the ", h("a", {
  52. "href": "https://github.com/thatsmydoing/gamenchat"
  53. }, [ "repo" ]), " or submit ",
  54. "an ", h("a", {
  55. "href": "https://github.com/thatsmydoing/gamenchat/issues"
  56. }, [ "issue" ]), "."
  57. ]),
  58. h("h3", [ "Help design" ]),
  59. h("p", [
  60. "Yes, it's bootstrap. Not even custom colors. If you like it, maybe you can make it look nicer."
  61. ])
  62. ])
  63. ])
  64. ])
  65. )
  66. }