pulitzer 0.12.5 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/pulitzer.scss +107 -4
  3. data/app/controllers/pulitzer/arrangement_styles_controller.rb +52 -0
  4. data/app/controllers/pulitzer/background_styles_controller.rb +52 -0
  5. data/app/controllers/pulitzer/content_elements_controller.rb +2 -2
  6. data/app/controllers/pulitzer/free_form_section_types_controller.rb +2 -2
  7. data/app/controllers/pulitzer/justification_styles_controller.rb +52 -0
  8. data/app/controllers/pulitzer/layouts_controller.rb +2 -2
  9. data/app/controllers/pulitzer/partial_types_controller.rb +1 -1
  10. data/app/controllers/pulitzer/partials_controller.rb +2 -2
  11. data/app/controllers/pulitzer/post_tags_controller.rb +2 -2
  12. data/app/controllers/pulitzer/post_type_content_element_types_controller.rb +2 -2
  13. data/app/controllers/pulitzer/post_types_controller.rb +2 -2
  14. data/app/controllers/pulitzer/posts_controller.rb +1 -1
  15. data/app/controllers/pulitzer/sequence_flow_styles_controller.rb +52 -0
  16. data/app/controllers/pulitzer/tags_controller.rb +3 -3
  17. data/app/interactions/pulitzer/update_post_type_content_elements.rb +1 -1
  18. data/app/models/pulitzer/arrangement_style.rb +8 -0
  19. data/app/models/pulitzer/background_style.rb +8 -0
  20. data/app/models/pulitzer/content_element.rb +4 -0
  21. data/app/models/pulitzer/free_form_section_type.rb +5 -1
  22. data/app/models/pulitzer/justification_style.rb +8 -0
  23. data/app/models/pulitzer/partial.rb +39 -5
  24. data/app/models/pulitzer/partial_type.rb +2 -10
  25. data/app/models/pulitzer/post.rb +1 -1
  26. data/app/models/pulitzer/post_type.rb +4 -5
  27. data/app/models/pulitzer/post_type_content_element_type.rb +20 -1
  28. data/app/models/pulitzer/sequence_flow_style.rb +8 -0
  29. data/app/views/pulitzer/arrangement_styles/_form.html.erb +14 -0
  30. data/app/views/pulitzer/arrangement_styles/_form_fields.html.erb +6 -0
  31. data/app/views/pulitzer/arrangement_styles/_new.html.erb +12 -0
  32. data/app/views/pulitzer/arrangement_styles/_show.html.erb +10 -0
  33. data/app/views/pulitzer/arrangement_styles/_show_wrapper.html.erb +3 -0
  34. data/app/views/pulitzer/background_styles/_form.html.erb +14 -0
  35. data/app/views/pulitzer/background_styles/_form_fields.html.erb +6 -0
  36. data/app/views/pulitzer/background_styles/_new.html.erb +12 -0
  37. data/app/views/pulitzer/background_styles/_show.html.erb +10 -0
  38. data/app/views/pulitzer/background_styles/_show_wrapper.html.erb +3 -0
  39. data/app/views/pulitzer/free_form_section_types/_form.html.erb +16 -7
  40. data/app/views/pulitzer/free_form_section_types/_form_fields.html.erb +6 -4
  41. data/app/views/pulitzer/free_form_section_types/_new.html.erb +12 -7
  42. data/app/views/pulitzer/free_form_section_types/_show.html.erb +10 -12
  43. data/app/views/pulitzer/free_form_section_types/_show_wrapper.html.erb +2 -2
  44. data/app/views/pulitzer/justification_styles/_form.html.erb +14 -0
  45. data/app/views/pulitzer/justification_styles/_form_fields.html.erb +6 -0
  46. data/app/views/pulitzer/justification_styles/_new.html.erb +12 -0
  47. data/app/views/pulitzer/justification_styles/_show.html.erb +10 -0
  48. data/app/views/pulitzer/justification_styles/_show_wrapper.html.erb +3 -0
  49. data/app/views/pulitzer/partial_types/_index.html.erb +2 -2
  50. data/app/views/pulitzer/partial_types/_new.html.erb +1 -12
  51. data/app/views/pulitzer/partial_types/_show.html.erb +15 -5
  52. data/app/views/pulitzer/partial_types/_show_wrapper.html.erb +1 -1
  53. data/app/views/pulitzer/partials/_form.html.erb +31 -13
  54. data/app/views/pulitzer/partials/_new.html.erb +30 -11
  55. data/app/views/pulitzer/partials/_show.html.erb +8 -4
  56. data/app/views/pulitzer/post_type_content_element_types/_form.html.erb +12 -6
  57. data/app/views/pulitzer/post_type_content_element_types/_form_fields.html.erb +15 -13
  58. data/app/views/pulitzer/post_type_content_element_types/_new.html.erb +11 -6
  59. data/app/views/pulitzer/post_type_content_element_types/_show.html.erb +16 -9
  60. data/app/views/pulitzer/post_type_content_element_types/_show_wrapper.html.erb +2 -2
  61. data/app/views/pulitzer/post_types/_new.html.erb +1 -1
  62. data/app/views/pulitzer/post_types/_show.html.erb +10 -10
  63. data/app/views/pulitzer/post_types/_template.html.erb +98 -29
  64. data/app/views/pulitzer/sequence_flow_styles/_form.html.erb +14 -0
  65. data/app/views/pulitzer/sequence_flow_styles/_form_fields.html.erb +6 -0
  66. data/app/views/pulitzer/sequence_flow_styles/_new.html.erb +12 -0
  67. data/app/views/pulitzer/sequence_flow_styles/_show.html.erb +10 -0
  68. data/app/views/pulitzer/sequence_flow_styles/_show_wrapper.html.erb +3 -0
  69. data/config/routes.rb +5 -1
  70. data/db/migrate/20170518142411_create_pulitzer_background_classes.rb +9 -0
  71. data/db/migrate/20170518144418_create_pulitzer_justification_classes.rb +9 -0
  72. data/db/migrate/20170518144449_create_pulitzer_sequence_flow_classes.rb +9 -0
  73. data/db/migrate/20170518144515_create_pulitzer_arrangement_classes.rb +9 -0
  74. data/db/migrate/20170518145318_convert_pulitzer_layouts.rb +9 -0
  75. data/lib/pulitzer/content_element_helper.rb +5 -3
  76. data/lib/pulitzer/version.rb +1 -1
  77. data/spec/controllers/pulitzer/free_form_section_types_controller_spec.rb +6 -6
  78. data/spec/controllers/pulitzer/partials_controller_spec.rb +7 -7
  79. data/spec/controllers/pulitzer/post_types_controller_spec.rb +3 -3
  80. data/spec/controllers/pulitzer/versions_controller_spec.rb +8 -8
  81. data/spec/controllers/tags_controller_spec.rb +28 -29
  82. data/spec/dummy/app/controllers/application_controller.rb +1 -1
  83. data/spec/dummy/config/application.rb +0 -1
  84. data/spec/dummy/config/environments/test.rb +2 -2
  85. data/spec/dummy/db/schema.rb +30 -2
  86. data/spec/dummy/db/test.sqlite3 +0 -0
  87. data/spec/dummy/log/test.log +0 -3971
  88. data/spec/factories/partial_type.rb +0 -1
  89. data/spec/rails_helper.rb +1 -1
  90. metadata +35 -9
  91. data/app/views/pulitzer/layouts/_form.html.erb +0 -8
  92. data/app/views/pulitzer/layouts/_form_fields.html.erb +0 -2
  93. data/app/views/pulitzer/layouts/_new.html.erb +0 -7
  94. data/app/views/pulitzer/layouts/_show.html.erb +0 -9
  95. data/app/views/pulitzer/layouts/_show_wrapper.html.erb +0 -3
  96. data/spec/factories/layout.rb +0 -6
