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 CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- noodall-ui (0.0.8)
4
+ noodall-ui (0.0.9)
5
5
  dynamic_form
6
6
  noodall-core
7
7
  thoughtbot-sortable_table (= 0.0.6)
@@ -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">&nbsp;</span>
124
124
 
125
125
  <%= yield :component_table %>
126
- <% if can_publish?(@node) and !@node.is_a?(Home) %>
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">
@@ -1,7 +1,7 @@
1
1
  class PageC < Noodall::Node
2
- sub_templates PageC, PageB
2
+ sub_templates PageB
3
3
  root_template!
4
-
4
+
5
5
  main_slots 1
6
6
  wide_slots 3
7
7
  end
@@ -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
@@ -15,4 +15,4 @@ Feature: Content Templates
15
15
  Examples:
16
16
  | Ancestor Template Name | Allowed Templates |
17
17
  | Page A | Page A, Page B, Page C |
18
- | Page C | Page C, Page B |
18
+ | Page C | Page B |
@@ -1,5 +1,5 @@
1
1
  module Noodall
2
2
  module UI
3
- VERSION = "0.0.8"
3
+ VERSION = "0.0.9"
4
4
  end
5
5
  end
@@ -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 : "",
@@ -664,7 +664,7 @@ span.expand {
664
664
  fieldset.template label img {
665
665
  left:520px;
666
666
  position:absolute;
667
- top:30px;
667
+ top:20px;
668
668
  }
669
669
 
670
670
  #current-label {
@@ -4,6 +4,9 @@ Factory.define :node do |node|
4
4
  node.published_at { Time.now }
5
5
  end
6
6
 
7
+ Factory.define :home, :parent => :node, :class => Home do |node|
8
+ end
9
+
7
10
  Factory.define :page_a, :parent => :node, :class => PageA do |node|
8
11
  end
9
12
 
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: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 8
10
- version: 0.0.8
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-12 00:00:00 +00:00
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