pulitzer 0.13.1 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/pulitzer.scss +28 -2
  3. data/app/controllers/pulitzer/content_elements_controller.rb +6 -2
  4. data/app/controllers/pulitzer/custom_option_lists_controller.rb +55 -0
  5. data/app/controllers/pulitzer/custom_options_controller.rb +55 -0
  6. data/app/controllers/pulitzer/partial_types_controller.rb +0 -11
  7. data/app/controllers/pulitzer/posts_controller.rb +5 -6
  8. data/app/controllers/pulitzer/styles_controller.rb +42 -0
  9. data/app/helpers/pulitzer/posts_helper.rb +15 -4
  10. data/app/interactions/pulitzer/content_elements_controller/update.rb +21 -0
  11. data/app/models/pulitzer/content_element.rb +63 -8
  12. data/app/models/pulitzer/content_element_type.rb +6 -1
  13. data/app/models/pulitzer/custom_option.rb +6 -0
  14. data/app/models/pulitzer/custom_option_list.rb +10 -0
  15. data/app/models/pulitzer/post_type_content_element_type.rb +58 -2
  16. data/app/models/pulitzer/style.rb +11 -0
  17. data/app/views/pulitzer/content_elements/_clickable_fields.html.erb +31 -0
  18. data/app/views/pulitzer/content_elements/_form.html.erb +1 -3
  19. data/app/views/pulitzer/content_elements/_partial_index.html.erb +1 -1
  20. data/app/views/pulitzer/content_elements/_show.html.erb +11 -20
  21. data/app/views/pulitzer/custom_option_lists/_edit.html.erb +10 -0
  22. data/app/views/pulitzer/custom_option_lists/_index.html.erb +12 -0
  23. data/app/views/pulitzer/custom_option_lists/_new.html.erb +9 -0
  24. data/app/views/pulitzer/custom_option_lists/_show.html.erb +11 -0
  25. data/app/views/pulitzer/custom_option_lists/_show_wrapper.html.erb +3 -0
  26. data/app/views/pulitzer/custom_options/_edit.html.erb +10 -0
  27. data/app/views/pulitzer/custom_options/_fields.html.erb +2 -0
  28. data/app/views/pulitzer/custom_options/_index.html.erb +20 -0
  29. data/app/views/pulitzer/custom_options/_new.html.erb +10 -0
  30. data/app/views/pulitzer/custom_options/_show.html.erb +5 -0
  31. data/app/views/pulitzer/custom_options/_show_wrapper.html.erb +3 -0
  32. data/app/views/pulitzer/free_form_section_types/_show_wrapper.html.erb +1 -1
  33. data/app/views/pulitzer/partial_types/_index.html.erb +1 -1
  34. data/app/views/pulitzer/partials/_index.html.erb +4 -4
  35. data/app/views/pulitzer/partials/_new.html.erb +1 -1
  36. data/app/views/pulitzer/post_type_content_element_types/_form_fields.html.erb +4 -0
  37. data/app/views/pulitzer/post_type_content_element_types/_show.html.erb +13 -5
  38. data/app/views/pulitzer/post_types/_template.html.erb +5 -4
  39. data/app/views/pulitzer/post_types/index.html.erb +26 -12
  40. data/app/views/pulitzer/posts/{index.html.erb → _index.html.erb} +0 -0
  41. data/app/views/pulitzer/styles/_index.html.erb +10 -0
  42. data/app/views/pulitzer/styles/_new.html.erb +29 -0
  43. data/app/views/pulitzer/styles/_show.html.erb +15 -0
  44. data/app/views/pulitzer/styles/_show_wrapper.html.erb +3 -0
  45. data/config/routes.rb +4 -0
  46. data/lib/pulitzer/content_element_helper.rb +22 -4
  47. data/lib/pulitzer/version.rb +1 -1
  48. data/spec/controllers/pages_controller_spec.rb +16 -0
  49. data/spec/dummy/app/controllers/pages_controller.rb +7 -0
  50. data/spec/dummy/app/controllers/pulitzer_preview/pages_controller.rb +16 -0
  51. data/spec/dummy/app/views/pages/welcome.html.erb +27 -0
  52. data/spec/dummy/app/views/pulitzer/welcome.html.erb +27 -0
  53. data/spec/dummy/config/initializers/zz_pulitzer.rb +1 -0
  54. data/spec/dummy/config/routes.rb +2 -0
  55. data/spec/dummy/db/development.sqlite3 +0 -0
  56. data/spec/dummy/db/test.sqlite3 +0 -0
  57. data/spec/dummy/log/development.log +198 -0
  58. data/spec/dummy/log/test.log +1733 -0
  59. metadata +34 -6
  60. data/app/interactions/pulitzer/update_free_form_section_partials.rb +0 -18
  61. data/app/models/pulitzer/layout.rb +0 -11
  62. data/app/views/pulitzer/partial_types/_form.html.erb +0 -21
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pulitzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.1
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Draut
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-05-23 00:00:00.000000000 Z
12
+ date: 2017-06-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -502,6 +502,8 @@ files:
502
502
  - app/controllers/pulitzer/arrangement_styles_controller.rb
