pulitzer 0.4.1 → 0.4.2
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 +4 -0
- data/app/controllers/pulitzer/partials_controller.rb +9 -4
- data/app/interactions/pulitzer/update_post_type_content_elements.rb +10 -0
- data/app/models/pulitzer/free_form_section.rb +1 -1
- data/app/models/pulitzer/post_type.rb +1 -0
- data/app/views/pulitzer/content_elements/_index.html.erb +10 -5
- data/app/views/pulitzer/partials/_form.html.erb +9 -1
- data/app/views/pulitzer/partials/_index.html.erb +1 -1
- data/app/views/pulitzer/partials/_new.html.erb +4 -0
- data/app/views/pulitzer/partials/_show.html.erb +9 -2
- data/app/views/pulitzer/versions/_edit.html.erb +10 -4
- data/db/migrate/20160519181030_add_label_to_partial.rb +5 -0
- data/lib/pulitzer/content_element_helper.rb +4 -0
- data/lib/pulitzer/version.rb +1 -1
- metadata +2 -2
- data/app/views/pulitzer/partials/_fields.html.erb +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 349de1f3241b0779b75810a87af0007d9ae813b1
|
4
|
+
data.tar.gz: 5ced147d99a02930a5bc8b727d3fb591b46ad4bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 707c33cba7df7ce82113c8d17b9d9d4c7eecba3edae5bc73aa2a0f76e37eb2a8e8f2e2ca9952d1e86cbd9424f49778e4cb33bb3167406a4b12617f1db37ec54e
|
7
|
+
data.tar.gz: d32edbaa2efa3005e5fceb58efa568dad7d8d33f57a54266998b13c788e87a904f2760573016e54ecd8cb361d53afe9e6a30560d7ca2d479ebfff385f359c5a4
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class Pulitzer::PartialsController < Pulitzer::ApplicationController
|
2
|
-
before_filter :set_partial,
|
2
|
+
before_filter :set_partial, except: [:new, :create, :update_all]
|
3
3
|
|
4
4
|
def new
|
5
5
|
@partial = Pulitzer::Partial.new(partial_params)
|
@@ -33,13 +33,18 @@ class Pulitzer::PartialsController < Pulitzer::ApplicationController
|
|
33
33
|
|
34
34
|
def update_all
|
35
35
|
partials = Pulitzer::Partial.find params[:partial]
|
36
|
-
partials.each do |
|
37
|
-
new_sort_order = params[:partial].index(
|
38
|
-
|
36
|
+
partials.each do |partial|
|
37
|
+
new_sort_order = params[:partial].index(partial.id.to_s)
|
38
|
+
partial.update_attribute(:sort_order, new_sort_order)
|
39
39
|
end
|
40
40
|
render nothing: true
|
41
41
|
end
|
42
42
|
|
43
|
+
def destroy
|
44
|
+
@partial.destroy
|
45
|
+
render nothing: true
|
46
|
+
end
|
47
|
+
|
43
48
|
protected
|
44
49
|
|
45
50
|
def partial_params
|
@@ -18,5 +18,15 @@ class Pulitzer::UpdatePostTypeContentElements
|
|
18
18
|
post_type_content_element_type: ptcet)
|
19
19
|
end
|
20
20
|
end
|
21
|
+
post_type.partials.each do |partial|
|
22
|
+
partial.content_elements.where(label: old_label).each do |content_element|
|
23
|
+
content_element.update(label: ptcet.label,
|
24
|
+
height: ptcet.height,
|
25
|
+
width: ptcet.width,
|
26
|
+
text_editor: ptcet.text_editor,
|
27
|
+
content_element_type: ptcet.content_element_type,
|
28
|
+
post_type_content_element_type: ptcet)
|
29
|
+
end
|
30
|
+
end
|
21
31
|
end
|
22
32
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
class Pulitzer::PostType < ActiveRecord::Base
|
2
2
|
enum kind: [ :template, :partial ]
|
3
3
|
has_many :posts, dependent: :destroy
|
4
|
+
has_many :partials, dependent: :destroy
|
4
5
|
has_many :post_type_content_element_types, dependent: :destroy
|
5
6
|
has_many :content_element_types, through: :post_type_content_element_types
|
6
7
|
has_many :free_form_section_types, dependent: :destroy
|
@@ -1,5 +1,10 @@
|
|
1
|
-
<
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
<div class="pulitzer-row">
|
2
|
+
<div class="pulitzer-span margin match-h2" <%= expander(dom_id(version, :content_elements)) %>>▸</div>
|
3
|
+
<div class="pulitzer-span margin match-h2" <%= collapser(dom_id(version, :content_elements)) %>>▾</div>
|
4
|
+
<div class="pulitzer-span"><h2>Page content elements</h2></div>
|
5
|
+
</div>
|
6
|
+
<div <%= collapsed(dom_id(version, :content_elements)) %>>
|
7
|
+
<% version.template_content_elements.each do |content_element| %>
|
8
|
+
<%= render partial: '/pulitzer/content_elements/show_wrapper', locals: { content_element: content_element } %>
|
9
|
+
<% end %>
|
10
|
+
</div>
|
@@ -1,7 +1,15 @@
|
|
1
|
-
<
|
1
|
+
<div class="pulitzer-row">
|
2
|
+
<div class="pulitzer-span margin"><h5><%= partial.name %></h5></div>
|
3
|
+
<div class="pulitzer-span right">
|
4
|
+
<%= render partial: '/pulitzer/shared/drag_handle' %>
|
5
|
+
</div>
|
6
|
+
</div>
|
2
7
|
<%= render 'pulitzer/shared/error_messages', object: partial %>
|
3
8
|
<%= form_for partial, html: ajax_form_hash(dom_target(partial)), multipart: true,
|
4
9
|
data: { server_endpoint: partial_path(partial) } do |f| %>
|
10
|
+
<%= f.label :label %>
|
11
|
+
<%= f.text_field :label %>
|
12
|
+
<%= f.label :layout_id, 'Layout' %>
|
5
13
|
<%= f.collection_select :layout_id, partial.available_layouts, :id, :name, {}, {} %>
|
6
14
|
<%= submit_tag "Update" %>
|
7
15
|
<%= link_to('Cancel', partial_path(partial), :class => 'button',
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<div id="<%= dom_id free_form_section, :partial_container %>">
|
1
|
+
<div id="<%= dom_id free_form_section, :partial_container %>" data-sorter href="<%= update_all_partials_path %>">
|
2
2
|
<% free_form_section.partials.each do |partial| %>
|
3
3
|
<%= render partial: '/pulitzer/partials/show_wrapper', locals: { partial: partial } %>
|
4
4
|
<% end %>
|
@@ -1,10 +1,14 @@
|
|
1
1
|
<%= render 'pulitzer/shared/error_messages', object: partial %>
|
2
2
|
<%= form_for partial, html: ajax_form_hash(dom_target(partial.free_form_section, :partial_container), insert_method: 'append', empty_on_success: dom_target(partial.free_form_section, :new_partial)) do |f| %>
|
3
3
|
<%= f.hidden_field :free_form_section_id %>
|
4
|
+
<%= f.label :label %>
|
5
|
+
<%= f.text_field :label %>
|
6
|
+
<%= f.label :post_type_id, 'Partial Type' %>
|
4
7
|
<%= f.collection_select :post_type_id, Pulitzer::PostType.partials, :id, :name, {}, revealer(dom_id(partial.free_form_section, :new_partial_type), highlander: true) %>
|
5
8
|
<div <%= revealer_target_attrs(dom_id(partial.free_form_section, :new_partial_type)) %>>
|
6
9
|
<% Pulitzer::PostType.partials.each do |post_type| %>
|
7
10
|
<div <%= revealer_option_attrs(dom_id(partial.free_form_section, :new_partial_type), trigger: post_type.id) %>>
|
11
|
+
<%= f.label :layout_id, 'Layout' %>
|
8
12
|
<%= f.collection_select :layout_id, post_type.layouts, :id, :name, {}, {} %>
|
9
13
|
</div>
|
10
14
|
<% end %>
|
@@ -1,7 +1,14 @@
|
|
1
1
|
<div class="pulitzer-row">
|
2
|
-
<div class="pulitzer-span"
|
2
|
+
<div class="pulitzer-span margin match-h5" <%= expander(dom_id(partial)) %>>▸</div>
|
3
|
+
<div class="pulitzer-span margin match-h5" <%= collapser(dom_id(partial)) %>>▾</div>
|
4
|
+
<div class="pulitzer-span margin"><h5><%= partial.label %></h5></div>
|
5
|
+
<div class="pulitzer-span match-h5"><%= partial.folder_path %>/</div>
|
3
6
|
<div class="pulitzer-span margin match-h5"><%= partial.template_path %></div>
|
4
7
|
<div class="pulitzer-span match-h5"><%= ajax_link 'edit', edit_partial_path(partial), {}, dom_target(partial) %></div>
|
8
|
+
<div class="pulitzer-span right">
|
9
|
+
<%= render partial: '/pulitzer/shared/drag_handle' %>
|
10
|
+
</div>
|
5
11
|
</div>
|
6
|
-
|
12
|
+
<div <%= collapsed(dom_id(partial)) %>>
|
7
13
|
<%= render partial: '/pulitzer/content_elements/partial_index', locals: {partial: partial} %>
|
14
|
+
</div>
|
@@ -18,10 +18,16 @@
|
|
18
18
|
<%= ajax_link "refresh preview", edit_version_path(version), {}, dom_target(version.post, :preview_version) %>
|
19
19
|
<% elsif version.preview? %>
|
20
20
|
<div class="pulitzer-row margin-bottom list-item">
|
21
|
-
<
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
<div class="pulitzer-row">
|
22
|
+
<div class="pulitzer-span margin match-h2" <%= expander(dom_id(version, :tags)) %>>▸</div>
|
23
|
+
<div class="pulitzer-span margin match-h2" <%= collapser(dom_id(version, :tags)) %>>▾</div>
|
24
|
+
<div class="pulitzer-span"><h2>Tags</h2></div>
|
25
|
+
</div>
|
26
|
+
<div <%= collapsed(dom_id(version, :tags)) %>>
|
27
|
+
<% Pulitzer::Post::TAG_MODELS.each do |tag_model| %>
|
28
|
+
<%= render partial: 'pulitzer/post_tags/show_wrapper', locals: { version: version, tag_model: tag_model } %>
|
29
|
+
<% end %>
|
30
|
+
</div>
|
25
31
|
</div>
|
26
32
|
<% if version.has_templated_content_elements? %>
|
27
33
|
<div class="pulitzer-row margin-bottom list-item">
|
@@ -27,6 +27,10 @@ module Pulitzer
|
|
27
27
|
content_tag(:img, nil, options.merge(srcset: element.image_url(:cms)))
|
28
28
|
end
|
29
29
|
|
30
|
+
def render_cms_image_path(element,options = {})
|
31
|
+
element.image_url(:cms)
|
32
|
+
end
|
33
|
+
|
30
34
|
def render_video(element, options = {})
|
31
35
|
content_tag(:iframe, nil, options.merge(src: element.video_link)) if element.video_link
|
32
36
|
end
|
data/lib/pulitzer/version.rb
CHANGED
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.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Draut
|
@@ -516,7 +516,6 @@ files:
|
|
516
516
|
- app/views/pulitzer/layouts/_new.html.erb
|
517
517
|
- app/views/pulitzer/layouts/_show.html.erb
|
518
518
|
- app/views/pulitzer/layouts/_show_wrapper.html.erb
|
519
|
-
- app/views/pulitzer/partials/_fields.html.erb
|
520
519
|
- app/views/pulitzer/partials/_form.html.erb
|
521
520
|
- app/views/pulitzer/partials/_index.html.erb
|
522
521
|
- app/views/pulitzer/partials/_new.html.erb
|
@@ -573,6 +572,7 @@ files:
|
|
573
572
|
- db/migrate/20160516150237_fix_post_type_kinds.rb
|
574
573
|
- db/migrate/20160517181706_create_layouts.rb
|
575
574
|
- db/migrate/20160517182500_add_layout_to_partial.rb
|
575
|
+
- db/migrate/20160519181030_add_label_to_partial.rb
|
576
576
|
- lib/pulitzer.rb
|
577
577
|
- lib/pulitzer/content_element_helper.rb
|
578
578
|
- lib/pulitzer/engine.rb
|