@@ -1,6 +1,6 @@
1
1
  module Pulitzer
2
2
  class TagsController < ApplicationController
3
- before_filter :get_tag, only: [:edit, :update, :destroy]
3
+ before_action :get_tag, only: [:edit, :update, :destroy]
4
4
 
5
5
  rescue_from ActiveRecord::RecordNotFound, with: :render_not_found
6
6
 
@@ -43,7 +43,7 @@ module Pulitzer
43
43
 
44
44
  def destroy
45
45
  @tag.destroy
46
- render nothing: true
46
+ head :ok
47
47
  end
48
48
 
49
49
  protected
@@ -54,7 +54,7 @@ module Pulitzer
54
54
 
55
55
  def render_not_found(e)
56
56
  Rails.logger.warn("Rendering 404 because #{e.inspect}")
57
- render nothing: true, status: :not_found
57
+ head :ok, status: :not_found
58
58
  end
59
59
 
60
60
  def tag_params
@@ -23,7 +23,7 @@ class Pulitzer::UpdatePostTypeContentElements
23
23
  # if there is no preview version, skip this one.
24
24
  end
25
25
  end
26
- post_type.partials.each do |partial|
26
+ post_type.partials.joins(free_form_section: :version).where(pulitzer_versions: {status: 0}).each do |partial|
27
27
  partial.content_elements.where(label: old_label).each do |content_element|
28
28
  content_element.update(label: ptcet.label,
29
29
  height: ptcet.height,
@@ -0,0 +1,8 @@
1
+ module Pulitzer
2
+ class ArrangementStyle < ActiveRecord::Base
3
+ belongs_to :post_type
4
+ has_many :partials
5
+ validates :display_name, presence: true
6
+ validates :view_file_name, presence: true
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Pulitzer
2
+ class BackgroundStyle < ActiveRecord::Base
3
+ belongs_to :post_type
4
+ has_many :partials
5
+ validates :display_name, presence: true
6
+ validates :css_class_name, presence: true
7
+ end
8
+ end
@@ -47,6 +47,10 @@ module Pulitzer
47
47
  image_type? ? !image? : body.blank?
48
48
  end
49
49
 
50
+ def has_content?
51
+ image_type? ? image? : body.present?
52
+ end
53
+
50
54
  def clone_me
51
55
  clone_attrs = self.attributes.dup
52
56
  clone_attrs.delete 'id'
@@ -4,7 +4,11 @@ module Pulitzer
4
4
 
5
5
  belongs_to :post_type
6
6
  has_many :free_form_sections
7
- has_many :partial_types
7
+ has_many :partial_types, -> { order :id }
8
+
9
+ def first_partial_type
10
+ partial_types.first
11
+ end
8
12
 
9
13
  end
10
14
  end
@@ -0,0 +1,8 @@
1
+ module Pulitzer
2
+ class JustificationStyle < ActiveRecord::Base
3
+ belongs_to :post_type
4
+ has_many :partials
5
+ validates :display_name, presence: true
6
+ validates :css_class_name, presence: true
7
+ end
8
+ end
@@ -2,12 +2,14 @@ module Pulitzer
2
2
  class Partial < ActiveRecord::Base
3
3
  belongs_to :free_form_section
4
4
  belongs_to :post_type
5
- belongs_to :layout
5
+ belongs_to :background_style
6
+ belongs_to :justification_style
7
+ belongs_to :sequence_flow_style
8
+ belongs_to :arrangement_style
6
9
 
7
10
  has_many :content_elements, dependent: :destroy
8
11
 
9
- delegate :name, :post_type_content_element_types, :has_display?, to: :post_type
10
- delegate :template_path, to: :layout, allow_nil: true
12
+ delegate :name, :post_type_content_element_types, to: :post_type
11
13
 
12
14
  before_save :handle_sort_order
13
15
 
@@ -15,20 +17,52 @@ module Pulitzer
15
17
  self.content_elements.find_by(label: label)
16
18
  end
17
19
 
20
+ def background_css_class
21
+ background_style&.css_class_name
22
+ end
23
+
24
+ def justification_css_class
25
+ justification_style&.css_class_name
26
+ end
27
+
28
+ def sequence_flow_css_class
29
+ sequence_flow_style&.css_class_name
30
+ end
31
+
18
32
  def handle_sort_order
19
33
  if new_record? && sort_order.nil?
20
34
  self.sort_order = free_form_section.partials.maximum(:sort_order).to_i + 1
21
35
  end
22
36
  end
23
37
 
24
- def available_layouts
25
- post_type.layouts
38
+ def available_backgrounds
39
+ post_type.background_styles
40
+ end
41
+
42
+ def available_justifications
43
+ post_type.justification_styles
44
+ end
45
+
46
+ def available_sequence_flows
47
+ post_type.sequence_flow_styles
48
+ end
49
+
50
+ def available_arrangements
51
+ post_type.arrangement_styles
26
52
  end
27
53
 
28
54
  def folder_path
29
55
  name.downcase.gsub(/ /,'_').gsub(/\W/,'')
30
56
  end
31
57
 
58
+ def template_path
59
+ if arrangement_style.present?
60
+ arrangement_style.view_file_name
61
+ else
62
+ 'default'
63
+ end
64
+ end
65
+
32
66
  def full_view_path
33
67
  Pulitzer.partial_folder + '/' + folder_path + '/' + template_path
34
68
  end
@@ -2,17 +2,9 @@ module Pulitzer
2
2
  class PartialType < ActiveRecord::Base
3
3
  belongs_to :free_form_section_type
4
4
  belongs_to :post_type
5
- belongs_to :layout
6
5
 
7
- delegate :template_path, to: :layout, allow_nil: true
8
-
9
-
10
- def folder_path
11
- label.downcase.gsub(/ /,'_').gsub(/\W/,'')
12
- end
13
-
14
- def available_layouts
15
- post_type.layouts
6
+ def first?
7
+ free_form_section_type.first_partial_type.id == id
16
8
  end
17
9
  end
18
10
  end
@@ -3,7 +3,7 @@ module Pulitzer
3
3
  include ForeignOffice::Broadcaster if defined? ForeignOffice
4
4
  extend ::FriendlyId
5
5
  has_many :versions, dependent: :destroy
6
- has_one :active_version, -> { active }, class_name: "Pulitzer::Version"
6
+ has_one :active_version, -> { where(status: 'active') }, class_name: "Pulitzer::Version"
7
7
 
8
8
  belongs_to :post_type
9
9
  delegate :post_type_content_element_types, :free_form_section_types, :has_free_form_sections?, :has_templated_content_elements?, to: :post_type
@@ -5,7 +5,10 @@ class Pulitzer::PostType < ActiveRecord::Base
5
5
  has_many :post_type_content_element_types, dependent: :destroy
6
6
  has_many :content_element_types, through: :post_type_content_element_types
7
7
  has_many :free_form_section_types, dependent: :destroy
8
- has_many :layouts, dependent: :destroy
8
+ has_many :background_styles, dependent: :destroy
9
+ has_many :justification_styles, dependent: :destroy
10
+ has_many :sequence_flow_styles, dependent: :destroy
11
+ has_many :arrangement_styles, dependent: :destroy
9
12
 
10
13
  scope :templates, -> { where(kind: Pulitzer::PostType.kinds[:template])}
11
14
  scope :partials, -> { where(kind: Pulitzer::PostType.kinds[:partial])}
@@ -28,10 +31,6 @@ class Pulitzer::PostType < ActiveRecord::Base
28
31
  !plural
29
32
  end
30
33
 
31
- def has_display?
32
- layouts.any?
33
- end
34
-
35
34
  def has_templated_content_elements?
36
35
  content_element_types.any?
37
36
  end
@@ -9,9 +9,28 @@ module Pulitzer
9
9
 
10
10
  delegate :type, :image_type?, to: :content_element_type
11
11
 
12
- default_scope { order(id: :asc) }
12
+ default_scope { order(sort_order: :asc) }
13
13
 
14
14
  validates :label, presence: true
15
15
 
16
+ def type_specific_display
17
+ case type
18
+ when :image
19
+ "#{height}x#{width}"
20
+ when :text
21
+ text_editor_display
22
+ else
23
+ ''
24
+ end
25
+ end
26
+
27
+ def text_editor_display
28
+ case text_editor
29
+ when 'None'
30
+ 'no editor'
31
+ else
32
+ text_editor
33
+ end
34
+ end
16
35
  end
17
36
  end
@@ -0,0 +1,8 @@
1
+ module Pulitzer
2
+ class SequenceFlowStyle < ActiveRecord::Base
3
+ belongs_to :post_type
4
+ has_many :partials
5
+ validates :display_name, presence: true
6
+ validates :css_class_name, presence: true
7
+ end
8
+ end
@@ -0,0 +1,14 @@
1
+ <div class="pulitzer-row">
2
+ <%= render 'pulitzer/shared/error_messages', object: arrangement_style %>
3
+ <%= form_for arrangement_style, html: ajax_form_hash(dom_target(arrangement_style)) do |f| %>
4
+ <%= render partial: 'form_fields', locals: { f: f, arrangement_style: arrangement_style } %>
5
+ <div class="pulitzer-span ten-percent">
6
+ <%= f.submit "Update" %>
7
+ </div>
8
+ <div class="pulitzer-span ten-percent">
9
+ <%= link_to('Cancel', arrangement_style_path(arrangement_style), :class => 'button',
10
+ data: { ajax_link: true, ajax_target: dom_target(arrangement_style) } ) %>
11
+ </div>
12
+ <% end %>
13
+
14
+ </div>
@@ -0,0 +1,6 @@
1
+ <div class="pulitzer-span one-fifth">
2
+ <%= f.text_field :display_name %>
3
+ </div>
4
+ <div class="pulitzer-span one-fifth">
5
+ <%= f.text_field :view_file_name %>
6
+ </div>
@@ -0,0 +1,12 @@
1
+ <div class="pulitzer-row">
2
+ <%= form_for arrangement_style, html: ajax_form_hash(dom_target(arrangement_style.post_type, :arrangement_styles_container), insert_method: 'append', reset_on_success: true) do |f| %>
3
+ <%= f.hidden_field :post_type_id %>
4
+ <%= render partial: 'form_fields', locals: { f: f, arrangement_style: arrangement_style } %>
5
+ <div class="pulitzer-span ten-percent">
6
+ <%= f.submit "Create", data: {disable_with: false} %>
7
+ </div>
8
+ <div class="pulitzer-span ten-percent">
9
+ <a class="button" data-emptier="true" data-target="<%= dom_target(arrangement_style.post_type, :new_arrangement_style)%>">Close</a>
10
+ </div>
11
+ <% end %>
12
+ </div>
@@ -0,0 +1,10 @@
1
+ <div class="pulitzer-row">
2
+ <div class="pulitzer-span one-fifth"><%= arrangement_style.display_name %></div>
3
+ <div class="pulitzer-span one-fifth"><%= arrangement_style.view_file_name %></div>
4
+ <div class="pulitzer-span ten-percent">
5
+ <%= ajax_link "Edit", edit_arrangement_style_path(arrangement_style), {}, dom_target(arrangement_style) %>
6
+ </div>
7
+ <div class="pulitzer-span ten-percent">
8
+ <%= ajax_delete 'Delete', arrangement_style_path(arrangement_style), {}, dom_target(arrangement_style) %>
9
+ </div>
10
+ </div>
@@ -0,0 +1,3 @@
1
+ <div class="pulitzer-row" id="<%= dom_id(arrangement_style) %>">
2
+ <%= render partial: '/pulitzer/arrangement_styles/show', locals: {arrangement_style: arrangement_style} %>
3
+ </div>
@@ -0,0 +1,14 @@
1
+ <div class="pulitzer-row">
2
+ <%= render 'pulitzer/shared/error_messages', object: background_style %>
3
+ <%= form_for background_style, html: ajax_form_hash(dom_target(background_style)) do |f| %>
4
+ <%= render partial: 'form_fields', locals: { f: f, background_style: background_style } %>
5
+ <div class="pulitzer-span ten-percent">
6
+ <%= f.submit "Update" %>
7
+ </div>
8
+ <div class="pulitzer-span ten-percent">
9
+ <%= link_to('Cancel', background_style_path(background_style), :class => 'button',
10
+ data: { ajax_link: true, ajax_target: dom_target(background_style) } ) %>
11
+ </div>
12
+ <% end %>
13
+ </div>
14
+
@@ -0,0 +1,6 @@
1
+ <div class="pulitzer-span one-fifth">
2
+ <%= f.text_field :display_name %>
3
+ </div>
4
+ <div class="pulitzer-span one-fifth">
5
+ <%= f.text_field :css_class_name %>
6
+ </div>
@@ -0,0 +1,12 @@
1
+ <div class="pulitzer-rowe">
2
+ <%= form_for background_style, html: ajax_form_hash(dom_target(background_style.post_type, :background_styles_container), insert_method: 'append', reset_on_success: true) do |f| %>
3
+ <%= f.hidden_field :post_type_id %>
4
+ <%= render partial: 'form_fields', locals: { f: f, background_style: background_style } %>
5
+ <div class="pulitzer-span ten-percent">
6
+ <%= f.submit "Create", data: {disable_with: false} %>
7
+ </div>
8
+ <div class="pulitzer-span ten-percent">
9
+ <a class="button" data-emptier="true" data-target="<%= dom_target(background_style.post_type, :new_background_style)%>">Close</a>
10
+ </div>
11
+ <% end %>
12
+ </div>
@@ -0,0 +1,10 @@
1
+ <div class="pulitzer-row">
2
+ <div class="pulitzer-span one-fifth"><%= background_style.display_name %></div>
3
+ <div class="pulitzer-span one-fifth"><%= background_style.css_class_name %></div>
4
+ <div class="pulitzer-span ten-percent">
5
+ <%= ajax_link "Edit", edit_background_style_path(background_style), {}, dom_target(background_style) %>
6
+ </div>
7
+ <div class="pulitzer-span ten-percenth">
8
+ <%= ajax_delete 'Delete', background_style_path(background_style), {}, dom_target(background_style) %>
9
+ </div>
10
+ </div>
@@ -0,0 +1,3 @@
1
+ <div class="pulitzer-row" id="<%= dom_id(background_style) %>">
2
+ <%= render partial: '/pulitzer/background_styles/show', locals: {background_style: background_style} %>
3
+ </div>
@@ -1,8 +1,17 @@
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 %>
1
+ <div class="pulitzer-row">
2
+ <%= render 'pulitzer/shared/error_messages', object: ffst %>
3
+ <%= form_for ffst, html: ajax_form_hash(dom_target(ffst)) do |f| %>
4
+ <%= render partial: 'form_fields', locals: { f: f, ffst: ffst } %>
5
+ <div class="pulitzer-span ten-percent">
6
+ <%= f.submit "Update" %>
7
+ </div>
8
+ <div class="pulitzer-span ten-percent">
9
+ <%= link_to('Cancel', free_form_section_type_path(ffst), :class => 'button',
10
+ data: { ajax_link: true, ajax_target: dom_target(ffst) } ) %>
11
+ </div>
12
+ <div class="pulitzer-span ten-percent">
13
+ <%= ajax_delete 'Delete', free_form_section_type_path(ffst), {}, dom_target(ffst) %>
14
+ </div>
15
+ <% end %>
8
16
 
17
+ </div>
@@ -1,4 +1,6 @@
1
- <%= f.label :name %>
2
- <%= f.text_field :name %>
3
- <%= f.label :sort_order %>
4
- <%= f.text_field :sort_order %>
1
+ <div class="pulitzer-span one-fifth">
2
+ <%= f.text_field :name %>
3
+ </div>
4
+ <div class="pulitzer-span one-fifth">
5
+ <%= f.text_field :sort_order %>
6
+ </div>
@@ -1,7 +1,12 @@
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 %>
1
+ <div class="pulitzer-row">
2
+ <%= 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| %>
3
+ <%= f.hidden_field :post_type_id %>
4
+ <%= render partial: 'form_fields', locals: { f: f, ffst: ffst } %>
5
+ <div class="pulitzer-span ten-percent">
6
+ <%= f.submit "Create", data: {disable_with: false} %>
7
+ </div>
8
+ <div class="pulitzer-span ten-percent">
9
+ <a class="button" data-emptier="true" data-target="#new_free_form_section_type_<%= dom_id(ffst.post_type) %>">Close</a>
10
+ </div>
11
+ <% end %>
12
+ </div>
@@ -1,13 +1,11 @@
1
- <ul class="inline-list">
2
- <li><%= ffst.name %></li>
3
- <li>
1
+ <div class="pulitzer-row">
2
+ <div class="pulitzer-span one-fifth"><%= ffst.name %></div>
3
+ <div class="pulitzer-span one-fifth"><%= ffst.sort_order %></div>
4
+ <div class="pulitzer-span one-fifth">
5
+ <%= ajax_link "Required partials", partial_types_path(ffst_id: ffst), {}, dom_target(ffst, :associations_container) %>
6
+ </div>
7
+ <div class="pulitzer-span ten-percent">
4
8
  <%= ajax_link "Edit", edit_free_form_section_type_path(ffst), {}, dom_target(ffst) %>
5
- </li>
6
- <li>
7
- <%= ajax_link "Required partials", partial_types_path(ffst_id: ffst), {}, "#partials_#{dom_id(ffst)}" %>
8
- </li>
9
- <li>
10
- <%= ajax_delete 'Delete', free_form_section_type_path(ffst), {}, dom_target(ffst) %>
11
- </li>
12
- <div id="partials_<%= dom_id(ffst) %>"></div>
13
- </ul>
9
+ </div>
10
+ <div id="<%= dom_id(ffst, :associations_container) %>"></div>
11
+ </div>