503
503
  - app/controllers/pulitzer/background_styles_controller.rb
504
504
  - app/controllers/pulitzer/content_elements_controller.rb
505
+ - app/controllers/pulitzer/custom_option_lists_controller.rb
506
+ - app/controllers/pulitzer/custom_options_controller.rb
505
507
  - app/controllers/pulitzer/free_form_section_types_controller.rb
506
508
  - app/controllers/pulitzer/justification_styles_controller.rb
507
509
  - app/controllers/pulitzer/layouts_controller.rb
@@ -512,11 +514,13 @@ files:
512
514
  - app/controllers/pulitzer/post_types_controller.rb
513
515
  - app/controllers/pulitzer/posts_controller.rb
514
516
  - app/controllers/pulitzer/sequence_flow_styles_controller.rb
517
+ - app/controllers/pulitzer/styles_controller.rb
515
518
  - app/controllers/pulitzer/tags_controller.rb
516
519
  - app/controllers/pulitzer/versions_controller.rb
517
520
  - app/helpers/pulitzer/main_helper.rb
518
521
  - app/helpers/pulitzer/posts_helper.rb
519
522
  - app/interactions/pulitzer/clone_version.rb
523
+ - app/interactions/pulitzer/content_elements_controller/update.rb
520
524
  - app/interactions/pulitzer/create_free_form_section_partials.rb
521
525
  - app/interactions/pulitzer/create_partial_content_elements.rb
522
526
  - app/interactions/pulitzer/create_post_content_elements.rb
@@ -528,7 +532,6 @@ files:
528
532
  - app/interactions/pulitzer/destroy_post_type_content_elements.rb
529
533
  - app/interactions/pulitzer/destroy_post_type_free_form_sections.rb
530
534
  - app/interactions/pulitzer/update_content_element.rb
531
- - app/interactions/pulitzer/update_free_form_section_partials.rb
532
535
  - app/interactions/pulitzer/update_post_type_content_elements.rb
533
536
  - app/interactions/pulitzer/update_post_type_free_form_sections.rb
534
537
  - app/interactions/pulitzer/update_singleton_post.rb
@@ -539,10 +542,11 @@ files:
539
542
  - app/models/pulitzer/background_style.rb
540
543
  - app/models/pulitzer/content_element.rb
541
544
  - app/models/pulitzer/content_element_type.rb
545
+ - app/models/pulitzer/custom_option.rb
546
+ - app/models/pulitzer/custom_option_list.rb
542
547
  - app/models/pulitzer/free_form_section.rb
543
548
  - app/models/pulitzer/free_form_section_type.rb
544
549
  - app/models/pulitzer/justification_style.rb
545
- - app/models/pulitzer/layout.rb
546
550
  - app/models/pulitzer/partial.rb
547
551
  - app/models/pulitzer/partial_type.rb
548
552
  - app/models/pulitzer/post.rb
@@ -551,6 +555,7 @@ files:
551
555
  - app/models/pulitzer/post_type_content_element_type.rb
552
556
  - app/models/pulitzer/post_type_element.rb
553
557
  - app/models/pulitzer/sequence_flow_style.rb
558
+ - app/models/pulitzer/style.rb
554
559
  - app/models/pulitzer/tag.rb
555
560
  - app/models/pulitzer/version.rb
556
561
  - app/uploaders/pulitzer/base_uploader.rb
@@ -566,6 +571,7 @@ files:
566
571
  - app/views/pulitzer/background_styles/_new.html.erb
567
572
  - app/views/pulitzer/background_styles/_show.html.erb
568
573
  - app/views/pulitzer/background_styles/_show_wrapper.html.erb
574
+ - app/views/pulitzer/content_elements/_clickable_fields.html.erb
569
575
  - app/views/pulitzer/content_elements/_form.html.erb
570
576
  - app/views/pulitzer/content_elements/_image_fields.html.erb
571
577
  - app/views/pulitzer/content_elements/_index.html.erb
@@ -575,6 +581,17 @@ files:
575
581
  - app/views/pulitzer/content_elements/_show_wrapper.html.erb
576
582
  - app/views/pulitzer/content_elements/_text_fields.html.erb
577
583
  - app/views/pulitzer/content_elements/_video_fields.html.erb
