noodall-ui 0.5.13 → 0.5.14

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -4,7 +4,7 @@ source 'http://gems.github.com'
4
4
  gemspec
5
5
 
6
6
  # Required for running as demo rails app
7
- gem 'rails', '3.1.0'
7
+ gem 'rails', '~> 3.1.0'
8
8
  gem 'dragonfly', '~> 0.9.4'
9
9
  gem 'mm-versionable', '0.2.5'
10
10
 
@@ -29,7 +29,7 @@ group :development, :test do
29
29
  gem 'spork'
30
30
  gem 'launchy' # So you can do Then show me the page
31
31
  gem 'jeweler', '~> 1.4.0'
32
- gem 'factory_girl'
32
+ gem 'factory_girl', '~> 2.0'
33
33
  gem 'factory_girl_rails'
34
34
  gem "faker", "~> 0.3.1"
35
35
  gem "bson_ext"
@@ -206,6 +206,8 @@ $(document).ready(function() {
206
206
 
207
207
  // Add emptys div for browsers/preview
208
208
  $('body').append('<div style="display:none;"><div id="asset-browser"></div><div id="tree-browser"></div><div id="preview-pane"><iframe name="preview-frame" src="about:blank"/></div></div>');
209
+
210
+ $('#parent-title a.edit-item').fancybox();
209
211
  });
210
212
 
