pulitzer 0.3.9 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/pulitzer.scss +10 -1
  3. data/app/controllers/pulitzer/content_elements_controller.rb +0 -12
  4. data/app/controllers/pulitzer/free_form_section_types_controller.rb +48 -0
  5. data/app/controllers/pulitzer/layouts_controller.rb +43 -0
  6. data/app/controllers/pulitzer/partials_controller.rb +52 -0
  7. data/app/interactions/pulitzer/clone_version.rb +10 -0
  8. data/app/interactions/pulitzer/create_partial_content_elements.rb +20 -0
  9. data/app/interactions/pulitzer/create_post_content_elements.rb +3 -0
  10. data/app/interactions/pulitzer/create_post_type_free_form_sections.rb +17 -0
  11. data/app/interactions/pulitzer/destroy_post_type_free_form_sections.rb +16 -0
  12. data/app/interactions/pulitzer/update_post_type_free_form_sections.rb +17 -0
  13. data/app/models/pulitzer/free_form_section.rb +20 -0
  14. data/app/models/pulitzer/free_form_section_type.rb +7 -0
  15. data/app/models/pulitzer/layout.rb +11 -0
  16. data/app/models/pulitzer/partial.rb +50 -0
  17. data/app/models/pulitzer/post.rb +1 -1
  18. data/app/models/pulitzer/post_type.rb +10 -6
  19. data/app/models/pulitzer/version.rb +10 -1
  20. data/app/views/pulitzer/content_elements/_form.html.erb +1 -1
  21. data/app/views/pulitzer/content_elements/_index.html.erb +1 -16
  22. data/app/views/pulitzer/content_elements/_partial_index.html.erb +5 -0
  23. data/app/views/pulitzer/content_elements/_show.html.erb +1 -1
  24. data/app/views/pulitzer/free_form_section_types/_form.html.erb +8 -0
  25. data/app/views/pulitzer/free_form_section_types/_form_fields.html.erb +2 -0
  26. data/app/views/pulitzer/free_form_section_types/_new.html.erb +7 -0
  27. data/app/views/pulitzer/free_form_section_types/_show.html.erb +9 -0
  28. data/app/views/pulitzer/free_form_section_types/_show_wrapper.html.erb +3 -0
  29. data/app/views/pulitzer/free_form_sections/_index.html.erb +3 -0
  30. data/app/views/pulitzer/free_form_sections/_show.html.erb +2 -0
  31. data/app/views/pulitzer/free_form_sections/_show_wrapper.html.erb +3 -0
  32. data/app/views/pulitzer/layouts/_form.html.erb +8 -0
  33. data/app/views/pulitzer/layouts/_form_fields.html.erb +2 -0
  34. data/app/views/pulitzer/layouts/_new.html.erb +7 -0
  35. data/app/views/pulitzer/layouts/_show.html.erb +9 -0
  36. data/app/views/pulitzer/layouts/_show_wrapper.html.erb +3 -0
  37. data/app/views/pulitzer/partials/_fields.html.erb +2 -0
  38. data/app/views/pulitzer/partials/_form.html.erb +11 -0
  39. data/app/views/pulitzer/partials/_index.html.erb +12 -0
  40. data/app/views/pulitzer/partials/_new.html.erb +16 -0
  41. data/app/views/pulitzer/partials/_show.html.erb +7 -0
  42. data/app/views/pulitzer/partials/_show_wrapper.html.erb +3 -0
  43. data/app/views/pulitzer/post_type_content_element_types/_form_fields.html.erb +4 -4
  44. data/app/views/pulitzer/post_types/_form.html.erb +1 -1
  45. data/app/views/pulitzer/post_types/_form_fields.html.erb +10 -3
  46. data/app/views/pulitzer/post_types/_show.html.erb +27 -6
  47. data/app/views/pulitzer/versions/_edit.html.erb +11 -5
  48. data/config/routes.rb +5 -1
  49. data/db/migrate/20160511192041_create_partials.rb +9 -0
  50. data/db/migrate/20160512214545_add_partial_to_content_element.rb +5 -0
  51. data/db/migrate/20160513153209_create_free_form_section_type.rb +8 -0
  52. data/db/migrate/20160513153214_create_free_form_section.rb +9 -0
  53. data/db/migrate/20160516150237_fix_post_type_kinds.rb +7 -0
  54. data/db/migrate/20160517181706_create_layouts.rb +8 -0
  55. data/db/migrate/20160517182500_add_layout_to_partial.rb +5 -0
  56. data/lib/pulitzer.rb +3 -1
  57. data/lib/pulitzer/version.rb +1 -1
  58. data/spec/controllers/pulitzer/free_form_section_types_controller_spec.rb +45 -0
  59. data/spec/controllers/pulitzer/partials_controller_spec.rb +42 -0
  60. data/spec/dummy/db/development.sqlite3 +0 -0
  61. data/spec/dummy/db/schema.rb +25 -1
  62. data/spec/dummy/db/test.sqlite3 +0 -0
  63. data/spec/dummy/log/development.log +151 -0
  64. data/spec/dummy/log/test.log +49898 -0
  65. data/spec/dummy/public/uploads/tmp/1452811005-24393-0063/sam_and_snow.jpg +0 -0
  66. data/spec/dummy/public/uploads/tmp/1452811005-24393-0063/thumb_sam_and_snow.jpg +0 -0
  67. data/spec/dummy/public/uploads/tmp/1452811173-24792-0199/sam_and_snow.jpg +0 -0
  68. data/spec/dummy/public/uploads/tmp/1452811173-24792-0199/thumb_sam_and_snow.jpg +0 -0
  69. data/spec/dummy/public/uploads/tmp/1453327522-88240-8875/cms_sam_and_snow.jpg +0 -0
  70. data/spec/dummy/public/uploads/tmp/1453327522-88240-8875/sam_and_snow.jpg +0 -0
  71. data/spec/dummy/public/uploads/tmp/1453327522-88240-8875/thumb_sam_and_snow.jpg +0 -0
  72. data/spec/dummy/public/uploads/tmp/1453327846-88664-1819/cms_sam_and_snow.jpg +0 -0
  73. data/spec/dummy/public/uploads/tmp/1453327846-88664-1819/sam_and_snow.jpg +0 -0
  74. data/spec/dummy/public/uploads/tmp/1453327846-88664-1819/thumb_sam_and_snow.jpg +0 -0
  75. data/spec/dummy/public/uploads/tmp/1453327891-88742-0077/cms_sam_and_snow.jpg +0 -0
  76. data/spec/dummy/public/uploads/tmp/1453327891-88742-0077/sam_and_snow.jpg +0 -0
  77. data/spec/dummy/public/uploads/tmp/1453327891-88742-0077/thumb_sam_and_snow.jpg +0 -0
  78. data/spec/dummy/public/uploads/tmp/1453327908-88792-8689/cms_sam_and_snow.jpg +0 -0
  79. data/spec/dummy/public/uploads/tmp/1453327908-88792-8689/sam_and_snow.jpg +0 -0
  80. data/spec/dummy/public/uploads/tmp/1453327908-88792-8689/thumb_sam_and_snow.jpg +0 -0
  81. data/spec/dummy/public/uploads/tmp/1453327942-88859-9073/cms_sam_and_snow.jpg +0 -0
  82. data/spec/dummy/public/uploads/tmp/1453327942-88859-9073/sam_and_snow.jpg +0 -0
  83. data/spec/dummy/public/uploads/tmp/1453327942-88859-9073/thumb_sam_and_snow.jpg +0 -0
  84. data/spec/dummy/public/uploads/tmp/1453328584-89616-8416/cms_sam_and_snow.jpg +0 -0
  85. data/spec/dummy/public/uploads/tmp/1453328584-89616-8416/sam_and_snow.jpg +0 -0
  86. data/spec/dummy/public/uploads/tmp/1453328584-89616-8416/thumb_sam_and_snow.jpg +0 -0
  87. data/spec/dummy/public/uploads/tmp/1453328600-89648-3830/cms_sam_and_snow.jpg +0 -0
  88. data/spec/dummy/public/uploads/tmp/1453328600-89648-3830/sam_and_snow.jpg +0 -0
  89. data/spec/dummy/public/uploads/tmp/1453328600-89648-3830/thumb_sam_and_snow.jpg +0 -0
  90. data/spec/dummy/public/uploads/tmp/1453328621-89685-3083/cms_sam_and_snow.jpg +0 -0
  91. data/spec/dummy/public/uploads/tmp/1453328621-89685-3083/sam_and_snow.jpg +0 -0
  92. data/spec/dummy/public/uploads/tmp/1453328621-89685-3083/thumb_sam_and_snow.jpg +0 -0
  93. data/spec/dummy/public/uploads/tmp/1453328659-89747-3646/cms_sam_and_snow.jpg +0 -0
  94. data/spec/dummy/public/uploads/tmp/1453328659-89747-3646/sam_and_snow.jpg +0 -0
  95. data/spec/dummy/public/uploads/tmp/1453328659-89747-3646/thumb_sam_and_snow.jpg +0 -0
  96. data/spec/dummy/public/uploads/tmp/1453328908-90227-0244/cms_sam_and_snow.jpg +0 -0
  97. data/spec/dummy/public/uploads/tmp/1453328908-90227-0244/sam_and_snow.jpg +0 -0
  98. data/spec/dummy/public/uploads/tmp/1453328908-90227-0244/thumb_sam_and_snow.jpg +0 -0
  99. data/spec/dummy/public/uploads/tmp/1453328976-90335-7466/cms_sam_and_snow.jpg +0 -0
  100. data/spec/dummy/public/uploads/tmp/1453328976-90335-7466/sam_and_snow.jpg +0 -0
  101. data/spec/dummy/public/uploads/tmp/1453328976-90335-7466/thumb_sam_and_snow.jpg +0 -0
  102. data/spec/dummy/public/uploads/tmp/1453329010-90384-7488/cms_sam_and_snow.jpg +0 -0
  103. data/spec/dummy/public/uploads/tmp/1453329010-90384-7488/sam_and_snow.jpg +0 -0
  104. data/spec/dummy/public/uploads/tmp/1453329010-90384-7488/thumb_sam_and_snow.jpg +0 -0
  105. data/spec/dummy/public/uploads/tmp/1453329018-90436-7916/cms_sam_and_snow.jpg +0 -0
  106. data/spec/dummy/public/uploads/tmp/1453329018-90436-7916/sam_and_snow.jpg +0 -0
  107. data/spec/dummy/public/uploads/tmp/1453329018-90436-7916/thumb_sam_and_snow.jpg +0 -0
  108. data/spec/dummy/public/uploads/tmp/1453393083-47505-1178/cms_sam_and_snow.jpg +0 -0
  109. data/spec/dummy/public/uploads/tmp/1453393083-47505-1178/sam_and_snow.jpg +0 -0
  110. data/spec/dummy/public/uploads/tmp/1453393083-47505-1178/thumb_sam_and_snow.jpg +0 -0
  111. data/spec/dummy/public/uploads/tmp/1453393088-47594-1406/cms_sam_and_snow.jpg +0 -0
  112. data/spec/dummy/public/uploads/tmp/1453393088-47594-1406/sam_and_snow.jpg +0 -0
  113. data/spec/dummy/public/uploads/tmp/1453393088-47594-1406/thumb_sam_and_snow.jpg +0 -0
  114. data/spec/dummy/public/uploads/tmp/1453393124-47630-8343/cms_sam_and_snow.jpg +0 -0
  115. data/spec/dummy/public/uploads/tmp/1453393124-47630-8343/sam_and_snow.jpg +0 -0
  116. data/spec/dummy/public/uploads/tmp/1453393124-47630-8343/thumb_sam_and_snow.jpg +0 -0
  117. data/spec/dummy/public/uploads/tmp/1453393148-47674-3845/cms_sam_and_snow.jpg +0 -0
  118. data/spec/dummy/public/uploads/tmp/1453393148-47674-3845/sam_and_snow.jpg +0 -0
  119. data/spec/dummy/public/uploads/tmp/1453393148-47674-3845/thumb_sam_and_snow.jpg +0 -0
  120. data/spec/dummy/public/uploads/tmp/1453393221-47816-8142/cms_sam_and_snow.jpg +0 -0
  121. data/spec/dummy/public/uploads/tmp/1453393221-47816-8142/sam_and_snow.jpg +0 -0
  122. data/spec/dummy/public/uploads/tmp/1453393221-47816-8142/thumb_sam_and_snow.jpg +0 -0
  123. data/spec/dummy/public/uploads/tmp/1453393870-48546-6445/cms_sam_and_snow.jpg +0 -0
  124. data/spec/dummy/public/uploads/tmp/1453393870-48546-6445/sam_and_snow.jpg +0 -0
  125. data/spec/dummy/public/uploads/tmp/1453393870-48546-6445/thumb_sam_and_snow.jpg +0 -0
  126. data/spec/dummy/public/uploads/tmp/1453393926-48624-7189/cms_sam_and_snow.jpg +0 -0
  127. data/spec/dummy/public/uploads/tmp/1453393926-48624-7189/sam_and_snow.jpg +0 -0
  128. data/spec/dummy/public/uploads/tmp/1453393926-48624-7189/thumb_sam_and_snow.jpg +0 -0
  129. data/spec/dummy/public/uploads/tmp/1453393989-48708-0009/cms_sam_and_snow.jpg +0 -0
  130. data/spec/dummy/public/uploads/tmp/1453393989-48708-0009/sam_and_snow.jpg +0 -0
  131. data/spec/dummy/public/uploads/tmp/1453393989-48708-0009/thumb_sam_and_snow.jpg +0 -0
  132. data/spec/dummy/public/uploads/tmp/1453739521-68535-5576/cms_sam_and_snow.jpg +0 -0
  133. data/spec/dummy/public/uploads/tmp/1453739521-68535-5576/sam_and_snow.jpg +0 -0
  134. data/spec/dummy/public/uploads/tmp/1453739521-68535-5576/thumb_sam_and_snow.jpg +0 -0
  135. data/spec/dummy/public/uploads/tmp/1453739650-68698-8068/cms_sam_and_snow.jpg +0 -0
  136. data/spec/dummy/public/uploads/tmp/1453739650-68698-8068/sam_and_snow.jpg +0 -0
  137. data/spec/dummy/public/uploads/tmp/1453739650-68698-8068/thumb_sam_and_snow.jpg +0 -0
  138. data/spec/dummy/public/uploads/tmp/1453740957-70195-5923/cms_sam_and_snow.jpg +0 -0
  139. data/spec/dummy/public/uploads/tmp/1453740957-70195-5923/sam_and_snow.jpg +0 -0
  140. data/spec/dummy/public/uploads/tmp/1453740957-70195-5923/thumb_sam_and_snow.jpg +0 -0
  141. data/spec/dummy/public/uploads/tmp/1453741054-70338-5984/cms_sam_and_snow.jpg +0 -0
  142. data/spec/dummy/public/uploads/tmp/1453741054-70338-5984/sam_and_snow.jpg +0 -0
  143. data/spec/dummy/public/uploads/tmp/1453741054-70338-5984/thumb_sam_and_snow.jpg +0 -0
  144. data/spec/dummy/public/uploads/tmp/1453741100-70403-3570/cms_sam_and_snow.jpg +0 -0
  145. data/spec/dummy/public/uploads/tmp/1453741100-70403-3570/sam_and_snow.jpg +0 -0
  146. data/spec/dummy/public/uploads/tmp/1453741100-70403-3570/thumb_sam_and_snow.jpg +0 -0
  147. data/spec/dummy/public/uploads/tmp/1453741119-70445-1368/cms_sam_and_snow.jpg +0 -0
  148. data/spec/dummy/public/uploads/tmp/1453741119-70445-1368/sam_and_snow.jpg +0 -0
  149. data/spec/dummy/public/uploads/tmp/1453741119-70445-1368/thumb_sam_and_snow.jpg +0 -0
  150. data/spec/dummy/public/uploads/tmp/1453741152-70510-7020/cms_sam_and_snow.jpg +0 -0
  151. data/spec/dummy/public/uploads/tmp/1453741152-70510-7020/sam_and_snow.jpg +0 -0
  152. data/spec/dummy/public/uploads/tmp/1453741152-70510-7020/thumb_sam_and_snow.jpg +0 -0
  153. data/spec/dummy/public/uploads/tmp/1453741165-70539-8838/cms_sam_and_snow.jpg +0 -0
  154. data/spec/dummy/public/uploads/tmp/1453741165-70539-8838/sam_and_snow.jpg +0 -0
  155. data/spec/dummy/public/uploads/tmp/1453741165-70539-8838/thumb_sam_and_snow.jpg +0 -0
  156. data/spec/dummy/public/uploads/tmp/1453741192-70601-8114/cms_sam_and_snow.jpg +0 -0
  157. data/spec/dummy/public/uploads/tmp/1453741192-70601-8114/sam_and_snow.jpg +0 -0
  158. data/spec/dummy/public/uploads/tmp/1453741192-70601-8114/thumb_sam_and_snow.jpg +0 -0
  159. data/spec/dummy/public/uploads/tmp/1453741252-70701-6629/cms_sam_and_snow.jpg +0 -0
  160. data/spec/dummy/public/uploads/tmp/1453741252-70701-6629/sam_and_snow.jpg +0 -0
  161. data/spec/dummy/public/uploads/tmp/1453741252-70701-6629/thumb_sam_and_snow.jpg +0 -0
  162. data/spec/dummy/public/uploads/tmp/1454010788-22795-5507/cms_sam_and_snow.jpg +0 -0
  163. data/spec/dummy/public/uploads/tmp/1454010788-22795-5507/sam_and_snow.jpg +0 -0
  164. data/spec/dummy/public/uploads/tmp/1454010788-22795-5507/thumb_sam_and_snow.jpg +0 -0
  165. data/spec/dummy/public/uploads/tmp/1454011239-23492-4674/cms_sam_and_snow.jpg +0 -0
  166. data/spec/dummy/public/uploads/tmp/1454011239-23492-4674/sam_and_snow.jpg +0 -0
  167. data/spec/dummy/public/uploads/tmp/1454011239-23492-4674/thumb_sam_and_snow.jpg +0 -0
  168. data/spec/dummy/public/uploads/tmp/1454011266-23542-4559/cms_sam_and_snow.jpg +0 -0
  169. data/spec/dummy/public/uploads/tmp/1454011266-23542-4559/sam_and_snow.jpg +0 -0
  170. data/spec/dummy/public/uploads/tmp/1454011266-23542-4559/thumb_sam_and_snow.jpg +0 -0
  171. data/spec/dummy/public/uploads/tmp/1463429995-65562-0251/cms_sam_and_snow.jpg +0 -0
  172. data/spec/dummy/public/uploads/tmp/1463429995-65562-0251/sam_and_snow.jpg +0 -0
  173. data/spec/dummy/public/uploads/tmp/1463429995-65562-0251/thumb_sam_and_snow.jpg +0 -0
  174. data/spec/dummy/public/uploads/tmp/1463430043-65638-7727/cms_sam_and_snow.jpg +0 -0
  175. data/spec/dummy/public/uploads/tmp/1463430043-65638-7727/sam_and_snow.jpg +0 -0
  176. data/spec/dummy/public/uploads/tmp/1463430043-65638-7727/thumb_sam_and_snow.jpg +0 -0
  177. data/spec/dummy/public/uploads/tmp/1463432105-68023-3063/cms_sam_and_snow.jpg +0 -0
  178. data/spec/dummy/public/uploads/tmp/1463432105-68023-3063/sam_and_snow.jpg +0 -0
  179. data/spec/dummy/public/uploads/tmp/1463432105-68023-3063/thumb_sam_and_snow.jpg +0 -0
  180. data/spec/dummy/public/uploads/tmp/1463432295-68282-2138/cms_sam_and_snow.jpg +0 -0
  181. data/spec/dummy/public/uploads/tmp/1463432295-68282-2138/sam_and_snow.jpg +0 -0
  182. data/spec/dummy/public/uploads/tmp/1463432295-68282-2138/thumb_sam_and_snow.jpg +0 -0
  183. data/spec/dummy/public/uploads/tmp/1463432657-68730-3477/cms_sam_and_snow.jpg +0 -0
  184. data/spec/dummy/public/uploads/tmp/1463432657-68730-3477/sam_and_snow.jpg +0 -0
  185. data/spec/dummy/public/uploads/tmp/1463432657-68730-3477/thumb_sam_and_snow.jpg +0 -0
  186. data/spec/dummy/public/uploads/tmp/1463432704-68798-5985/cms_sam_and_snow.jpg +0 -0
  187. data/spec/dummy/public/uploads/tmp/1463432704-68798-5985/sam_and_snow.jpg +0 -0
  188. data/spec/dummy/public/uploads/tmp/1463432704-68798-5985/thumb_sam_and_snow.jpg +0 -0
  189. data/spec/dummy/public/uploads/tmp/1463432882-69024-4017/cms_sam_and_snow.jpg +0 -0
  190. data/spec/dummy/public/uploads/tmp/1463432882-69024-4017/sam_and_snow.jpg +0 -0
  191. data/spec/dummy/public/uploads/tmp/1463432882-69024-4017/thumb_sam_and_snow.jpg +0 -0
  192. data/spec/dummy/public/uploads/tmp/1463432913-69082-5884/cms_sam_and_snow.jpg +0 -0
  193. data/spec/dummy/public/uploads/tmp/1463432913-69082-5884/sam_and_snow.jpg +0 -0
  194. data/spec/dummy/public/uploads/tmp/1463432913-69082-5884/thumb_sam_and_snow.jpg +0 -0
  195. data/spec/dummy/public/uploads/tmp/1463442041-78001-4031/cms_sam_and_snow.jpg +0 -0
  196. data/spec/dummy/public/uploads/tmp/1463442041-78001-4031/sam_and_snow.jpg +0 -0
  197. data/spec/dummy/public/uploads/tmp/1463442041-78001-4031/thumb_sam_and_snow.jpg +0 -0
  198. data/spec/dummy/public/uploads/tmp/1463442140-78140-3268/cms_sam_and_snow.jpg +0 -0
  199. data/spec/dummy/public/uploads/tmp/1463442140-78140-3268/sam_and_snow.jpg +0 -0
  200. data/spec/dummy/public/uploads/tmp/1463442140-78140-3268/thumb_sam_and_snow.jpg +0 -0
  201. data/spec/dummy/public/uploads/tmp/1463442186-78198-7364/cms_sam_and_snow.jpg +0 -0
  202. data/spec/dummy/public/uploads/tmp/1463442186-78198-7364/sam_and_snow.jpg +0 -0
  203. data/spec/dummy/public/uploads/tmp/1463442186-78198-7364/thumb_sam_and_snow.jpg +0 -0
  204. data/spec/dummy/public/uploads/tmp/1463442776-78848-1943/cms_sam_and_snow.jpg +0 -0
  205. data/spec/dummy/public/uploads/tmp/1463442776-78848-1943/sam_and_snow.jpg +0 -0
  206. data/spec/dummy/public/uploads/tmp/1463442776-78848-1943/thumb_sam_and_snow.jpg +0 -0
  207. data/spec/dummy/public/uploads/tmp/1463442832-78935-6772/cms_sam_and_snow.jpg +0 -0
  208. data/spec/dummy/public/uploads/tmp/1463442832-78935-6772/sam_and_snow.jpg +0 -0
  209. data/spec/dummy/public/uploads/tmp/1463442832-78935-6772/thumb_sam_and_snow.jpg +0 -0
  210. data/spec/dummy/public/uploads/tmp/1463442860-78978-8181/cms_sam_and_snow.jpg +0 -0
  211. data/spec/dummy/public/uploads/tmp/1463442860-78978-8181/sam_and_snow.jpg +0 -0
  212. data/spec/dummy/public/uploads/tmp/1463442860-78978-8181/thumb_sam_and_snow.jpg +0 -0
  213. data/spec/dummy/public/uploads/tmp/1463443482-79702-8123/cms_sam_and_snow.jpg +0 -0
  214. data/spec/dummy/public/uploads/tmp/1463443482-79702-8123/sam_and_snow.jpg +0 -0
  215. data/spec/dummy/public/uploads/tmp/1463443482-79702-8123/thumb_sam_and_snow.jpg +0 -0
  216. data/spec/dummy/public/uploads/tmp/1463443627-79922-4880/cms_sam_and_snow.jpg +0 -0
  217. data/spec/dummy/public/uploads/tmp/1463443627-79922-4880/sam_and_snow.jpg +0 -0
  218. data/spec/dummy/public/uploads/tmp/1463443627-79922-4880/thumb_sam_and_snow.jpg +0 -0
  219. data/spec/dummy/public/uploads/tmp/1463443847-80184-3453/cms_sam_and_snow.jpg +0 -0
  220. data/spec/dummy/public/uploads/tmp/1463443847-80184-3453/sam_and_snow.jpg +0 -0
  221. data/spec/dummy/public/uploads/tmp/1463443847-80184-3453/thumb_sam_and_snow.jpg +0 -0
  222. data/spec/dummy/public/uploads/tmp/1463444011-80461-3483/cms_sam_and_snow.jpg +0 -0
  223. data/spec/dummy/public/uploads/tmp/1463444011-80461-3483/sam_and_snow.jpg +0 -0
  224. data/spec/dummy/public/uploads/tmp/1463444011-80461-3483/thumb_sam_and_snow.jpg +0 -0
  225. data/spec/dummy/public/uploads/tmp/1463500404-81001-9924/cms_sam_and_snow.jpg +0 -0
  226. data/spec/dummy/public/uploads/tmp/1463500404-81001-9924/sam_and_snow.jpg +0 -0
  227. data/spec/dummy/public/uploads/tmp/1463500404-81001-9924/thumb_sam_and_snow.jpg +0 -0
  228. data/spec/dummy/public/uploads/tmp/1463500762-81388-3536/cms_sam_and_snow.jpg +0 -0
  229. data/spec/dummy/public/uploads/tmp/1463500762-81388-3536/sam_and_snow.jpg +0 -0
  230. data/spec/dummy/public/uploads/tmp/1463500762-81388-3536/thumb_sam_and_snow.jpg +0 -0
  231. data/spec/dummy/public/uploads/tmp/1463500770-81454-6155/cms_sam_and_snow.jpg +0 -0
  232. data/spec/dummy/public/uploads/tmp/1463500770-81454-6155/sam_and_snow.jpg +0 -0
  233. data/spec/dummy/public/uploads/tmp/1463500770-81454-6155/thumb_sam_and_snow.jpg +0 -0
  234. data/spec/dummy/public/uploads/tmp/1463500842-81525-6615/cms_sam_and_snow.jpg +0 -0
  235. data/spec/dummy/public/uploads/tmp/1463500842-81525-6615/sam_and_snow.jpg +0 -0
  236. data/spec/dummy/public/uploads/tmp/1463500842-81525-6615/thumb_sam_and_snow.jpg +0 -0
  237. data/spec/dummy/public/uploads/tmp/1463500982-81717-1186/cms_sam_and_snow.jpg +0 -0
  238. data/spec/dummy/public/uploads/tmp/1463500982-81717-1186/sam_and_snow.jpg +0 -0
  239. data/spec/dummy/public/uploads/tmp/1463500982-81717-1186/thumb_sam_and_snow.jpg +0 -0
  240. data/spec/dummy/public/uploads/tmp/1463607059-57999-0085/cms_sam_and_snow.jpg +0 -0
  241. data/spec/dummy/public/uploads/tmp/1463607059-57999-0085/sam_and_snow.jpg +0 -0
  242. data/spec/dummy/public/uploads/tmp/1463607059-57999-0085/thumb_sam_and_snow.jpg +0 -0
  243. data/spec/factories/post_type.rb +8 -0
  244. data/spec/factories/version.rb +8 -0
  245. data/spec/interactions/clone_version_spec.rb +8 -0
  246. data/spec/interactions/create_partial_content_elements_spec.rb +16 -0
  247. data/spec/interactions/create_post_content_elements_spec.rb +9 -0
  248. data/spec/models/post_type_spec.rb +1 -1
  249. metadata +449 -42
  250. data/app/views/pulitzer/content_elements/_new.html.erb +0 -25