584
+ - app/views/pulitzer/custom_option_lists/_edit.html.erb
585
+ - app/views/pulitzer/custom_option_lists/_index.html.erb
586
+ - app/views/pulitzer/custom_option_lists/_new.html.erb
587
+ - app/views/pulitzer/custom_option_lists/_show.html.erb
588
+ - app/views/pulitzer/custom_option_lists/_show_wrapper.html.erb
589
+ - app/views/pulitzer/custom_options/_edit.html.erb
590
+ - app/views/pulitzer/custom_options/_fields.html.erb
591
+ - app/views/pulitzer/custom_options/_index.html.erb
592
+ - app/views/pulitzer/custom_options/_new.html.erb
593
+ - app/views/pulitzer/custom_options/_show.html.erb
594
+ - app/views/pulitzer/custom_options/_show_wrapper.html.erb
578
595
  - app/views/pulitzer/free_form_section_types/_form.html.erb
579
596
  - app/views/pulitzer/free_form_section_types/_form_fields.html.erb
580
597
  - app/views/pulitzer/free_form_section_types/_new.html.erb
@@ -588,7 +605,6 @@ files:
588
605
  - app/views/pulitzer/justification_styles/_new.html.erb
589
606
  - app/views/pulitzer/justification_styles/_show.html.erb
590
607
  - app/views/pulitzer/justification_styles/_show_wrapper.html.erb
591
- - app/views/pulitzer/partial_types/_form.html.erb
592
608
  - app/views/pulitzer/partial_types/_index.html.erb
593
609
  - app/views/pulitzer/partial_types/_new.html.erb
594
610
  - app/views/pulitzer/partial_types/_show.html.erb
@@ -617,13 +633,13 @@ files:
617
633
  - app/views/pulitzer/posts/_edit.html.erb
618
634
  - app/views/pulitzer/posts/_form.html.erb
619
635
  - app/views/pulitzer/posts/_form_slug.html.erb
636
+ - app/views/pulitzer/posts/_index.html.erb
620
637
  - app/views/pulitzer/posts/_new.html.erb
621
638
  - app/views/pulitzer/posts/_show.html.erb
622
639
  - app/views/pulitzer/posts/_show_slug.html.erb
623
640
  - app/views/pulitzer/posts/_show_wrapper.html.erb
624
641
  - app/views/pulitzer/posts/_slug_wrapper.html.erb
625
642
  - app/views/pulitzer/posts/edit.html.erb
626
- - app/views/pulitzer/posts/index.html.erb
627
643
  - app/views/pulitzer/sequence_flow_styles/_form.html.erb
628
644
  - app/views/pulitzer/sequence_flow_styles/_form_fields.html.erb
629
645
  - app/views/pulitzer/sequence_flow_styles/_new.html.erb
@@ -631,6 +647,10 @@ files:
631
647
  - app/views/pulitzer/sequence_flow_styles/_show_wrapper.html.erb
632
648
  - app/views/pulitzer/shared/_drag_handle.html.erb
633
649
  - app/views/pulitzer/shared/_error_messages.erb
650
+ - app/views/pulitzer/styles/_index.html.erb
651
+ - app/views/pulitzer/styles/_new.html.erb
652
+ - app/views/pulitzer/styles/_show.html.erb
653
+ - app/views/pulitzer/styles/_show_wrapper.html.erb
634
654
  - app/views/pulitzer/tags/_form.html.erb
635
655
  - app/views/pulitzer/tags/_form_fields.html.erb
636
656
  - app/views/pulitzer/tags/_index.html.erb
@@ -688,6 +708,7 @@ files:
688
708
  - lib/pulitzer/exceptions.rb
689
709
  - lib/pulitzer/version.rb
690
710
  - lib/tasks/pulitzer_tasks.rake
711
+ - spec/controllers/pages_controller_spec.rb
691
712
  - spec/controllers/pulitzer/arrangement_styles_controller_spec.rb
692
713
  - spec/controllers/pulitzer/background_styles_controller_spec.rb
693
714
  - spec/controllers/pulitzer/free_form_section_types_controller_spec.rb
@@ -704,6 +725,7 @@ files:
704
725
  - spec/dummy/app/assets/stylesheets/application.css
705
726
  - spec/dummy/app/controllers/application_controller.rb
706
727
  - spec/dummy/app/controllers/pages_controller.rb
728
+ - spec/dummy/app/controllers/pulitzer_preview/pages_controller.rb
707
729
  - spec/dummy/app/helpers/application_helper.rb
708
730
  - spec/dummy/app/models/ability.rb
709
731
  - spec/dummy/app/models/search_location.rb
@@ -712,6 +734,8 @@ files:
712
734
  - spec/dummy/app/views/pages/about_us.html.erb
713
735
  - spec/dummy/app/views/pages/freeform.html.erb
