noodall-ui 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/app/helpers/noodall/admin/nodes_helper.rb +4 -0
- data/app/views/noodall/admin/nodes/show.html.erb +1 -1
- data/demo/models/page_c.rb +2 -2
- data/demo/views/admin/nodes/_home.html.erb +1 -0
- data/features/change_templates.feature +12 -0
- data/features/content_templates.feature +1 -1
- data/lib/noodall/ui/version.rb +1 -1
- data/public/javascripts/admin/application.js +3 -0
- data/public/javascripts/admin/tiny_mce_config.js +1 -1
- data/public/stylesheets/admin/layout.css +1 -1
- data/spec/factories/node.rb +3 -0
- metadata +5 -4
data/Gemfile.lock
CHANGED
@@ -32,6 +32,10 @@ module Noodall
|
|
32
32
|
|
33
33
|
render :partial => 'slot_form', :locals => { :type => type, :index => index, :component => component, :options => options, :slot_name => "#{ type }_slot_#{ index }" }
|
34
34
|
end
|
35
|
+
|
36
|
+
def can_change_templates?(node)
|
37
|
+
can_publish?(node) and !node.is_a?(Home) and (node.parent.nil? ? Node.template_names : node.parent.class.template_names).length > 1
|
38
|
+
end
|
35
39
|
end
|
36
40
|
end
|
37
41
|
end
|
@@ -123,7 +123,7 @@
|
|
123
123
|
<span class="tooltip" title="Please choose where you would like to place each component"> </span>
|
124
124
|
|
125
125
|
<%= yield :component_table %>
|
126
|
-
<% if
|
126
|
+
<% if can_change_templates?(@node) %>
|
127
127
|
<%= link_to "Change Template", change_template_noodall_admin_node_path(@node), :class => 'change' %>
|
128
128
|
<% end -%>
|
129
129
|
<div id="modules-list">
|
data/demo/models/page_c.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
<%= render :partial => 'body', :locals => { :f => f } %>
|
@@ -11,6 +11,18 @@ Feature: Change templates
|
|
11
11
|
And I visit the content page
|
12
12
|
Then the page should be in the "Page C" template
|
13
13
|
|
14
|
+
Scenario: Cannot change template for "Home" template
|
15
|
+
Given a page exists using the "Home" template
|
16
|
+
And I am editing the content
|
17
|
+
Then I should not see "Change Template"
|
18
|
+
|
19
|
+
Scenario: Cannot cahnge template as parent only allows one sub template
|
20
|
+
Given a page exists using the "Page B" template
|
21
|
+
And that page has a "Page C" parent
|
22
|
+
And I am editing the content
|
23
|
+
Then show me the page
|
24
|
+
Then I should not see "Change Template"
|
25
|
+
|
14
26
|
Scenario: Prevent Template Change if sub content not allowed in new template
|
15
27
|
Given a page exists using the "Page A" template
|
16
28
|
And that page has "Page A" subpages
|
data/lib/noodall/ui/version.rb
CHANGED
@@ -80,6 +80,7 @@ $(document).ready(function() {
|
|
80
80
|
});
|
81
81
|
|
82
82
|
setup_tooltips();
|
83
|
+
|
83
84
|
// Template Choices
|
84
85
|
$('.template label img').hide();
|
85
86
|
$('.template label img').css({
|
@@ -89,6 +90,8 @@ $(document).ready(function() {
|
|
89
90
|
$('.template input').click(function() {
|
90
91
|
$('.template label img').hide();
|
91
92
|
$(this).parent().children('img').fadeIn('fast');
|
93
|
+
var imgHeight = $(this).parent().children('img').height() + 100 ;
|
94
|
+
$('#main-form').css({'min-height' : imgHeight + 'px'});
|
92
95
|
});
|
93
96
|
|
94
97
|
//Field Types on form creator
|
@@ -12,7 +12,7 @@ lite_tiny_mce_config = {
|
|
12
12
|
//"safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking",
|
13
13
|
// Theme options
|
14
14
|
theme_advanced_blockformats : "h2,h3,h4,p",
|
15
|
-
theme_advanced_buttons1 : "bold,italic,underline,|,table,delete_table,col_before,col_after,row_before,row_after,delete_col,delete_row",
|
15
|
+
theme_advanced_buttons1 : "bold,italic,underline,|,bullist,numlist,|,link,unlink,|,table,delete_table,col_before,col_after,row_before,row_after,delete_col,delete_row",
|
16
16
|
theme_advanced_buttons2 : "",
|
17
17
|
theme_advanced_buttons3 : "",
|
18
18
|
theme_advanced_buttons4 : "",
|
data/spec/factories/node.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: noodall-ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 9
|
10
|
+
version: 0.0.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Steve England
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-11-
|
18
|
+
date: 2010-11-15 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -181,6 +181,7 @@ files:
|
|
181
181
|
- demo/seeds.rb
|
182
182
|
- demo/views/admin/components/_gallery.html.erb
|
183
183
|
- demo/views/admin/components/_promo.html.erb
|
184
|
+
- demo/views/admin/nodes/_home.html.erb
|
184
185
|
- demo/views/admin/nodes/_page_a.html.erb
|
185
186
|
- demo/views/admin/nodes/_page_b.html.erb
|
186
187
|
- demo/views/admin/nodes/_page_c.html.erb
|