@@ -3,13 +3,14 @@ module Pulitzer
3
3
  include ForeignOffice::Broadcaster if defined? ForeignOffice
4
4
  enum status: [ :preview, :active, :archived, :abandoned, :processing, :processing_failed ]
5
5
  has_many :content_elements, dependent: :destroy
6
+ has_many :free_form_sections, dependent: :destroy
6
7
  has_many :post_tags, dependent: :destroy
7
8
  belongs_to :post
8
9
  scope :tagged_with_type, ->(label_type){includes(:post_tags).where(pulitzer_post_tags: {label_type: label_type}).references(:pulitzer_post_tags)}
9
10
  scope :tagged_with_label, ->(label){includes(:post_tags).where(pulitzer_post_tags:{label_type: label.class.name, label_id: label.id}).references(:pulitzer_post_tags)}
10
11
  attr_accessor :processed_element_count
11
12
 
12
- delegate :allow_free_form?, :title, :slug, to: :post
13
+ delegate :has_free_form_sections?, :has_templated_content_elements?, :title, :slug, :active_version, to: :post
13
14
 
14
15
  validates :post_id, :status, presence: true
15
16
 
@@ -29,6 +30,10 @@ module Pulitzer
29
30
  self.content_elements.find_by(label: label)
30
31
  end