714
736
  - spec/dummy/app/views/pages/news_posts.html.erb
737
+ - spec/dummy/app/views/pages/welcome.html.erb
738
+ - spec/dummy/app/views/pulitzer/welcome.html.erb
715
739
  - spec/dummy/app/views/toolbars/_simple_editor.html.erb
716
740
  - spec/dummy/bin/bundle
717
741
  - spec/dummy/bin/rails
@@ -1140,6 +1164,7 @@ signing_key:
1140
1164
  specification_version: 4
1141
1165
  summary: A content management engine for Ruby on Rails.
1142
1166
  test_files:
1167
+ - spec/controllers/pages_controller_spec.rb
1143
1168
  - spec/controllers/pulitzer/arrangement_styles_controller_spec.rb
1144
1169
  - spec/controllers/pulitzer/background_styles_controller_spec.rb
1145
1170
  - spec/controllers/pulitzer/free_form_section_types_controller_spec.rb
@@ -1154,6 +1179,7 @@ test_files:
1154
1179
  - spec/dummy/app/assets/stylesheets/application.css
1155
1180
  - spec/dummy/app/controllers/application_controller.rb
1156
1181
  - spec/dummy/app/controllers/pages_controller.rb
1182
+ - spec/dummy/app/controllers/pulitzer_preview/pages_controller.rb
1157
1183
  - spec/dummy/app/helpers/application_helper.rb
1158
1184
  - spec/dummy/app/models/ability.rb
1159
1185
  - spec/dummy/app/models/search_location.rb
@@ -1162,6 +1188,8 @@ test_files:
1162
1188
  - spec/dummy/app/views/pages/about_us.html.erb
1163
1189
  - spec/dummy/app/views/pages/freeform.html.erb
1164
1190
  - spec/dummy/app/views/pages/news_posts.html.erb
1191
+ - spec/dummy/app/views/pages/welcome.html.erb
1192
+ - spec/dummy/app/views/pulitzer/welcome.html.erb
1165
1193
  - spec/dummy/app/views/toolbars/_simple_editor.html.erb
1166
1194
  - spec/dummy/bin/bundle
1167
1195
  - spec/dummy/bin/rails
@@ -1,18 +0,0 @@
1
- class Pulitzer::UpdateFreeFormSectionPartials
2
-
3
- def initialize(partial_type, old_label)
4
- @partial_type, @old_label = partial_type, old_label
5
- end
6
-
7
- def call
8
- free_form_section_type = @partial_type.free_form_section_type
9
- post_type = free_form_section_type.post_type
10
- post_type.posts.each do |post|
11
- if post.preview_version
12
- free_form_section = post.preview_version.free_form_sections.find_by(name: free_form_section_type.name)
13
- partial = free_form_section.partials.find_by(label: @old_label)
14
- partial.update(label: @partial_type.label, layout_id: @partial_type.layout_id) if partial
15
- end
16
- end
17
- end
18
- end
@@ -1,11 +0,0 @@
1
- module Pulitzer
2
- class Layout < ActiveRecord::Base
3
- has_many :partials
4
- belongs_to :post_type
5
- validates :name, presence: true
6
-
7
- def template_path
8
- name.downcase.gsub(/ /,'_').gsub(/\W/,'')
9
- end
10
- end
11
- end
@@ -1,21 +0,0 @@
1
- <div class="pulitzer-row">
2
- <div class="pulitzer-span margin"><h5><%= partial_type.label %></h5></div>
3
- <div class="pulitzer-span match-h5"><%= partial_type.folder_path %>/</div>
4
- <div class="pulitzer-span margin match-h5"><%= partial_type.template_path %></div>
5
- <div class="pulitzer-span right">
6
- <%= render partial: '/pulitzer/shared/drag_handle' %>
7
- </div>
8
- </div>
9
- <%= render 'pulitzer/shared/error_messages', object: partial_type %>
10
- <%= form_for partial_type, html: ajax_form_hash(dom_target(partial_type)), multipart: true,
11
- data: { server_endpoint: partial_type_path(partial_type) } do |f| %>
12
- <%= f.label :label %>
13
- <%= f.text_field :label %>
14
- <%= f.label :layout_id, 'Layout' %>
15
- <%= f.collection_select :layout_id, partial_type.available_layouts, :id, :name, {}, {} %>
16
- <%= submit_tag "Update" %>
17
- <%= link_to('Cancel', partial_type_path(partial_type), :class => 'button',
18
- data: { ajax_link: true, ajax_target: dom_target(partial_type) } ) %>
19
- or
20
- <%= ajax_delete 'delete', partial_type_path(partial_type), {class: 'button'}, dom_target(partial_type) %>
21
- <% end %>