PageRenderTime 26ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/views/edit-post.jade

https://bitbucket.org/nicklambourne/personal
Jade | 150 lines | 146 code | 4 blank | 0 comment | 1 complexity | 7ab4d1c5a054de28b3d6f454721c0922 MD5 | raw file
  1. extends blog-base
  2. block subheaders
  3. script(src='/tinymce.js', crossorigin='anonymous')
  4. block blog-content
  5. .row
  6. .col-10.offset-1
  7. form(method='post')
  8. if !post
  9. h4 New Post
  10. br
  11. input.form-control(type='text', placeholder='Title', name='title', id='title')
  12. br
  13. textarea.form-control(placeholder='Content', name='content', id='content')
  14. br
  15. button.btn.btn-success(type='submit') Create Post
  16. input(type='checkbox', name='draft', id='draft')
  17. else
  18. h4 Edit Post
  19. br
  20. input.form-control(type='text', placeholder='Title', name='title', id='title', value='#{post.title}')
  21. br
  22. textarea.form-control(placeholder='Content', name='content', id='content')
  23. | !{post.content}
  24. br
  25. button.btn.btn-success(type='submit') Update Post
  26. input(type='checkbox', name='draft', id='draft')
  27. script.
  28. tinymce.init({
  29. selector: 'textarea',
  30. plugins: 'codesample',
  31. toolbar: 'codesample',
  32. codesample_languages: [
  33. {text: 'HTML/XML', value: 'markup'},
  34. {text: "XML", value: "xml"},
  35. {text: "HTML", value: "html"},
  36. {text: "mathml", value: "mathml"},
  37. {text: "SVG", value: "svg"},
  38. {text: "CSS", value: "css"},
  39. {text: "Clike", value: "clike"},
  40. {text: "Javascript", value: "javascript"},
  41. {text: "ActionScript", value: "actionscript"},
  42. {text: "apacheconf", value: "apacheconf"},
  43. {text: "apl", value: "apl"},
  44. {text: "applescript", value: "applescript"},
  45. {text: "asciidoc", value: "asciidoc"},
  46. {text: "aspnet", value: "aspnet"},
  47. {text: "autoit", value: "autoit"},
  48. {text: "autohotkey", value: "autohotkey"},
  49. {text: "bash", value: "bash"},
  50. {text: "basic", value: "basic"},
  51. {text: "batch", value: "batch"},
  52. {text: "c", value: "c"},
  53. {text: "brainfuck", value: "brainfuck"},
  54. {text: "bro", value: "bro"},
  55. {text: "bison", value: "bison"},
  56. {text: "C#", value: "csharp"},
  57. {text: "C++", value: "cpp"},
  58. {text: "CoffeeScript", value: "coffeescript"},
  59. {text: "ruby", value: "ruby"},
  60. {text: "d", value: "d"},
  61. {text: "dart", value: "dart"},
  62. {text: "diff", value: "diff"},
  63. {text: "docker", value: "docker"},
  64. {text: "eiffel", value: "eiffel"},
  65. {text: "elixir", value: "elixir"},
  66. {text: "erlang", value: "erlang"},
  67. {text: "fsharp", value: "fsharp"},
  68. {text: "fortran", value: "fortran"},
  69. {text: "git", value: "git"},
  70. {text: "glsl", value: "glsl"},
  71. {text: "go", value: "go"},
  72. {text: "groovy", value: "groovy"},
  73. {text: "haml", value: "haml"},
  74. {text: "handlebars", value: "handlebars"},
  75. {text: "haskell", value: "haskell"},
  76. {text: "haxe", value: "haxe"},
  77. {text: "http", value: "http"},
  78. {text: "icon", value: "icon"},
  79. {text: "inform7", value: "inform7"},
  80. {text: "ini", value: "ini"},
  81. {text: "j", value: "j"},
  82. {text: "jade", value: "jade"},
  83. {text: "java", value: "java"},
  84. {text: "JSON", value: "json"},
  85. {text: "jsonp", value: "jsonp"},
  86. {text: "julia", value: "julia"},
  87. {text: "keyman", value: "keyman"},
  88. {text: "kotlin", value: "kotlin"},
  89. {text: "latex", value: "latex"},
  90. {text: "less", value: "less"},
  91. {text: "lolcode", value: "lolcode"},
  92. {text: "lua", value: "lua"},
  93. {text: "makefile", value: "makefile"},
  94. {text: "markdown", value: "markdown"},
  95. {text: "matlab", value: "matlab"},
  96. {text: "mel", value: "mel"},
  97. {text: "mizar", value: "mizar"},
  98. {text: "monkey", value: "monkey"},
  99. {text: "nasm", value: "nasm"},
  100. {text: "nginx", value: "nginx"},
  101. {text: "nim", value: "nim"},
  102. {text: "nix", value: "nix"},
  103. {text: "nsis", value: "nsis"},
  104. {text: "objectivec", value: "objectivec"},
  105. {text: "ocaml", value: "ocaml"},
  106. {text: "oz", value: "oz"},
  107. {text: "parigp", value: "parigp"},
  108. {text: "parser", value: "parser"},
  109. {text: "pascal", value: "pascal"},
  110. {text: "perl", value: "perl"},
  111. {text: "PHP", value: "php"},
  112. {text: "processing", value: "processing"},
  113. {text: "prolog", value: "prolog"},
  114. {text: "protobuf", value: "protobuf"},
  115. {text: "puppet", value: "puppet"},
  116. {text: "pure", value: "pure"},
  117. {text: "python", value: "python"},
  118. {text: "q", value: "q"},
  119. {text: "qore", value: "qore"},
  120. {text: "r", value: "r"},
  121. {text: "jsx", value: "jsx"},
  122. {text: "rest", value: "rest"},
  123. {text: "rip", value: "rip"},
  124. {text: "roboconf", value: "roboconf"},
  125. {text: "crystal", value: "crystal"},
  126. {text: "rust", value: "rust"},
  127. {text: "sas", value: "sas"},
  128. {text: "sass", value: "sass"},
  129. {text: "scss", value: "scss"},
  130. {text: "scala", value: "scala"},
  131. {text: "scheme", value: "scheme"},
  132. {text: "smalltalk", value: "smalltalk"},
  133. {text: "smarty", value: "smarty"},
  134. {text: "SQL", value: "sql"},
  135. {text: "stylus", value: "stylus"},
  136. {text: "swift", value: "swift"},
  137. {text: "tcl", value: "tcl"},
  138. {text: "textile", value: "textile"},
  139. {text: "twig", value: "twig"},
  140. {text: "TypeScript", value: "typescript"},
  141. {text: "verilog", value: "verilog"},
  142. {text: "vhdl", value: "vhdl"},
  143. {text: "wiki", value: "wiki"},
  144. {text: "YAML", value: "yaml"}
  145. ]
  146. });