31
32
 
33
+ def section(name)
34
+ self.free_form_sections.find_by(name: name)
35
+ end
36
+
32
37
  def template_content_elements
33
38
  content_elements.template
34
39
  end
@@ -37,6 +42,10 @@ module Pulitzer
37
42
  content_elements.free_form
38
43
  end
39
44
 
45
+ def total_processing_elements
46
+ active_version.content_elements.count + active_version.post_tags.count + active_version.free_form_sections.count + 2
47
+ end
48
+
40
49
  def serialize
41
50
  self.attributes.merge \
42
51
  processed_element_count: self.processed_element_count
@@ -1,5 +1,5 @@
1
1
  <% if content_element.template? %>
2
- <h3><%= content_element.label %></h3>
2
+ <h5><%= content_element.label %></h5>
3
3
  <% end %>
4
4
  <%= form_for content_element, html: ajax_form_hash(dom_target(content_element)), multipart: true,
5
5
  data: { server_endpoint: content_element_path(content_element) } do |f| %>
@@ -1,20 +1,5 @@
1
- <h2>Template content elements</h2>
1
+ <h2>Page content elements</h2>
2
2
 
3
3
  <% version.template_content_elements.each do |content_element| %>
4
4
  <%= render partial: '/pulitzer/content_elements/show_wrapper', locals: { content_element: content_element } %>