211
213
  function get_preview_html(e) {
@@ -526,36 +528,10 @@ $("li.multi-file span.delete").live("click", function(e) {
526
528
  });
527
529
 
528
530
  // Node mover and shaker
529
- $('span.node-mover, #parent-title').live('click', function(event) {
530
- node_id = $(this).closest('form').attr('action').split('/').pop();
531
- // open asset lightbox
532
- $.get("/admin/nodes/tree", {
533
- allowed_types: $('#parent_types').val().split(','),
534
- not_branch: node_id
535
- },
536
- function() {
537
- // reopen the opening form if you close this form
538
- $.fancybox({
539
- href: '#tree-browser',
540
- title: "Select a parent"
541
- });
542
- $('#tree-browser').attr('class', 'parent');
543
- $('#tree-browser .tree:first').append('<li><a id="id-none">Root</a></li>');
544
- },
545
- 'script');
546
-
547
- event.stopImmediatePropagation();
548
- return false;
549
- });
550
-
551
- $('#tree-browser ol.tree span.expand').live('click', function(e) {
552
- $(this).toggleClass('expanded').siblings('ol.tree').toggle();
553
- });
554
-
555
- $('#tree-browser.parent a').live('click', function(e) {
531
+ $('ol.tree a.parent').live('click', function(e) {
556
532
  id = this.id.replace('id-', '');
557
533
  $('#node_parent').val(id);
558
- $('#parent-title').html($(this).text() + '<a class="edit-item">Edit</a>');
534
+ $('#parent-title strong').html($(this).text());
559
535
  $.fancybox.close();
560
536
  return false;
561
537
  });
@@ -18,7 +18,7 @@ function setUpPlupload() {
18
18
  runtimes : 'html5,flash,gears,silverlight,html4',
19
19
  url : '/admin/assets/plupload',
20
20
  // max_file_size : '10mb',
21
- chunk_size : '1mb',
21
+ // chunk_size : '1mb',
22
22
  unique_names : false,
23
23
 
24
24
  // Use multipart
@@ -88,15 +88,11 @@ $.extend(tiny_mce_config, lite_tiny_mce_config, {
88
88
  tinyMCE.activeEditor.focus();
89
89
  tinyMCE.activeEditor.windowManager.bookmark = tinyMCE.activeEditor.selection.getBookmark();
90
90
  // open asset lightbox
91
- $.get("/admin/nodes/tree", function() {
92
- // reopen the opening form if you close this form
93
- $.fancybox({
94
- href: '#tree-browser',
95
- title: "Link to content"
96
- });
97
- $('#tree-browser').attr('class', 'tinymce');
98
- },
99
- 'script');
91
+ // reopen the opening form if you close this form
92
+ $.fancybox({
93
+ href: "/admin/nodes/tree?mode=link",
94
+ title: "Link to content"
95
+ });
100
96
  }
101
97
  });
102
98
 
@@ -112,7 +108,7 @@ $.extend(tiny_mce_config, lite_tiny_mce_config, {
112
108
 
113
109
  // wow what a hack: insert a containing span for the page name if nothing is selected,
114
110
  // then insert the link, then remove containing span after all is good
115
- $('#tree-browser.tinymce li a').live('click', function(event) {
111
+ $('ol.tree a.link').live('click', function(event) {
116
112
  add_url = $(this).attr('href').split('?')[0];
117
113
  tinyMCE.activeEditor.selection.moveToBookmark(tinyMCE.activeEditor.windowManager.bookmark);
118
114
 
@@ -670,9 +670,9 @@ table.component-table td a {
670
670
 
671
671
  /* --- tree ---- */
672
672
 
673
- #tree-browser {
673
+ ol.tree {
674
674
  width: 400px;
675
- height: 400px;
675
+ height: 300px;
676
676
  padding: 10px;
677
677
  }
678
678
 
@@ -321,7 +321,7 @@ ul.choices li a:hover {
321
321
 
322
322
  /* PAGINATION */
323
323
 
324
- .pagination a, #tree-browser a {
324
+ .pagination a, ol.tree a {
325
325
  color:#106bab;
326
326
  }
327
327
 
@@ -519,7 +519,7 @@ table#node_body_tbl,
519
519
  color:#D4954C;
520
520
  }
521
521
 
522
- #tree-browser span.expand {
522
+ ol.tree a.expand {
523
523
  background:#82b452;
524
524
  border:3px solid #548126;
525
525
  color: #fff;
@@ -613,7 +613,7 @@ table.component-table,
613
613
  border-radius: 5px;
614
614
  }
615
615
 
616
- #tree-browser span.expand {
616
+ ol.tree a.expand {
617
617
  -webkit-border-radius: 15px;
618
618
  -moz-border-radius: 15px;
619
619
  border-radius: 15px;
@@ -11,11 +11,6 @@ body, textarea {
11
11
 
12
12
  /* -------------- FONT SIZES -------------- */
13
13
 
14
- /* 10px */
15
- #tree-browser li li {
16
- font-size:1.0em;
17
- }
18
-
19
14
  /* 11px */
20
15
  ul#status li,
21
16
  label,
@@ -55,7 +50,7 @@ table#versions-list td,
55
50
  #no-tags h2,
56
51
  #sub-form ol#slot-list li,
57
52
  #fancybox-topnav h1,
58
- #tree-browser li {
53
+ ol.tree li {
59
54
  font-size:1.4em;
60
55
  }
61
56
 
@@ -114,7 +109,7 @@ legend,
114
109
  #errorExplanation,
115
110
  span.node-mover,
116
111
  div#flash a,
117
- #tree-browser span.expand {
112
+ ol.tree span.expand {
118
113
  font-weight: bold;
119
114
  }
120
115
 
@@ -7,14 +7,14 @@ module Noodall
7
7
  sortable_attributes :position, :admin_title, :title, :type, :updated_at
8
8
 
9
9
  def index
10
-
10
+
11
11
  if params[:node_id].nil?
12
12
  nodes = Node.roots
13
13
  else
14
14
  @parent = Node.find(params[:node_id])
15
15
  nodes = @parent.children
16
16
  end
17
-
17
+
18
18
  per_page = 15
19
19
  @nodes = nodes.where( :title => /#{params[:f]}/i ).paginate(:per_page => (params[:limit] || per_page), :page => params[:page], :order => sort_order(:default => "ascending") )
20
20
 
@@ -25,9 +25,14 @@ module Noodall
25
25
  end
26
26
 
27
27
  def tree
28
- @options = {}
28
+ if params[:id].nil?
29
+ @nodes = Node.roots
30
+ else
31
+ @parent = Node.find(params[:id])
32
+ @nodes = @parent.children
33
+ end
29
34
  respond_to do |format|
30
- format.html
35
+ format.html { render :layout => false }
31
36
  format.js
32
37
  end
33
38
  end
@@ -39,7 +39,7 @@ class Asset
39
39
  def url(*args)
40
40
  if args.blank?
41
41
  # Use the transparent url just the file is required with no processing
42
- file.url(:suffix => ".#{file_ext}")
42
+ file.url
43
43
  elsif video?
44
44
  file.encode(:tiff, { :offset => "#{video_thumbnail_offset}%" }).thumb(*args).url
45
45
  else
@@ -1,15 +1,22 @@
1
1
  <ol class="tree">
2
- <% for node in nodes %>
2
+ <% if @parent.nil? %>
3
+ <% if params[:mode] == 'parent' %>
4
+ <li><a id="id-none" class="<%= params[:mode] %>" href="/">Root</a></li>
5
+ <% end %>
6
+ <% elsif @parent.parent_id? %>
7
+ <li><%= link_to 'Up', tree_noodall_admin_node_path(@parent.parent_id, params), :class => 'expand' -%></li>
8
+ <% else %>
9
+ <li><%= link_to 'Up', tree_noodall_admin_nodes_path(params.reject{|k,v| k == 'id'}), :class => 'expand' -%></li>
10
+ <% end %>
11
+ <% for node in @nodes %>
3
12
  <li>
4
- <% if params[:allowed_types].nil? || ( params[:allowed_types].include?(node.class.to_s) && node.id.to_s != params[:not_branch] && !node.path.map(&:to_s).include?(params[:not_branch]) ) %>
5
- <%= link_to h(node.title), node_path(node), :id => "id-#{node.id}" %>
13
+ <% if params[:mode] == 'link' or ( params[:allowed_types] && params[:allowed_types].include?(node.class.to_s) && node.id.to_s != params[:not_branch] && !node.path.map(&:to_s).include?(params[:not_branch]) ) %>
14
+ <%= link_to h(node.title), node_path(node), :id => "id-#{node.id}", :class => params[:mode] %>
6
15
  <% else %>
7
16
  <%= node.title %>
8
17
  <% end %>
9
- <% unless (children = node.children.where(options)).empty? -%>
10
- <span class="expand">+</span>
11
- <%= render :partial => 'branch', :locals => { :nodes => children, :options => options } %>
12
- <% end -%>
18
+ <%= link_to '+', tree_noodall_admin_node_path(node, params), :class => 'expand' unless node.children.count.zero? -%>
13
19
  </li>
14
20
  <% end -%>
15
21
  </ol>
22
+ <%= javascript_tag "$('ol.tree li a.expand').fancybox()" %>
@@ -121,11 +121,18 @@
121
121
  <p>
122
122
  <span class="node-mover">Parent Content</span>
123
123
  <span class="input-wrap" id="parent-title">
124
- <%= @node.root? ? "Root" : @node.parent.title %>
125
- <a href="#" class="edit-item">Edit</a>
124
+ <strong><%= @node.root? ? "Root" : @node.parent.title %></strong>
125
+ <%= link_to 'Edit',
126
+ tree_noodall_admin_nodes_path(
127
+ :not_branch => @node.id,
128
+ :allowed_types => @node.class.parent_classes.join(','),
129
+ :mode => 'parent'
130
+ ),
131
+ :class => 'edit-item',
132
+ :title => 'Select a parent',
133
+ %>
126
134
  </span>
127
135
  <%= f.hidden_field :parent, :value => @node.parent_id %>
128
- <%= hidden_field_tag :parent_types, @node.class.parent_classes.join(','), :disabled => true %>
129
136
  </p>
130
137
 
131
138
  <!-- PAGE URL -->
@@ -1,3 +1 @@
1
- <h1>Tree</h1>
2
-
3
- <%= render :partial => 'branch', :locals => { :nodes => Noodall::Node.roots(@options), :options => @options } %>
1
+ <%= render :partial => 'branch' %>
@@ -1,2 +1,2 @@
1
- $('#tree-browser').html( "<%= escape_javascript(render :partial => 'branch', :locals => { :nodes => Noodall::Node.roots(@options), :options => @options }) %>" );
2
- $('#tree-browser ol.tree ol').hide();
1
+ $('#tree-browser').html( "<%= escape_javascript(render :partial => 'branch' ) %>" );
2
+ $('#tree-browser ol.tree ol').hide();
@@ -1,5 +1,5 @@
1
1
  @javascript
2
- Feature: Preview Content
2
+ Feature: Set content browser title
3
3
  In order to have a succinct page title, with a more descriptive browser title
4
4
  A website editor
5
5
  Will be able to set a separate browser title
@@ -11,7 +11,7 @@ Feature: Preview Content
11
11
  Then the content should be visible on the website
12
12
  And the title should be "Bacon Ipsum"
13
13
  And the browser title should be "Bacon Ipsum"
14
-
14
+
15
15
 
16
16
  Scenario: Set a browser title
17
17
  Given I am editing content
@@ -21,4 +21,4 @@ Feature: Preview Content
21
21
  And I press "Publish"
22
22
  And I follow "Show"
23
23
  Then the title should be "Bacon Ipsum"
24
- And the browser title should be "Ice Cream"
24
+ And the browser title should be "Ice Cream"
@@ -34,8 +34,8 @@ Then /^I should be able to browse assets by content type$/ do
34
34
  page.should_not have_content('Video asset')
35
35
  within(:css, "ul.choices") { click_link "Documents" }
36
36
  page.should_not have_content('Image asset')
37
- page.should_not have_content('Video asset')
38
37
  if Asset.video_extensions.any?
38
+ page.should_not have_content('Video asset')
39
39
  within(:css, "ul.choices") { click_link "Videos" }
40
40
  page.should_not have_content('Document asset')
41
41
  page.should_not have_content('Image asset')
@@ -1,5 +1,5 @@
1
1
  Given /^there is content that can be searched$/ do
2
- Given %q{the website has been populated with content based on the site map}
2
+ step %q{the website has been populated with content based on the site map}
3
3
  3.times do |i|
4
4
  Factory(:page_a, :title => "My Searchable Page #{i}", :publish => true)
5
5
  end
@@ -12,6 +12,7 @@ module Noodall
12
12
  get :change_template
13
13
  get :move_up
14
14
  get :move_down
15
+ get :tree
15
16
  post :preview
16
17
  end
17
18
  collection do
@@ -1,5 +1,5 @@
1
1
  module Noodall
2
2
  module UI
3
- VERSION = "0.5.13"
3
+ VERSION = "0.5.14"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: noodall-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.13
4
+ version: 0.5.14
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-15 00:00:00.000000000 Z
12
+ date: 2012-10-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: noodall-core
@@ -253,7 +253,6 @@ files:
253
253
  - config/cucumber.yml
254
254
  - config/routes.rb
255
255
  - features/change_templates.feature
256
- - features/choose_node_title.feature
257
256
  - features/content_templates.feature
258
257
  - features/group_access_control.feature
259
258
  - features/manage_assets.feature
@@ -266,6 +265,7 @@ files:
266
265
  - features/respond_with_correct_format.feature
267
266
  - features/save_draft.feature
268
267
  - features/search.feature
268
+ - features/set_content_browser_title.feature
269
269
  - features/sitemap.feature
270
270
  - features/sort_nodes_by_column.feature
271
271
  - features/step_definitions/asset_steps.rb
@@ -365,9 +365,6 @@ files:
365
365
  - spec/dummy/config/locales/en.yml
366
366
  - spec/dummy/config/routes.rb
367
367
  - spec/dummy/db/seeds.rb
368
- - spec/dummy/factories/asset.rb
369
- - spec/dummy/factories/node.rb
370
- - spec/dummy/factories/user.rb
371
368
  - spec/dummy/files/beef.png
372
369
  - spec/dummy/files/get_video.flv
373
370
  - spec/dummy/files/test.pdf
@@ -378,6 +375,9 @@ files:
378
375
  - spec/dummy/public/500.html
379
376
  - spec/dummy/public/favicon.ico
380
377
  - spec/dummy/script/rails
378
+ - spec/factories/asset.rb
379
+ - spec/factories/node.rb
380
+ - spec/factories/user.rb
381
381
  - vendor/assets/images/fancybox/blank.gif
382
382
  - vendor/assets/images/fancybox/fancy_close.png
383
383
  - vendor/assets/images/fancybox/fancy_loading.png
@@ -722,7 +722,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
722
722
  version: '0'
723
723
  segments:
724
724
  - 0
725
- hash: -3366708828992806581
725
+ hash: -3396913091192908078
726
726
  required_rubygems_version: !ruby/object:Gem::Requirement
727
727
  none: false
728
728
  requirements: