pulitzer 0.13.1 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/pulitzer.scss +28 -2
- data/app/controllers/pulitzer/content_elements_controller.rb +6 -2
- data/app/controllers/pulitzer/custom_option_lists_controller.rb +55 -0
- data/app/controllers/pulitzer/custom_options_controller.rb +55 -0
- data/app/controllers/pulitzer/partial_types_controller.rb +0 -11
- data/app/controllers/pulitzer/posts_controller.rb +5 -6
- data/app/controllers/pulitzer/styles_controller.rb +42 -0
- data/app/helpers/pulitzer/posts_helper.rb +15 -4
- data/app/interactions/pulitzer/content_elements_controller/update.rb +21 -0
- data/app/models/pulitzer/content_element.rb +63 -8
- data/app/models/pulitzer/content_element_type.rb +6 -1
- data/app/models/pulitzer/custom_option.rb +6 -0
- data/app/models/pulitzer/custom_option_list.rb +10 -0
- data/app/models/pulitzer/post_type_content_element_type.rb +58 -2
- data/app/models/pulitzer/style.rb +11 -0
- data/app/views/pulitzer/content_elements/_clickable_fields.html.erb +31 -0
- data/app/views/pulitzer/content_elements/_form.html.erb +1 -3
- data/app/views/pulitzer/content_elements/_partial_index.html.erb +1 -1
- data/app/views/pulitzer/content_elements/_show.html.erb +11 -20
- data/app/views/pulitzer/custom_option_lists/_edit.html.erb +10 -0
- data/app/views/pulitzer/custom_option_lists/_index.html.erb +12 -0
- data/app/views/pulitzer/custom_option_lists/_new.html.erb +9 -0
- data/app/views/pulitzer/custom_option_lists/_show.html.erb +11 -0
- data/app/views/pulitzer/custom_option_lists/_show_wrapper.html.erb +3 -0
- data/app/views/pulitzer/custom_options/_edit.html.erb +10 -0
- data/app/views/pulitzer/custom_options/_fields.html.erb +2 -0
- data/app/views/pulitzer/custom_options/_index.html.erb +20 -0
- data/app/views/pulitzer/custom_options/_new.html.erb +10 -0
- data/app/views/pulitzer/custom_options/_show.html.erb +5 -0
- data/app/views/pulitzer/custom_options/_show_wrapper.html.erb +3 -0
- data/app/views/pulitzer/free_form_section_types/_show_wrapper.html.erb +1 -1
- data/app/views/pulitzer/partial_types/_index.html.erb +1 -1
- data/app/views/pulitzer/partials/_index.html.erb +4 -4
- data/app/views/pulitzer/partials/_new.html.erb +1 -1
- data/app/views/pulitzer/post_type_content_element_types/_form_fields.html.erb +4 -0
- data/app/views/pulitzer/post_type_content_element_types/_show.html.erb +13 -5
- data/app/views/pulitzer/post_types/_template.html.erb +5 -4
- data/app/views/pulitzer/post_types/index.html.erb +26 -12
- data/app/views/pulitzer/posts/{index.html.erb → _index.html.erb} +0 -0
- data/app/views/pulitzer/styles/_index.html.erb +10 -0
- data/app/views/pulitzer/styles/_new.html.erb +29 -0
- data/app/views/pulitzer/styles/_show.html.erb +15 -0
- data/app/views/pulitzer/styles/_show_wrapper.html.erb +3 -0
- data/config/routes.rb +4 -0
- data/lib/pulitzer/content_element_helper.rb +22 -4
- data/lib/pulitzer/version.rb +1 -1
- data/spec/controllers/pages_controller_spec.rb +16 -0
- data/spec/dummy/app/controllers/pages_controller.rb +7 -0
- data/spec/dummy/app/controllers/pulitzer_preview/pages_controller.rb +16 -0
- data/spec/dummy/app/views/pages/welcome.html.erb +27 -0
- data/spec/dummy/app/views/pulitzer/welcome.html.erb +27 -0
- data/spec/dummy/config/initializers/zz_pulitzer.rb +1 -0
- data/spec/dummy/config/routes.rb +2 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +198 -0
- data/spec/dummy/log/test.log +1733 -0
- metadata +34 -6
- data/app/interactions/pulitzer/update_free_form_section_partials.rb +0 -18
- data/app/models/pulitzer/layout.rb +0 -11
- data/app/views/pulitzer/partial_types/_form.html.erb +0 -21
@@ -2,15 +2,20 @@ module Pulitzer
|
|
2
2
|
class ContentElementType < ActiveRecord::Base
|
3
3
|
validates :name, presence: true, uniqueness: true
|
4
4
|
has_many :post_type_content_element_types, dependent: :destroy
|
5
|
+
has_many :layouts, dependent: :destroy
|
5
6
|
|
6
7
|
def type
|
7
8
|
name.downcase.to_sym
|
8
9
|
end
|
9
10
|
|
10
|
-
%i(text image video).each do |content_type|
|
11
|
+
%i(text image video clickable).each do |content_type|
|
11
12
|
define_method "#{content_type}_type?" do
|
12
13
|
type == content_type
|
13
14
|
end
|
14
15
|
end
|
16
|
+
|
17
|
+
def has_styles?
|
18
|
+
[:clickable].include? type
|
19
|
+
end
|
15
20
|
end
|
16
21
|
end
|
@@ -4,21 +4,72 @@ module Pulitzer
|
|
4
4
|
|
5
5
|
belongs_to :post_type
|
6
6
|
belongs_to :content_element_type
|
7
|
-
|
7
|
+
has_many :styles
|
8
|
+
|
8
9
|
before_save :handle_sort_order
|
9
10
|
|
10
|
-
delegate :type, :image_type?, to: :content_element_type
|
11
|
+
delegate :type, :image_type?, :has_styles?, to: :content_element_type
|
11
12
|
|
12
13
|
default_scope { order(sort_order: :asc) }
|
13
14
|
|
14
15
|
validates :label, presence: true
|
15
16
|
|
17
|
+
def self.any_clickable
|
18
|
+
return @any if @any.present?
|
19
|
+
@any = OpenStruct.new
|
20
|
+
@any.gid = 'any'
|
21
|
+
@any.name = 'Any'
|
22
|
+
@any
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.url_clickable
|
26
|
+
return @url if @url.present?
|
27
|
+
@url = OpenStruct.new
|
28
|
+
@url.gid = 'url'
|
29
|
+
@url.name = 'URL'
|
30
|
+
@url
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.clickable_kinds
|
34
|
+
[any_clickable] + Pulitzer::CustomOptionList.all.to_a + [url_clickable]
|
35
|
+
end
|
36
|
+
|
37
|
+
def clickable_kind_display
|
38
|
+
GlobalID::Locator.locate(clickable_kind)&.name || clickable_kind.humanize
|
39
|
+
end
|
40
|
+
|
41
|
+
def any_clickable_kind?
|
42
|
+
'any' == clickable_kind
|
43
|
+
end
|
44
|
+
|
45
|
+
def url_clickable_kind?
|
46
|
+
'url' == clickable_kind
|
47
|
+
end
|
48
|
+
|
49
|
+
def clickable_kinds
|
50
|
+
Pulitzer::CustomOptionList.all.to_a + [self.class.url_clickable]
|
51
|
+
end
|
52
|
+
|
53
|
+
def custom_clickable_kinds
|
54
|
+
Pulitzer::CustomOptionList.all.to_a
|
55
|
+
end
|
56
|
+
|
57
|
+
def custom_option_list
|
58
|
+
GlobalID::Locator.locate(clickable_kind)
|
59
|
+
end
|
60
|
+
|
61
|
+
def custom_options
|
62
|
+
custom_option_list&.custom_options
|
63
|
+
end
|
64
|
+
|
16
65
|
def type_specific_display
|
17
66
|
case type
|
18
67
|
when :image
|
19
68
|
"#{height}x#{width}"
|
20
69
|
when :text
|
21
70
|
text_editor_display
|
71
|
+
when :clickable
|
72
|
+
clickable_kind_display
|
22
73
|
else
|
23
74
|
''
|
24
75
|
end
|
@@ -32,5 +83,10 @@ module Pulitzer
|
|
32
83
|
text_editor
|
33
84
|
end
|
34
85
|
end
|
86
|
+
|
87
|
+
def first_style
|
88
|
+
styles.first
|
89
|
+
end
|
90
|
+
|
35
91
|
end
|
36
92
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Pulitzer
|
2
|
+
class Style < ActiveRecord::Base
|
3
|
+
has_many :content_elements
|
4
|
+
belongs_to :post_type_content_element_type
|
5
|
+
validates :display_name, :css_class_name, presence: true
|
6
|
+
|
7
|
+
def first?
|
8
|
+
post_type_content_element_type.first_style.id == id
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<div class="pulitzer-row"><span class="pulitzer-span heading">clickable text</span></div>
|
2
|
+
<div class="pulitzer-row margin-bottom">
|
3
|
+
<span class="pulitzer-span one-half"> <%= f.text_field :title %></span>
|
4
|
+
</div>
|
5
|
+
<% if f.object.any_clickable_kind? %>
|
6
|
+
<div class="pulitzer-span one-fifth">
|
7
|
+
<span class="pulitzer-span heading">action type</span>
|
8
|
+
<%= select_tag 'content_element[clickable_kind]',
|
9
|
+
options_from_collection_for_select(f.object.clickable_kinds, :gid, :name, f.object.clickable_kind.gid), revealer(dom_id(f.object, :clickable_kind), highlander: true) %>
|
10
|
+
</div>
|
11
|
+
<div <%= revealer_target_attrs(dom_id(f.object, :clickable_kind)) %> ></div>
|
12
|
+
<div class="pulitzer-span one-half" <%= revealer_option_attrs(dom_id(f.object, :clickable_kind), trigger: 'url') %>>
|
13
|
+
<div class="pulitzer-row"><span class="pulitzer-span heading">URL</span></div>
|
14
|
+
<%= f.text_field :body %>
|
15
|
+
</div>
|
16
|
+
<% f.object.custom_clickable_kinds.each do |custom_option_list| %>
|
17
|
+
<div class="pulitzer-span one-quarter" <%= revealer_option_attrs(dom_id(f.object, :clickable_kind), trigger: custom_option_list.gid) %>>
|
18
|
+
<span class="pulitzer-span heading"><%= custom_option_list.name %></span>
|
19
|
+
<%= f.select :custom_option_id, options_from_collection_for_select(custom_option_list.custom_options, :id, :display, f.object.custom_option_id) %>
|
20
|
+
</div>
|
21
|
+
<% end %>
|
22
|
+
<% elsif f.object.url_clickable_kind? %>
|
23
|
+
<div class="pulitzer-row"><span class="pulitzer-span heading">URL</span></div>
|
24
|
+
<%= f.text_field :body %>
|
25
|
+
<% else %>
|
26
|
+
<%= hidden_field_tag 'content_element[clickable_kind]', f.object.custom_option_list.gid %>
|
27
|
+
<span class="pulitzer-span heading"><%= f.object.custom_option_list.name %></span>
|
28
|
+
<%= f.select :custom_option_id, options_from_collection_for_select(f.object.custom_options, :id, :display) %>
|
29
|
+
<% end %>
|
30
|
+
<div class="pulitzer-row"><span class="pulitzer-span heading">Style</span></div>
|
31
|
+
<%= f.select :style_id, options_from_collection_for_select(f.object.style_options, :id, :display_name, f.object.style_id) %>
|
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
<h5><%= content_element.label %></h5>
|
3
|
-
<% end %>
|
1
|
+
<h5><%= content_element.label %></h5>
|
4
2
|
<%= form_for content_element, html: ajax_form_hash(dom_target(content_element)), multipart: true,
|
5
3
|
data: { server_endpoint: content_element_path(content_element) } do |f| %>
|
6
4
|
<%= render partial: "/pulitzer/content_elements/#{content_element.type}_fields", locals: { f: f, content_element: content_element } %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<div class="pulitzer-row margin-left">
|
1
|
+
<div class="pulitzer-row margin-left highlight-off-white">
|
2
2
|
<% partial.content_elements.each do |content_element| %>
|
3
3
|
<%= render partial: '/pulitzer/content_elements/show_wrapper', locals: { element: content_element } %>
|
4
4
|
<% end %>
|
@@ -1,23 +1,14 @@
|
|
1
|
-
|
1
|
+
<div class="pulitzer-row">
|
2
2
|
<div class="pulitzer-row">
|
3
|
-
<
|
4
|
-
<%=
|
5
|
-
|
3
|
+
<h5>
|
4
|
+
<%= content_element.label %>
|
5
|
+
<% if content_element.required? %>
|
6
|
+
- *required
|
7
|
+
<% end %>
|
8
|
+
</h5>
|
9
|
+
</div>
|
10
|
+
<div class="pulitzer-row">
|
11
|
+
<div class="pulitzer-span ninety-percent"><%= render_element(content_element) %></div>
|
12
|
+
<div class="pulitzer-span ten-percent"><%= ajax_link "Edit", edit_content_element_path(content_element), {}, dom_target(content_element) %></div>
|
6
13
|
</div>
|
7
|
-
<% end %>
|
8
|
-
<div class="pulitzer-row">
|
9
|
-
<ul class="list">
|
10
|
-
<% if content_element.template? %>
|
11
|
-
<li>
|
12
|
-
<h5>
|
13
|
-
<%= content_element.label %>
|
14
|
-
<% if content_element.required? %>
|
15
|
-
- *required
|
16
|
-
<% end %>
|
17
|
-
</h5>
|
18
|
-
</li>
|
19
|
-
<% end %>
|
20
|
-
<li><%= render_element(content_element) %></li>
|
21
|
-
<li><%= ajax_link "Edit", edit_content_element_path(content_element), {}, dom_target(content_element) %></li>
|
22
|
-
</ul>
|
23
14
|
</div>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<div class="pulitzer-row">
|
2
|
+
<%= form_for custom_option_list, ajax_form_hash(dom_target(custom_option_list)) do |f| %>
|
3
|
+
<div class="pulitzer-span margin one-half"><%= f.text_field :name %></div>
|
4
|
+
<div class="pulitzer-span margin one-half">
|
5
|
+
<%= f.submit data: {disable_with: false}, class: 'input-medium' %>
|
6
|
+
<%= ajax_link 'cancel', custom_option_list_path(custom_option_list), {class: 'button'}, dom_target(custom_option_list) %>
|
7
|
+
<%= ajax_delete 'delete', custom_option_list_path(custom_option_list), {class: 'button'}, dom_target(custom_option_list) %>
|
8
|
+
</div>
|
9
|
+
<% end %>
|
10
|
+
</div>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<div class="pulitzer-row margin-top margin-bottom">
|
2
|
+
<div class="pulitzer-row margin-bottom">
|
3
|
+
<%= ajax_link "add a new custom option list", new_custom_option_list_path(custom_option_list: {name: nil}), {}, "#new_custom_option_list" %>
|
4
|
+
</div>
|
5
|
+
<div id="new_custom_option_list"></div>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<div id="custom_option_lists_container">
|
9
|
+
<% @custom_option_lists.each do |col| %>
|
10
|
+
<%= render partial: 'show_wrapper', locals: {custom_option_list: col} %>
|
11
|
+
<% end %>
|
12
|
+
</div>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<div class="pulitzer-row">
|
2
|
+
<%= form_for custom_option_list, html: ajax_form_hash('#custom_option_lists_container', insert_method: 'prepend', error_target: '#new_custom_option_list', reset_on_success: true) do |f| %>
|
3
|
+
<div class="pulitzer-span margin one-half"><%= f.text_field :name %></div>
|
4
|
+
<div class="pulitzer-span margin one-half">
|
5
|
+
<%= f.submit data: {disable_with: false}, class: 'input-medium' %> or
|
6
|
+
<a class="link-button-small" <%= emptier '#new_custom_option_list' %>>close</a>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
9
|
+
</div>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<div class="pulitzer-row">
|
2
|
+
<div class="pulitzer-span margin one-half">
|
3
|
+
<div class="pulitzer-span margin ten-percent" <%= expander(dom_id(custom_option_list, :options_container)) %>><strong>+</strong></div>
|
4
|
+
<div class="pulitzer-span margin ten-percent" <%= collapser(dom_id(custom_option_list, :options_container)) %>><strong>-</strong></div>
|
5
|
+
<%= custom_option_list.name %>
|
6
|
+
</div>
|
7
|
+
<div class="pulitzer-span margin one-half"><%= ajax_link 'edit', edit_custom_option_list_path(custom_option_list), {}, dom_target(custom_option_list) %></div>
|
8
|
+
</div>
|
9
|
+
<div class="pulitzer-row pulitzer-indent" <%= collapsed(dom_id(custom_option_list, :options_container)) %>>
|
10
|
+
<%= render partial: '/pulitzer/custom_options/index', locals: {custom_option_list: custom_option_list} %>
|
11
|
+
</div>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<div class="pulitzer-row">
|
2
|
+
<%= form_for custom_option, ajax_form_hash(dom_target(custom_option)) do |f| %>
|
3
|
+
<%= render partial: '/pulitzer/custom_options/fields', locals: {f: f} %>
|
4
|
+
<div class="pulitzer-span margin one-third">
|
5
|
+
<%= f.submit data: {disable_with: false}, class: 'input-medium' %>
|
6
|
+
<%= ajax_link 'cancel', custom_option_path(custom_option), {class: 'button'}, dom_target(custom_option) %>
|
7
|
+
<%= ajax_delete 'delete', custom_option_path(custom_option), {class: 'button'}, dom_target(custom_option) %>
|
8
|
+
</div>
|
9
|
+
<% end %>
|
10
|
+
</div>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<div class="pulitzer-row margin-top margin-bottom highlight-off-white">
|
2
|
+
<div class="pulitzer-row margin-bottom">
|
3
|
+
<%= ajax_link "add a new custom option to #{custom_option_list.name}", new_custom_option_path(custom_option: {custom_option_list_id: custom_option_list.id}), {}, dom_target(custom_option_list, :new_option) %>
|
4
|
+
</div>
|
5
|
+
<div class="pulitzer-row">
|
6
|
+
<div class="pulitzer-span one-third heading">
|
7
|
+
Editor Display
|
8
|
+
</div>
|
9
|
+
<div class="pulitzer-span one-third heading">
|
10
|
+
Value
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
<div id="<%= dom_id(custom_option_list, :new_option) %>"></div>
|
14
|
+
<div id="<%= dom_id(custom_option_list, :options_container) %>">
|
15
|
+
<% custom_option_list.custom_options.each do |co| %>
|
16
|
+
<%= render partial: '/pulitzer/custom_options/show_wrapper', locals: {custom_option: co} %>
|
17
|
+
<% end %>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<div class="pulitzer-row">
|
2
|
+
<%= form_for custom_option, html: ajax_form_hash(dom_target(custom_option.custom_option_list, :options_container), insert_method: 'prepend', error_target: dom_target(custom_option.custom_option_list, :new_option), reset_on_success: true) do |f| %>
|
3
|
+
<%= f.hidden_field :custom_option_list_id %>
|
4
|
+
<%= render partial: '/pulitzer/custom_options/fields', locals: {f: f} %>
|
5
|
+
<div class="pulitzer-span margin one-third">
|
6
|
+
<%= f.submit data: {disable_with: false}, class: 'input-medium' %> or
|
7
|
+
<a class="link-button-small" <%= emptier dom_target(custom_option.custom_option_list, :new_option) %>>close</a>
|
8
|
+
</div>
|
9
|
+
<% end %>
|
10
|
+
</div>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<div class="pulitzer-row">
|
2
|
+
<div class="pulitzer-span margin one-third"><%= custom_option.display %></div>
|
3
|
+
<div class="pulitzer-span margin one-third"><%= custom_option.value %></div>
|
4
|
+
<div class="pulitzer-span margin one-third"><%= ajax_link 'edit', edit_custom_option_path(custom_option), {}, dom_target(custom_option) %></div>
|
5
|
+
</div>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
</div>
|
6
6
|
|
7
7
|
<div id="<%= dom_id ffst, :partials %>">
|
8
|
-
<div class="pulitzer-row margin-bottom
|
8
|
+
<div class="pulitzer-row margin-bottom">
|
9
9
|
<%= ajax_link "add a new required partial for #{ffst.name}", new_partial_type_path({ffst_id: ffst}), {}, dom_target(ffst, :new_partial) %>
|
10
10
|
<div id="<%= dom_id(ffst, :new_partial) %>"></div>
|
11
11
|
</div>
|
@@ -3,10 +3,10 @@
|
|
3
3
|
<%= render partial: '/pulitzer/partials/show_wrapper', locals: { partial: partial } %>
|
4
4
|
<% end %>
|
5
5
|
</div>
|
6
|
-
|
7
6
|
<div id="<%= dom_id free_form_section, :partials %>">
|
8
|
-
<div class="pulitzer-row margin-bottom
|
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
|
-
|
7
|
+
<div class="pulitzer-row margin-bottom">
|
8
|
+
<%= ajax_link "add a new partial for #{free_form_section.name}", new_partial_path(partial: {free_form_section_id: free_form_section}), {class: 'button'}, dom_target(free_form_section, :new_partial) %>
|
9
|
+
</div>
|
10
|
+
<div class="pulitzer-row" id="<%= dom_id(free_form_section, :new_partial) %>"></div>
|
11
11
|
</div>
|
12
12
|
</div>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<%= f.text_field :label %>
|
6
6
|
</div>
|
7
7
|
<div class="pulitzer-span ten-percent">
|
8
|
-
<%= f.collection_select :post_type_id, Pulitzer::PostType.partials, :id, :name, {}, revealer(dom_id(partial.free_form_section, :new_partial_type), highlander: true) %>
|
8
|
+
<%= f.collection_select :post_type_id, Pulitzer::PostType.partials.order(:name), :id, :name, {}, revealer(dom_id(partial.free_form_section, :new_partial_type), highlander: true) %>
|
9
9
|
</div>
|
10
10
|
<div class="pulitzer-span one-half" <%= revealer_target_attrs(dom_id(partial.free_form_section, :new_partial_type)) %>>
|
11
11
|
<% Pulitzer::PostType.partials.each do |post_type| %>
|
@@ -23,6 +23,10 @@ revealer(dom_id(ptcet, :revealer), highlander: true) %>
|
|
23
23
|
|
24
24
|
</div>
|
25
25
|
|
26
|
+
<div <%= revealer_option_attrs(dom_id(ptcet, :revealer), trigger: Pulitzer::ContentElementType.find_by(name: 'Clickable').id) %> class="pulitzer-span one-fifth">
|
27
|
+
<%= f.select :clickable_kind, options_from_collection_for_select(Pulitzer::PostTypeContentElementType.clickable_kinds, :gid, :name, f.object.clickable_kind) %>
|
28
|
+
</div>
|
29
|
+
|
26
30
|
<div class="pulitzer-span ten-percent">
|
27
31
|
<%= f.check_box :required %>
|
28
32
|
</div>
|
@@ -1,17 +1,25 @@
|
|
1
1
|
<div class="pulitzer-row">
|
2
2
|
<div class="pulitzer-span one-fifth"><%= ptcet.label %></div>
|
3
|
-
<div class="pulitzer-span
|
4
|
-
<div class="pulitzer-span
|
3
|
+
<div class="pulitzer-span ten-percent"><%= ptcet.content_element_type.name %></div>
|
4
|
+
<div class="pulitzer-span ten-percent">
|
5
5
|
<%= ptcet.type_specific_display %>
|
6
6
|
</div>
|
7
|
-
<div class="pulitzer-span
|
8
|
-
|
7
|
+
<div class="pulitzer-span two-fifths">
|
8
|
+
<% if ptcet.has_styles? %>
|
9
|
+
<%= ajax_link "Styles", styles_path(post_type_content_element_type_id: ptcet.id), {}, dom_target(ptcet, :styles_container) %>
|
10
|
+
<% else %>
|
11
|
+
|
12
|
+
<% end %>
|
9
13
|
</div>
|
10
|
-
<div class="pulitzer-span
|
14
|
+
<div class="pulitzer-span five-percent">
|
15
|
+
<%= ptcet.required? ? '✓' : '' %>
|
16
|
+
</div>
|
17
|
+
<div class="pulitzer-span five-percent">
|
11
18
|
<%= ptcet.sort_order %>
|
12
19
|
</div>
|
13
20
|
<div class="pulitzer-span ten-percent">
|
14
21
|
<%= ajax_link "Edit", edit_post_type_content_element_type_path(ptcet), {}, dom_target(ptcet) %> |
|
15
22
|
<%= ajax_delete 'Delete', post_type_content_element_type_path(ptcet), {}, dom_target(ptcet) %>
|
16
23
|
</div>
|
24
|
+
<div id="<%= dom_id(ptcet, :styles_container) %>"></div>
|
17
25
|
</div>
|
@@ -5,10 +5,11 @@
|
|
5
5
|
<h4>Content Elements</h4>
|
6
6
|
<div class="pulitzer-row heading">
|
7
7
|
<div class="pulitzer-span one-fifth heading">Editor Display</div>
|
8
|
-
<div class="pulitzer-span
|
9
|
-
<div class="pulitzer-span
|
10
|
-
<div class="pulitzer-span
|
11
|
-
<div class="pulitzer-span
|
8
|
+
<div class="pulitzer-span ten-percent heading">Content Type</div>
|
9
|
+
<div class="pulitzer-span ten-percent heading">Details</div>
|
10
|
+
<div class="pulitzer-span two-fifths heading"> </div>
|
11
|
+
<div class="pulitzer-span five-percent heading">Req'd</div>
|
12
|
+
<div class="pulitzer-span five-percent heading">Sort</div>
|
12
13
|
</div>
|
13
14
|
<div id="post_type_content_element_types_container_<%= dom_id(post_type) %>">
|
14
15
|
<% post_type.post_type_content_element_types.each do |ptcet| %>
|