5
5
  <% end %>
6
-
7
- <% if version.allow_free_form? %>
8
- <div id="<%= dom_id version, :free_form_elements %>">
9
- <h2>Free form content elements</h2>
10
- <div class="pulitzer-row margin-bottom list-item">
11
- <%= ajax_link "add a new content element for #{version.title}", new_content_element_path(version_id: version), {}, "#new_free_form_content_element_#{dom_id(version)}" %>
12
- <div id="<%= dom_id(version, :new_free_form_content_element) %>"></div>
13
- </div>
14
- <div class="pulitzer-row margin-bottom list-item" id="<%= dom_id(version, :free_form_content_element_container) %>" id="content_element_list" data-sorter href="<%= update_all_content_elements_path %>">
15
- <% version.free_form_content_elements.each do |content_element| %>
16
- <%= render partial: '/pulitzer/content_elements/show_wrapper', locals: { content_element: content_element } %>
17
- <% end %>
18
- </div>
19
- </div>
20
- <% end %>
@@ -0,0 +1,5 @@
1
+ <div class="pulitzer-row margin-left">
2
+ <% partial.content_elements.each do |content_element| %>
3
+ <%= render partial: '/pulitzer/content_elements/show_wrapper', locals: { content_element: content_element } %>
4
+ <% end %>
5
+ </div>
@@ -8,7 +8,7 @@
8
8
  <div class="pulitzer-row">
