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.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/pulitzer.scss +10 -1
- data/app/controllers/pulitzer/content_elements_controller.rb +0 -12
- data/app/controllers/pulitzer/free_form_section_types_controller.rb +48 -0
- data/app/controllers/pulitzer/layouts_controller.rb +43 -0
- data/app/controllers/pulitzer/partials_controller.rb +52 -0
- data/app/interactions/pulitzer/clone_version.rb +10 -0
- data/app/interactions/pulitzer/create_partial_content_elements.rb +20 -0
- data/app/interactions/pulitzer/create_post_content_elements.rb +3 -0
- data/app/interactions/pulitzer/create_post_type_free_form_sections.rb +17 -0
- data/app/interactions/pulitzer/destroy_post_type_free_form_sections.rb +16 -0
- data/app/interactions/pulitzer/update_post_type_free_form_sections.rb +17 -0
- data/app/models/pulitzer/free_form_section.rb +20 -0
- data/app/models/pulitzer/free_form_section_type.rb +7 -0
- data/app/models/pulitzer/layout.rb +11 -0
- data/app/models/pulitzer/partial.rb +50 -0
- data/app/models/pulitzer/post.rb +1 -1
- data/app/models/pulitzer/post_type.rb +10 -6
- data/app/models/pulitzer/version.rb +10 -1
- data/app/views/pulitzer/content_elements/_form.html.erb +1 -1
- data/app/views/pulitzer/content_elements/_index.html.erb +1 -16
- data/app/views/pulitzer/content_elements/_partial_index.html.erb +5 -0
- data/app/views/pulitzer/content_elements/_show.html.erb +1 -1
- data/app/views/pulitzer/free_form_section_types/_form.html.erb +8 -0
- data/app/views/pulitzer/free_form_section_types/_form_fields.html.erb +2 -0
- data/app/views/pulitzer/free_form_section_types/_new.html.erb +7 -0
- data/app/views/pulitzer/free_form_section_types/_show.html.erb +9 -0
- data/app/views/pulitzer/free_form_section_types/_show_wrapper.html.erb +3 -0
- data/app/views/pulitzer/free_form_sections/_index.html.erb +3 -0
- data/app/views/pulitzer/free_form_sections/_show.html.erb +2 -0
- data/app/views/pulitzer/free_form_sections/_show_wrapper.html.erb +3 -0
- data/app/views/pulitzer/layouts/_form.html.erb +8 -0
- data/app/views/pulitzer/layouts/_form_fields.html.erb +2 -0
- data/app/views/pulitzer/layouts/_new.html.erb +7 -0
- data/app/views/pulitzer/layouts/_show.html.erb +9 -0
- data/app/views/pulitzer/layouts/_show_wrapper.html.erb +3 -0
- data/app/views/pulitzer/partials/_fields.html.erb +2 -0
- data/app/views/pulitzer/partials/_form.html.erb +11 -0
- data/app/views/pulitzer/partials/_index.html.erb +12 -0
- data/app/views/pulitzer/partials/_new.html.erb +16 -0
- data/app/views/pulitzer/partials/_show.html.erb +7 -0
- data/app/views/pulitzer/partials/_show_wrapper.html.erb +3 -0
- data/app/views/pulitzer/post_type_content_element_types/_form_fields.html.erb +4 -4
- data/app/views/pulitzer/post_types/_form.html.erb +1 -1
- data/app/views/pulitzer/post_types/_form_fields.html.erb +10 -3
- data/app/views/pulitzer/post_types/_show.html.erb +27 -6
- data/app/views/pulitzer/versions/_edit.html.erb +11 -5
- data/config/routes.rb +5 -1
- data/db/migrate/20160511192041_create_partials.rb +9 -0
- data/db/migrate/20160512214545_add_partial_to_content_element.rb +5 -0
- data/db/migrate/20160513153209_create_free_form_section_type.rb +8 -0
- data/db/migrate/20160513153214_create_free_form_section.rb +9 -0
- data/db/migrate/20160516150237_fix_post_type_kinds.rb +7 -0
- data/db/migrate/20160517181706_create_layouts.rb +8 -0
- data/db/migrate/20160517182500_add_layout_to_partial.rb +5 -0
- data/lib/pulitzer.rb +3 -1
- data/lib/pulitzer/version.rb +1 -1
- data/spec/controllers/pulitzer/free_form_section_types_controller_spec.rb +45 -0
- data/spec/controllers/pulitzer/partials_controller_spec.rb +42 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +25 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +151 -0
- data/spec/dummy/log/test.log +49898 -0
- data/spec/dummy/public/uploads/tmp/1452811005-24393-0063/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1452811005-24393-0063/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1452811173-24792-0199/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1452811173-24792-0199/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453327522-88240-8875/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453327522-88240-8875/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453327522-88240-8875/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453327846-88664-1819/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453327846-88664-1819/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453327846-88664-1819/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453327891-88742-0077/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453327891-88742-0077/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453327891-88742-0077/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453327908-88792-8689/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453327908-88792-8689/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453327908-88792-8689/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453327942-88859-9073/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453327942-88859-9073/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453327942-88859-9073/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453328584-89616-8416/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453328584-89616-8416/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453328584-89616-8416/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453328600-89648-3830/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453328600-89648-3830/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453328600-89648-3830/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453328621-89685-3083/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453328621-89685-3083/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453328621-89685-3083/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453328659-89747-3646/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453328659-89747-3646/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453328659-89747-3646/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453328908-90227-0244/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453328908-90227-0244/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453328908-90227-0244/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453328976-90335-7466/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453328976-90335-7466/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453328976-90335-7466/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453329010-90384-7488/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453329010-90384-7488/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453329010-90384-7488/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453329018-90436-7916/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453329018-90436-7916/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453329018-90436-7916/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393083-47505-1178/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393083-47505-1178/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393083-47505-1178/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393088-47594-1406/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393088-47594-1406/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393088-47594-1406/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393124-47630-8343/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393124-47630-8343/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393124-47630-8343/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393148-47674-3845/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393148-47674-3845/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393148-47674-3845/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393221-47816-8142/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393221-47816-8142/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393221-47816-8142/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393870-48546-6445/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393870-48546-6445/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393870-48546-6445/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393926-48624-7189/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393926-48624-7189/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393926-48624-7189/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393989-48708-0009/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393989-48708-0009/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453393989-48708-0009/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453739521-68535-5576/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453739521-68535-5576/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453739521-68535-5576/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453739650-68698-8068/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453739650-68698-8068/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453739650-68698-8068/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453740957-70195-5923/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453740957-70195-5923/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453740957-70195-5923/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453741054-70338-5984/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453741054-70338-5984/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453741054-70338-5984/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453741100-70403-3570/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453741100-70403-3570/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453741100-70403-3570/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453741119-70445-1368/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453741119-70445-1368/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453741119-70445-1368/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453741152-70510-7020/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453741152-70510-7020/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453741152-70510-7020/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453741165-70539-8838/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453741165-70539-8838/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453741165-70539-8838/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453741192-70601-8114/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453741192-70601-8114/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453741192-70601-8114/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453741252-70701-6629/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453741252-70701-6629/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1453741252-70701-6629/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1454010788-22795-5507/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1454010788-22795-5507/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1454010788-22795-5507/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1454011239-23492-4674/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1454011239-23492-4674/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1454011239-23492-4674/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1454011266-23542-4559/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1454011266-23542-4559/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1454011266-23542-4559/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463429995-65562-0251/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463429995-65562-0251/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463429995-65562-0251/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463430043-65638-7727/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463430043-65638-7727/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463430043-65638-7727/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463432105-68023-3063/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463432105-68023-3063/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463432105-68023-3063/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463432295-68282-2138/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463432295-68282-2138/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463432295-68282-2138/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463432657-68730-3477/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463432657-68730-3477/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463432657-68730-3477/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463432704-68798-5985/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463432704-68798-5985/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463432704-68798-5985/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463432882-69024-4017/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463432882-69024-4017/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463432882-69024-4017/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463432913-69082-5884/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463432913-69082-5884/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463432913-69082-5884/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463442041-78001-4031/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463442041-78001-4031/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463442041-78001-4031/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463442140-78140-3268/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463442140-78140-3268/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463442140-78140-3268/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463442186-78198-7364/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463442186-78198-7364/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463442186-78198-7364/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463442776-78848-1943/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463442776-78848-1943/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463442776-78848-1943/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463442832-78935-6772/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463442832-78935-6772/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463442832-78935-6772/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463442860-78978-8181/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463442860-78978-8181/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463442860-78978-8181/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463443482-79702-8123/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463443482-79702-8123/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463443482-79702-8123/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463443627-79922-4880/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463443627-79922-4880/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463443627-79922-4880/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463443847-80184-3453/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463443847-80184-3453/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463443847-80184-3453/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463444011-80461-3483/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463444011-80461-3483/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463444011-80461-3483/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463500404-81001-9924/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463500404-81001-9924/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463500404-81001-9924/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463500762-81388-3536/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463500762-81388-3536/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463500762-81388-3536/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463500770-81454-6155/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463500770-81454-6155/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463500770-81454-6155/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463500842-81525-6615/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463500842-81525-6615/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463500842-81525-6615/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463500982-81717-1186/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463500982-81717-1186/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463500982-81717-1186/thumb_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463607059-57999-0085/cms_sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463607059-57999-0085/sam_and_snow.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1463607059-57999-0085/thumb_sam_and_snow.jpg +0 -0
- data/spec/factories/post_type.rb +8 -0
- data/spec/factories/version.rb +8 -0
- data/spec/interactions/clone_version_spec.rb +8 -0
- data/spec/interactions/create_partial_content_elements_spec.rb +16 -0
- data/spec/interactions/create_post_content_elements_spec.rb +9 -0
- data/spec/models/post_type_spec.rb +1 -1
- metadata +449 -42
- data/app/views/pulitzer/content_elements/_new.html.erb +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54fd0fa0136f609b34b98862ed71797feee860fd
|
4
|
+
data.tar.gz: 075af04a1bbb69e1ec3046d0c62450f5ce026980
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b0377b9dc7d0334585a9ec5ab4ee10b71b08feef1b955bd602ce2605fff6d1248c4efa6a1506f7a57ef26e54f93e37bed9dbe1c45efc5e8ee956811d1d1dcf4
|
7
|
+
data.tar.gz: 2be9075b5238485db8ec72ecc48428682621aadff8a6382b7e6b7bd80844bc8fd1c63baf960486fe154c82044ee8f235f0e0b4dbdff30a41dba0606a436e8ebb
|
@@ -71,6 +71,9 @@ body {
|
|
71
71
|
float: left;
|
72
72
|
margin-top: 8px;
|
73
73
|
}
|
74
|
+
.pulitzer-indent{
|
75
|
+
margin-left: 40px;
|
76
|
+
}
|
74
77
|
a {
|
75
78
|
color: #32638a;
|
76
79
|
text-decoration: none;
|
@@ -135,6 +138,13 @@ body {
|
|
135
138
|
display: inline-block;
|
136
139
|
width: 5px;
|
137
140
|
}
|
141
|
+
&.match-h5{
|
142
|
+
line-height: 20px;
|
143
|
+
margin: 10px 0;
|
144
|
+
}
|
145
|
+
&.margin {
|
146
|
+
margin-right: 1em;
|
147
|
+
}
|
138
148
|
}
|
139
149
|
.pulitzer-hidden{
|
140
150
|
display: none;
|
@@ -170,7 +180,6 @@ body {
|
|
170
180
|
}
|
171
181
|
}
|
172
182
|
|
173
|
-
|
174
183
|
// wysihtml5
|
175
184
|
.wysihtml5-sandbox {
|
176
185
|
width: 100% !important;
|
@@ -1,18 +1,6 @@
|
|
1
1
|
class Pulitzer::ContentElementsController < Pulitzer::ApplicationController
|
2
2
|
before_filter :set_content_element, only: [:show, :edit, :update]
|
3
3
|
|
4
|
-
def new
|
5
|
-
@version = Pulitzer::Version.find params[:version_id]
|
6
|
-
@content_element = @version.content_elements.build
|
7
|
-
render partial: 'new', locals: { content_element: @content_element, version: @version }
|
8
|
-
end
|
9
|
-
|
10
|
-
def create
|
11
|
-
@version = Pulitzer::Version.find content_element_params[:version_id]
|
12
|
-
@content_element = @version.content_elements.create content_element_params.merge(ensure_unique: true)
|
13
|
-
render partial: 'show_wrapper', locals: { content_element: @content_element }
|
14
|
-
end
|
15
|
-
|
16
4
|
def show
|
17
5
|
render partial: 'show', locals: { content_element: @content_element }
|
18
6
|
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
class Pulitzer::FreeFormSectionTypesController < Pulitzer::ApplicationController
|
2
|
+
before_filter :get_ffst, only: [:show, :edit, :update, :destroy]
|
3
|
+
|
4
|
+
def new
|
5
|
+
@post_type = Pulitzer::PostType.find(params[:post_type_id])
|
6
|
+
@ffst = @post_type.free_form_section_types.build
|
7
|
+
render partial: 'new', locals: {ffst: @ffst}
|
8
|
+
end
|
9
|
+
|
10
|
+
def create
|
11
|
+
@post_type = Pulitzer::PostType.find(ffst_params[:post_type_id])
|
12
|
+
@ffst = @post_type.free_form_section_types.create(ffst_params)
|
13
|
+
Pulitzer::CreatePostTypeFreeFormSections.new(@ffst).call
|
14
|
+
render partial: 'show_wrapper', locals: {ffst: @ffst}
|
15
|
+
end
|
16
|
+
|
17
|
+
def show
|
18
|
+
render partial: 'show', locals: {ffst: @ffst}
|
19
|
+
end
|
20
|
+
|
21
|
+
def edit
|
22
|
+
render partial: 'form', locals: {ffst: @ffst}
|
23
|
+
end
|
24
|
+
|
25
|
+
def update
|
26
|
+
old_label = @ffst.name
|
27
|
+
@ffst.update_attributes(ffst_params)
|
28
|
+
Pulitzer::UpdatePostTypeFreeFormSections.new(@ffst, old_label).call
|
29
|
+
render partial: 'show', locals: {ffst: @ffst}
|
30
|
+
end
|
31
|
+
|
32
|
+
def destroy
|
33
|
+
@ffst.destroy
|
34
|
+
Pulitzer::DestroyPostTypeFreeFormSections.new(@ffst).call
|
35
|
+
render nothing: true
|
36
|
+
end
|
37
|
+
|
38
|
+
protected
|
39
|
+
|
40
|
+
def get_ffst
|
41
|
+
@ffst = Pulitzer::FreeFormSectionType.find(params[:id])
|
42
|
+
end
|
43
|
+
|
44
|
+
def ffst_params
|
45
|
+
params[:free_form_section_type].permit!
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
class Pulitzer::LayoutsController < Pulitzer::ApplicationController
|
2
|
+
before_filter :get_layout, only: [:show, :edit, :update, :destroy]
|
3
|
+
|
4
|
+
def new
|
5
|
+
@layout = Pulitzer::Layout.new(layout_params)
|
6
|
+
@post_type = @layout.post_type
|
7
|
+
render partial: 'new', locals: {layout: @layout}
|
8
|
+
end
|
9
|
+
|
10
|
+
def create
|
11
|
+
@layout = Pulitzer::Layout.create(layout_params)
|
12
|
+
render partial: 'show_wrapper', locals: {layout: @layout}
|
13
|
+
end
|
14
|
+
|
15
|
+
def show
|
16
|
+
render partial: 'show', locals: {layout: @layout}
|
17
|
+
end
|
18
|
+
|
19
|
+
def edit
|
20
|
+
render partial: 'form', locals: {layout: @layout}
|
21
|
+
end
|
22
|
+
|
23
|
+
def update
|
24
|
+
@layout.update_attributes(layout_params)
|
25
|
+
render partial: 'show', locals: {layout: @layout}
|
26
|
+
end
|
27
|
+
|
28
|
+
def destroy
|
29
|
+
@layout.destroy
|
30
|
+
render nothing: true
|
31
|
+
end
|
32
|
+
|
33
|
+
protected
|
34
|
+
|
35
|
+
def get_layout
|
36
|
+
@layout = Pulitzer::Layout.find(params[:id])
|
37
|
+
end
|
38
|
+
|
39
|
+
def layout_params
|
40
|
+
params[:layout].permit!
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
class Pulitzer::PartialsController < Pulitzer::ApplicationController
|
2
|
+
before_filter :set_partial, only: [:show, :edit, :update]
|
3
|
+
|
4
|
+
def new
|
5
|
+
@partial = Pulitzer::Partial.new(partial_params)
|
6
|
+
@free_form_section = @partial.free_form_section
|
7
|
+
render partial: 'new', locals: { partial: @partial }
|
8
|
+
end
|
9
|
+
|
10
|
+
def create
|
11
|
+
@free_form_section = Pulitzer::FreeFormSection.find partial_params[:free_form_section_id]
|
12
|
+
@partial = @free_form_section.partials.create partial_params
|
13
|
+
if @partial && @partial.errors.empty?
|
14
|
+
Pulitzer::CreatePartialContentElements.new(@partial).call
|
15
|
+
render partial: 'show_wrapper', locals: { partial: @partial }
|
16
|
+
else
|
17
|
+
render partial: 'new', locals: {partial: @partial}
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def show
|
22
|
+
render partial: 'show', locals: { partial: @partial }
|
23
|
+
end
|
24
|
+
|
25
|
+
def edit
|
26
|
+
render partial: 'form', locals: { partial: @partial }
|
27
|
+
end
|
28
|
+
|
29
|
+
def update
|
30
|
+
@partial.update partial_params
|
31
|
+
render partial: 'show', locals: { partial: @partial }
|
32
|
+
end
|
33
|
+
|
34
|
+
def update_all
|
35
|
+
partials = Pulitzer::Partial.find params[:partial]
|
36
|
+
partials.each do |ce|
|
37
|
+
new_sort_order = params[:partial].index(ce.id.to_s)
|
38
|
+
ce.update_attribute(:sort_order, new_sort_order)
|
39
|
+
end
|
40
|
+
render nothing: true
|
41
|
+
end
|
42
|
+
|
43
|
+
protected
|
44
|
+
|
45
|
+
def partial_params
|
46
|
+
params[:partial].permit!
|
47
|
+
end
|
48
|
+
|
49
|
+
def set_partial
|
50
|
+
@partial = Pulitzer::Partial.find(params[:id])
|
51
|
+
end
|
52
|
+
end
|
@@ -22,6 +22,16 @@ class Pulitzer::CloneVersion
|
|
22
22
|
new_version.processed_element_count += 1
|
23
23
|
new_version.broadcast_change if defined? ForeignOffice
|
24
24
|
end
|
25
|
+
@version.free_form_sections.each do |ffs|
|
26
|
+
begin
|
27
|
+
cloned_ffs = ffs.clone_me
|
28
|
+
new_version.free_form_sections << cloned_ffs
|
29
|
+
rescue ActiveRecord::RecordInvalid => invalid
|
30
|
+
cloning_errors.push "Free Form Section #{ffs.id} could not be cloned: #{invalid.record.errors.full_messages.join(', ')}"
|
31
|
+
end
|
32
|
+
new_version.processed_element_count += 1
|
33
|
+
new_version.broadcast_change if defined? ForeignOffice
|
34
|
+
end
|
25
35
|
@version.post_tags.each do |pt|
|
26
36
|
new_version.post_tags << pt.clone_me
|
27
37
|
new_version.processed_element_count += 1
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class Pulitzer::CreatePartialContentElements
|
2
|
+
attr_accessor :partial
|
3
|
+
|
4
|
+
def initialize(partial)
|
5
|
+
self.partial = partial
|
6
|
+
end
|
7
|
+
|
8
|
+
def call
|
9
|
+
partial.post_type_content_element_types.each do |cet|
|
10
|
+
partial.content_elements.create do |ce|
|
11
|
+
ce.label = cet.label
|
12
|
+
ce.height = cet.height
|
13
|
+
ce.width = cet.width
|
14
|
+
ce.text_editor = cet.text_editor
|
15
|
+
ce.content_element_type = cet.content_element_type
|
16
|
+
ce.post_type_content_element_type = cet
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class Pulitzer::CreatePostTypeFreeFormSections
|
2
|
+
attr_accessor :post_type, :ffst, :old_label
|
3
|
+
|
4
|
+
def initialize(ffst)
|
5
|
+
self.post_type = ffst.post_type
|
6
|
+
self.ffst = ffst
|
7
|
+
end
|
8
|
+
|
9
|
+
def call
|
10
|
+
post_type.posts.each do |post|
|
11
|
+
post.preview_version.free_form_sections.create do |ffs|
|
12
|
+
ffs.name = ffst.name
|
13
|
+
ffs.free_form_section_type = ffst
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class Pulitzer::DestroyPostTypeFreeFormSections
|
2
|
+
attr_accessor :post_type, :ffst
|
3
|
+
|
4
|
+
def initialize(ffst)
|
5
|
+
self.post_type = ffst.post_type
|
6
|
+
self.ffst = ffst
|
7
|
+
end
|
8
|
+
|
9
|
+
def call
|
10
|
+
post_type.posts.each do |post|
|
11
|
+
post.preview_version.free_form_sections.where(free_form_section_type_id: ffst.id).each do |ffs|
|
12
|
+
ffs.destroy
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class Pulitzer::UpdatePostTypeFreeFormSections
|
2
|
+
attr_accessor :post_type, :ffst, :old_label
|
3
|
+
|
4
|
+
def initialize(ffst, old_label=nil)
|
5
|
+
self.post_type = ffst.post_type
|
6
|
+
self.ffst = ffst
|
7
|
+
self.old_label = old_label || ffst.label
|
8
|
+
end
|
9
|
+
|
10
|
+
def call
|
11
|
+
post_type.posts.each do |post|
|
12
|
+
post.preview_version.free_form_sections.where(free_form_section_type_id: ffst.id).each do |ffs|
|
13
|
+
ffs.update(name: ffst.name)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Pulitzer
|
2
|
+
class FreeFormSection < ActiveRecord::Base
|
3
|
+
belongs_to :version
|
4
|
+
belongs_to :free_form_section_type
|
5
|
+
has_many :partials
|
6
|
+
|
7
|
+
def clone_me
|
8
|
+
clone_attrs = self.attributes.dup
|
9
|
+
clone_attrs.delete 'id'
|
10
|
+
clone_attrs.delete 'version_id'
|
11
|
+
|
12
|
+
my_clone = Pulitzer::FreeFormSection.create!(clone_attrs)
|
13
|
+
partials.each do |partial|
|
14
|
+
cloned_partial = partial.clone_me
|
15
|
+
my_clone.partials << cloned_partial
|
16
|
+
end
|
17
|
+
my_clone
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module Pulitzer
|
2
|
+
class Partial < ActiveRecord::Base
|
3
|
+
belongs_to :free_form_section
|
4
|
+
belongs_to :post_type
|
5
|
+
belongs_to :layout
|
6
|
+
|
7
|
+
has_many :content_elements, dependent: :destroy
|
8
|
+
|
9
|
+
delegate :name, :post_type_content_element_types, to: :post_type
|
10
|
+
delegate :template_path, to: :layout, allow_nil: true
|
11
|
+
|
12
|
+
before_save :handle_sort_order
|
13
|
+
|
14
|
+
def content_element(label)
|
15
|
+
self.content_elements.find_by(label: label)
|
16
|
+
end
|
17
|
+
|
18
|
+
def handle_sort_order
|
19
|
+
if new_record? && sort_order.nil?
|
20
|
+
self.sort_order = free_form_section.partials.maximum(:sort_order).to_i + 1
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def available_layouts
|
25
|
+
post_type.layouts
|
26
|
+
end
|
27
|
+
|
28
|
+
def folder_path
|
29
|
+
name.downcase.gsub(/ /,'_').gsub(/\W/,'')
|
30
|
+
end
|
31
|
+
|
32
|
+
def full_view_path
|
33
|
+
Pulitzer.partial_folder + folder_path + '/' + template_path
|
34
|
+
end
|
35
|
+
|
36
|
+
def clone_me
|
37
|
+
clone_attrs = self.attributes.dup
|
38
|
+
clone_attrs.delete 'id'
|
39
|
+
clone_attrs.delete 'free_form_section_id'
|
40
|
+
|
41
|
+
my_clone = Pulitzer::Partial.create!(clone_attrs)
|
42
|
+
content_elements.each do |ce|
|
43
|
+
cloned_content_element = ce.clone_me
|
44
|
+
my_clone.content_elements << cloned_content_element
|
45
|
+
end
|
46
|
+
my_clone
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
data/app/models/pulitzer/post.rb
CHANGED
@@ -4,7 +4,7 @@ module Pulitzer
|
|
4
4
|
extend ::FriendlyId
|
5
5
|
has_many :versions
|
6
6
|
belongs_to :post_type
|
7
|
-
delegate :post_type_content_element_types, :
|
7
|
+
delegate :post_type_content_element_types, :free_form_section_types, :has_free_form_sections?, :has_templated_content_elements?, to: :post_type
|
8
8
|
delegate :content_elements, :post_tags, :has_label_type, :has_label, :post_tags_for, to: :active_version, allow_nil: true
|
9
9
|
friendly_id :title, use: [:slugged, :finders]
|
10
10
|
after_create :create_preview_version
|
@@ -1,9 +1,12 @@
|
|
1
1
|
class Pulitzer::PostType < ActiveRecord::Base
|
2
|
-
enum kind: [ :template, :
|
2
|
+
enum kind: [ :template, :partial ]
|
3
3
|
has_many :posts, dependent: :destroy
|
4
4
|
has_many :post_type_content_element_types, dependent: :destroy
|
5
5
|
has_many :content_element_types, through: :post_type_content_element_types
|
6
|
-
|
6
|
+
has_many :free_form_section_types, dependent: :destroy
|
7
|
+
has_many :layouts, dependent: :destroy
|
8
|
+
|
9
|
+
scope :partials, -> { where(kind: Pulitzer::PostType.kinds[:partial])}
|
7
10
|
validates :name, :kind, presence: true
|
8
11
|
validates :plural, :inclusion => { :in => [true, false] }
|
9
12
|
|
@@ -23,11 +26,12 @@ class Pulitzer::PostType < ActiveRecord::Base
|
|
23
26
|
!!singleton_post
|
24
27
|
end
|
25
28
|
|
26
|
-
def
|
27
|
-
|
29
|
+
def has_templated_content_elements?
|
30
|
+
content_element_types.any?
|
28
31
|
end
|
29
32
|
|
30
|
-
def
|
31
|
-
|
33
|
+
def has_free_form_sections?
|
34
|
+
free_form_section_types.any?
|
32
35
|
end
|
36
|
+
|
33
37
|
end
|