9
9
  <ul class="list">
10
10
  <% if content_element.template? %>
11
- <li><h3><%= content_element.label %></h3></li>
11
+ <li><h5><%= content_element.label %></h5></li>
12
12
  <% end %>
13
13
  <li><%= render_element(content_element) %></li>
14
14
  <li><%= ajax_link "Edit", edit_content_element_path(content_element), {}, dom_target(content_element) %></li>
@@ -0,0 +1,8 @@
1
+ <%= render 'pulitzer/shared/error_messages', object: ffst %>
2
+ <%= form_for ffst, html: ajax_form_hash(dom_target(ffst)) do |f| %>
3
+ <%= render partial: 'form_fields', locals: { f: f, ffst: ffst } %>
4
+ <%= f.submit "Update" %>
5
+ <%= link_to('Cancel', free_form_section_type_path(ffst), :class => 'button',
6
+ data: { ajax_link: true, ajax_target: dom_target(ffst) } ) %>
7
+ <% end %>
8
+
@@ -0,0 +1,2 @@
1
+ <%= f.label :name %>
2
+ <%= f.text_field :name %>
@@ -0,0 +1,7 @@
1
+ <%= form_for ffst, html: ajax_form_hash("#free_form_section_types_container_#{dom_id(ffst.post_type)}", insert_method: 'append', empty_on_success: dom_target(ffst.post_type, :new_free_form_section_type)) do |f| %>
2
+ <%= f.hidden_field :post_type_id %>
3
+ <%= render partial: 'form_fields', locals: { f: f, ffst: ffst } %>
4
+ <%= f.submit "Create" %>
5
+ <%= link_to('Cancel', '#', :class => 'button',
6
+ data: { emptier: true, target: "#new_free_form_section_type_#{dom_id(ffst.post_type)}" } ) %>
7
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <ul class="inline-list">
2
+ <li><%= ffst.name %></li>
3
+ <li>
4
+ <%= ajax_link "Edit", edit_free_form_section_type_path(ffst), {}, dom_target(ffst) %>
5
+ </li>
6
+ <li>
7
+ <%= ajax_delete 'Delete', free_form_section_type_path(ffst), {}, dom_target(ffst) %>
8
+ </li>
9
+ </ul>
@@ -0,0 +1,3 @@
1
+ <li id="<%= dom_id(ffst) %>">
2
+ <%= render partial: '/pulitzer/free_form_section_types/show', locals: {ffst: ffst} %>
3
+ </li>
@@ -0,0 +1,3 @@
1
+ <% version.free_form_sections.each do |ffs| %>
2
+ <%= render partial: '/pulitzer/free_form_sections/show_wrapper', locals: {ffs: ffs} %>
3
+ <% end %>
@@ -0,0 +1,2 @@
1
+ <h3><%= ffs.name %></h3>
2
+ <%= render partial: '/pulitzer/partials/index', locals: {free_form_section: ffs} %>
@@ -0,0 +1,3 @@
1
+ <div class="pulitzer-row" id="<%= dom_id(ffs) %>">
2
+ <%= render partial: '/pulitzer/free_form_sections/show', locals: {ffs: ffs} %>
3
+ </div>
@@ -0,0 +1,8 @@
1
+ <%= render 'pulitzer/shared/error_messages', object: layout %>
2
+ <%= form_for layout, html: ajax_form_hash(dom_target(layout)) do |f| %>
3
+ <%= render partial: 'form_fields', locals: { f: f, layout: layout } %>
4
+ <%= f.submit "Update" %>
5
+ <%= link_to('Cancel', layout_path(layout), :class => 'button',
6
+ data: { ajax_link: true, ajax_target: dom_target(layout) } ) %>
7
+ <% end %>
8
+
@@ -0,0 +1,2 @@
1
+ <%= f.label :name %>
2
+ <%= f.text_field :name %>
@@ -0,0 +1,7 @@
1
+ <%= form_for layout, html: ajax_form_hash(dom_target(layout.post_type, :layouts_container), insert_method: 'append', empty_on_success: dom_target(layout.post_type, :new_layout)) do |f| %>
2
+ <%= f.hidden_field :post_type_id %>
3
+ <%= render partial: 'form_fields', locals: { f: f, layout: layout } %>
4
+ <%= f.submit "Create" %>
5
+ <%= link_to('Cancel', '#', :class => 'button',
6
+ data: { emptier: true, target: dom_target(layout.post_type, :new_layout) } ) %>
7
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <ul class="inline-list">
2
+ <li><%= layout.name %></li>
3
+ <li>
4
+ <%= ajax_link "Edit", edit_layout_path(layout), {}, dom_target(layout) %>
5
+ </li>
6
+ <li>
7
+ <%= ajax_delete 'Delete', layout_path(layout), {}, dom_target(layout) %>
8
+ </li>
9
+ </ul>
@@ -0,0 +1,3 @@
1
+ <li id="<%= dom_id(layout) %>">
2
+ <%= render partial: '/pulitzer/layouts/show', locals: {layout: layout} %>
3
+ </li>
@@ -0,0 +1,2 @@
1
+ <%= f.collection_select :post_type_id, Pulitzer::PostType.partials, :id, :name, {}, {} %>
2
+ <%= f.collection_select :layout_id, f.object.available_layouts, :id, :name, {}, {} %>
@@ -0,0 +1,11 @@
1
+ <h3><%= partial.name %></h3>
2
+ <%= render 'pulitzer/shared/error_messages', object: partial %>
3
+ <%= form_for partial, html: ajax_form_hash(dom_target(partial)), multipart: true,
4
+ data: { server_endpoint: partial_path(partial) } do |f| %>
5
+ <%= f.collection_select :layout_id, partial.available_layouts, :id, :name, {}, {} %>
6
+ <%= submit_tag "Update" %>
7
+ <%= link_to('Cancel', partial_path(partial), :class => 'button',
8
+ data: { ajax_link: true, ajax_target: dom_target(partial) } ) %>
9
+ or
10
+ <%= ajax_delete 'delete', partial_path(partial), {class: 'button'}, dom_target(partial) %>
11
+ <% end %>
@@ -0,0 +1,12 @@
1
+ <div id="<%= dom_id free_form_section, :partial_container %>">
2
+ <% free_form_section.partials.each do |partial| %>
3
+ <%= render partial: '/pulitzer/partials/show_wrapper', locals: { partial: partial } %>
4
+ <% end %>
5
+ </div>
6
+
7
+ <div id="<%= dom_id free_form_section, :partials %>">
8
+ <div class="pulitzer-row margin-bottom list-item">
9
+ <%= ajax_link "add a new partial for #{free_form_section.name}", new_partial_path(partial: {free_form_section_id: free_form_section}), {}, dom_target(free_form_section, :new_partial) %>
10
+ <div id="<%= dom_id(free_form_section, :new_partial) %>"></div>
11
+ </div>
12
+ </div>
@@ -0,0 +1,16 @@
1
+ <%= render 'pulitzer/shared/error_messages', object: partial %>
2
+ <%= form_for partial, html: ajax_form_hash(dom_target(partial.free_form_section, :partial_container), insert_method: 'append', empty_on_success: dom_target(partial.free_form_section, :new_partial)) do |f| %>
3
+ <%= f.hidden_field :free_form_section_id %>
4
+ <%= f.collection_select :post_type_id, Pulitzer::PostType.partials, :id, :name, {}, revealer(dom_id(partial.free_form_section, :new_partial_type), highlander: true) %>
5
+ <div <%= revealer_target_attrs(dom_id(partial.free_form_section, :new_partial_type)) %>>
6
+ <% Pulitzer::PostType.partials.each do |post_type| %>
7
+ <div <%= revealer_option_attrs(dom_id(partial.free_form_section, :new_partial_type), trigger: post_type.id) %>>
8
+ <%= f.collection_select :layout_id, post_type.layouts, :id, :name, {}, {} %>
9
+ </div>
10
+ <% end %>
11
+ </div>
12
+
13
+ <%= submit_tag "Create" %>
14
+ <%= link_to('Cancel', '#', :class => 'button',
15
+ data: { emptier: true, target: dom_target(partial.free_form_section, :new_partial) } ) %>
16
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <div class="pulitzer-row">
2
+ <div class="pulitzer-span"><h5><%= partial.folder_path %>/</h5></div>
3
+ <div class="pulitzer-span margin match-h5"><%= partial.template_path %></div>
4
+ <div class="pulitzer-span match-h5"><%= ajax_link 'edit', edit_partial_path(partial), {}, dom_target(partial) %></div>
5
+ </div>
6
+
7
+ <%= render partial: '/pulitzer/content_elements/partial_index', locals: {partial: partial} %>
@@ -0,0 +1,3 @@
1
+ <div class="pulitzer-row margin-bottom list-item" id="<%= dom_id(partial) %>">
2
+ <%= render partial: '/pulitzer/partials/show', locals: { partial: partial } %>
3
+ </div>
@@ -2,19 +2,19 @@
2
2
  <%= f.text_field :label %>
3
3
  <%= f.label :content_element_type_id, "Type" %>
4
4
  <%= f.collection_select :content_element_type_id, Pulitzer::ContentElementType.all, :id, :name, {},
5
- { data: { "revealer" => true, "sub-type" => "FormFieldRevealer", "revealer-children-id" => dom_id(ptcet, :revealer) }} %>
5
+ revealer(dom_id(ptcet, :revealer), highlander: true) %>
6
6
  <%= f.hidden_field :post_type_id %>
7
7
 
8
- <div data-revealer-target="<%= dom_id(ptcet, :revealer) %>"></div>
8
+ <div <%= revealer_target_attrs(dom_id(ptcet, :revealer)) %>></div>
9
9
 
10
- <div data-revealer_id="<%= dom_id(ptcet, :revealer) %>" data-revealer-triggers="['<%= Pulitzer::ContentElementType.find_by(name: 'Image').id %>']">
10
+ <div <%= revealer_option_attrs(dom_id(ptcet, :revealer), trigger: Pulitzer::ContentElementType.find_by(name: 'Image').id) %> >
11
11
  <%= f.label :height %>
12
12
  <%= f.text_field :height, placeholder: 'Height' %>
13
13
  <%= f.label :width %>
14
14
  <%= f.text_field :width, placeholder: 'Width' %>
15
15
  </div>
16
16
 
17
- <div data-revealer_id="<%= dom_id(ptcet, :revealer) %>" data-revealer-triggers="['<%= Pulitzer::ContentElementType.find_by(name: 'Text').id %>']">
17
+ <div <%= revealer_option_attrs(dom_id(ptcet, :revealer), trigger: Pulitzer::ContentElementType.find_by(name: 'Text').id) %> >
18
18
  <%= f.label :text_editor, "Text editor" %>
19
19
  <%= f.select :text_editor, Pulitzer.text_editor_toolbars.map { |t| t[:name] } %>
20
20
  </div>
@@ -1,7 +1,7 @@
1
+ <%= render 'pulitzer/shared/error_messages', object: post_type %>
1
2
  <%= form_for post_type, html: ajax_form_hash(dom_target(post_type)) do |f| %>
2
3
  <%= render partial: 'form_fields', locals: { f: f } %>
3
4
  <%= f.submit "Update" %>
4
5
  <%= link_to('Cancel', post_type_path(post_type), :class => 'button',
5
6
  data: { ajax_link: true, ajax_target: dom_target(post_type) } ) %>
6
7
  <% end %>
7
- <%= render 'pulitzer/shared/error_messages', object: post_type %>
@@ -1,5 +1,12 @@
1
1
  <%= f.label :name %>
2
2
  <%= f.text_field :name %>
3
- <%= f.label :plural %>
4
- <%= f.check_box :plural %>
5
- <%= f.select :kind, Pulitzer::PostType.kinds.keys.map { |m| [m.humanize, m] } %>
3
+ <div <%= revealer_target_attrs(dom_id(f.object, :kind)) %>>
4
+ <div <%= revealer_option_attrs(dom_id(f.object, :kind), trigger: 'template') %>>
5
+ <%= f.label :plural %>
6
+ <%= f.check_box :plural %>
7
+ </div>
8
+ <div <%= revealer_option_attrs(dom_id(f.object, :kind), trigger: 'partial') %>>
9
+ <%= f.hidden_field :plural, value: true %>
10
+ </div>
11
+ </div>
12
+ <%= f.select :kind, Pulitzer::PostType.kinds.keys.map { |m| [m.humanize, m] }, {}, revealer(dom_id(f.object, :kind), highlander: true) %>
@@ -1,12 +1,12 @@
1
1
  <div class="pulitzer-row">
2
2
  <ul class="inline-list">
3
3
  <li><%= post_type.name %></li>
4
- <li><%= link_to_posts(post_type, 'Index', 'Manage') %></li>
5
- <% if post_type.allow_template? %>
6
- <li <%= expander("post_type_content_element_types_#{dom_id(post_type)}") %>>
7
- <%= link_to "Template", '#', class: 'toggle-post-type-content-elements', data: { post_types: post_type.id } %>
8
- </li>
4
+ <% unless post_type.partial? %>
5
+ <li><%= link_to_posts(post_type, 'Index', 'Manage') %></li>
9
6
  <% end %>
7
+ <li <%= expander("post_type_content_element_types_#{dom_id(post_type)}") %>>
8
+ <%= link_to "Template", '#', class: 'toggle-post-type-content-elements', data: { post_types: post_type.id } %>
9
+ </li>
10
10
  <li>
11
11
  <% if Pulitzer.skip_metadata_auth? || self.instance_eval(&Pulitzer.metadata_closure) %>
12
12
  <%= ajax_link "Details", edit_post_type_path(post_type), {}, dom_target(post_type) %>
@@ -21,7 +21,8 @@
21
21
  <% end %>
22
22
  </ul>
23
23
 
24
- <div <%= collapsed("post_type_content_element_types_#{dom_id(post_type)}") %> style='display:none'>
24
+ <div <%= collapsed("post_type_content_element_types_#{dom_id(post_type)}") %> class="pulitzer-hidden pulitzer-indent" >
25
+ <h5>Content Elements</h5>
25
26
  <div id="post_type_content_element_types_container_<%= dom_id(post_type) %>">
26
27
  <% post_type.post_type_content_element_types.each do |ptcet| %>
27
28
  <%= render partial: '/pulitzer/post_type_content_element_types/show_wrapper', locals: {ptcet: ptcet} %>
@@ -29,5 +30,25 @@
29
30
  </div>
30
31
  <%= ajax_link 'add a new content element for ' + post_type.name, new_post_type_content_element_type_path(post_type_id: post_type.id), {}, "#new_post_type_content_element_type_#{dom_id(post_type)}" %>
31
32
  <div id="new_post_type_content_element_type_<%= dom_id(post_type) %>"></div>
33
+
34
+ <h5>Free Form Sections</h5>
35
+ <div id="<%= dom_id(post_type, :free_form_section_types_container) %>">
36
+ <% post_type.free_form_section_types.each do |ffst| %>
37
+ <%= render partial: '/pulitzer/free_form_section_types/show_wrapper', locals: {ffst: ffst} %>
38
+ <% end %>
39
+ </div>
40
+ <%= ajax_link 'add a new section for ' + post_type.name, new_free_form_section_type_path(post_type_id: post_type.id), {}, dom_target(post_type, :new_free_form_section_type) %>
41
+ <div id="<%= dom_id(post_type, :new_free_form_section_type) %>"></div>
42
+
43
+ <% if post_type.partial? %>
44
+ <h5>Layouts</h5>
45
+ <div id="<%= dom_id(post_type, :layouts_container) %>">
46
+ <% post_type.layouts.each do |layout| %>
47
+ <%= render partial: '/pulitzer/layouts/show_wrapper', locals: {layout: layout} %>
48
+ <% end %>
49
+ </div>
50
+ <%= ajax_link 'add a new layout for ' + post_type.name, new_layout_path(layout: {post_type_id: post_type.id}), {}, dom_target(post_type, :new_layout) %>
51
+ <div id="<%= dom_id(post_type, :new_layout) %>"></div>
52
+ <% end %>
32
53
  </div>
33
54
  </div>
@@ -10,7 +10,7 @@
10
10
  <% elsif version.processing? %>
11
11
  <h2> Processing Preview for <%= version.title %> </h2>
12
12
  <div class="pulitzer-row">
13
- <progress value="0" max="<%= version.post.active_version.content_elements.count + version.post.active_version.post_tags.count + 2 %>" <%= listener_attrs version, :processed_element_count if defined? ForeignOffice %>></progress>
13
+ <progress value="0" max="<%= version.total_processing_elements %>" <%= listener_attrs version, :processed_element_count if defined? ForeignOffice %>></progress>
14
14
  </div>
15
15
  <a <%= listener_attrs version.post, :new_preview_version, trigger: true if defined? ForeignOffice %>
16
16
  <%= ajax_link_attrs(dom_target(version.post, :preview_version)) %> > </a>
@@ -23,10 +23,16 @@
23
23
  <%= render partial: 'pulitzer/post_tags/show_wrapper', locals: { version: version, tag_model: tag_model } %>
24
24
  <% end %>
25
25
  </div>
26
-
27
- <div class="pulitzer-row margin-bottom list-item">
28
- <%= render partial: '/pulitzer/content_elements/index', locals: {version: version} %>
29
- </div>
26
+ <% if version.has_templated_content_elements? %>
27
+ <div class="pulitzer-row margin-bottom list-item">
28
+ <%= render partial: '/pulitzer/content_elements/index', locals: {version: version} %>
29
+ </div>
30
+ <% end %>
31
+ <% if version.has_free_form_sections? %>
32
+ <div class="pulitzer-row margin-bottom list-item">
33
+ <%= render partial: '/pulitzer/free_form_sections/index', locals: {version: version} %>
34
+ </div>
35
+ <% end %>
30
36
 
31
37
  <div class="pulitzer-row">
32
38
  <%= render partial: 'pulitzer/versions/form', locals: { version: version } %>
data/config/routes.rb CHANGED
@@ -7,7 +7,8 @@ Pulitzer::Engine.routes.draw do
7
7
  resources :content_elements
8
8
  resources :post_tags
9
9
 
10
- resources :content_elements do
10
+ resources :content_elements
11
+ resources :partials do
11
12
  collection do
12
13
  patch :update_all
13
14
  end
@@ -16,5 +17,8 @@ Pulitzer::Engine.routes.draw do
16
17
  resources :versions
17
18
  resources :content_element_types
18
19
  resources :post_type_content_element_types
20
+ resources :free_form_section_types
21
+ resources :layouts
22
+ resources :free_form_sections
19
23
  root to: 'post_types#index'
20
24
  end
@@ -0,0 +1,9 @@
1
+ class CreatePartials < ActiveRecord::Migration
2
+ def change
3
+ create_table :pulitzer_partials do |t|
4
+ t.integer :post_type_id
5
+ t.integer :free_form_section_id
6
+ t.integer :sort_order
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ class AddPartialToContentElement < ActiveRecord::Migration
2
+ def change
3
+ add_column :pulitzer_content_elements, :partial_id, :integer
4
+ end
5
+ end
@@ -0,0 +1,8 @@
1
+ class CreateFreeFormSectionType < ActiveRecord::Migration
2
+ def change
3
+ create_table :pulitzer_free_form_section_types do |t|
4
+ t.integer :post_type_id
5
+ t.string :name
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,9 @@
1
+ class CreateFreeFormSection < ActiveRecord::Migration
2
+ def change
3
+ create_table :pulitzer_free_form_sections do |t|
4
+ t.integer :version_id
5
+ t.integer :free_form_section_type_id
6
+ t.string :name
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,7 @@
1
+ class FixPostTypeKinds < ActiveRecord::Migration
2
+ def change
3
+ Pulitzer::PostType.where(kind: [1,2]).each do |pt|
4
+ pt.update_columns(kind: 0)
5
+ end
6
+ end
7
+ end