noodall-ui 0.0.13 → 0.0.14

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.13)
4
+ noodall-ui (0.0.14)
5
5
  dynamic_form
6
6
  noodall-core
7
7
  thoughtbot-sortable_table (= 0.0.6)
@@ -6,7 +6,8 @@ module Noodall
6
6
  render :status => 404 if params[:type].blank?
7
7
 
8
8
  # TODO: check for an incorrect object class name passed in
9
- component_class = params[:type].classify.constantize
9
+
10
+ component_class = params[:type].camelize.constantize
10
11
  component = component_class.new
11
12
  if component.respond_to?(:contents)
12
13
  component.contents.reject!{|c| c.asset_id.blank? }
@@ -32,23 +32,12 @@ module Noodall
32
32
  end
33
33
  end
34
34
  match 'assets/:asset_type/tags' => 'assets#tags', :as => :asset_tags
35
+
35
36
  match 'components/form/:type' => 'components#form'
36
37
 
37
- resources :forms, :has_many => :form_responses
38
-
39
- resources :fields do
40
- collection do
41
- get :form
42
- end
43
- end
44
-
45
- match 'components/form/:type' => 'components#form'
46
-
47
38
  resources :groups
48
39
  end
49
40
 
50
- resources :forms, :has_many => :responses
51
-
52
41
  get "search" => "noodall/nodes#search", :as => :noodall_search
53
42
  get "sitemap" => "noodall/nodes#sitemap", :as => :noodall_sitemap
54
43
  get "*permalink(.:format)" => 'noodall/nodes#show', :as => :node_permalink
@@ -1,5 +1,5 @@
1
1
  module Noodall
2
2
  module UI
3
- VERSION = "0.0.13"
3
+ VERSION = "0.0.14"
4
4
  end
5
5
  end
@@ -278,6 +278,9 @@ var Component = {
278
278
  file_form.prepend(Browser.assets_to_add_html[asset_id]);
279
279
  file_form.find('.asset_id').val(asset_id);
280
280
  Component.slot_form.find('.multi-file-files ol li:last').before(file_form); // Before the last as the last is the hidden emtpty
281
+ // enable all form fields
282
+ file_form.find('input').removeAttr('disabled');
283
+ file_form.find('textarea').removeAttr('disabled');
281
284
  file_form.show();
282
285
  // Hide the file details elements
283
286
  Component.slot_form.find('li.multi-file .file-form').hide();
@@ -369,7 +369,8 @@ span.delete,
369
369
  a.show,
370
370
  a.child,
371
371
  a.add,
372
- a.download {
372
+ a.download,
373
+ a.spam,span.spam {
373
374
  width:26px;
374
375
  height:26px;
375
376
  display:block;
@@ -378,7 +379,8 @@ a.download {
378
379
 
379
380
  a.delete,
380
381
  a.show,
381
- a.download {
382
+ a.download,
383
+ a.spam,span.spam {
382
384
  margin:auto;
383
385
  }
384
386
 
@@ -364,6 +364,9 @@ a.edit, span.edit {
364
364
  a.delete, span.delete {
365
365
  background:url(/images/admin/delete.png) no-repeat -1px -4px;
366
366
  }
367
+ a.spam, span.spam {
368
+ background:url(/images/admin/spam.png) no-repeat -1px -4px;
369
+ }
367
370
  a.download {
368
371
  background:url(/images/admin/download.png) no-repeat -1px -4px;
369
372
  }
@@ -404,7 +407,8 @@ a.page_up:hover,
404
407
  a.page_down:hover,
405
408
  a.child:hover,
406
409
  a.add:hover,
407
- a.download:hover
410
+ a.download:hover,
411
+ a.spam:hover
408
412
  {
409
413
  background-position: -1px -36px;
410
414
  }
@@ -636,7 +640,8 @@ a.child,
636
640
  ul.choices li a,
637
641
  a.download,
638
642
  .edit-item,
639
- a.change {
643
+ a.change,
644
+ a.spam, span.spam {
640
645
  overflow: hidden;
641
646
  text-align: left;
642
647
  display: block;
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: 5
4
+ hash: 3
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 13
10
- version: 0.0.13
9
+ - 14
10
+ version: 0.0.14
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-29 00:00:00 +00:00
18
+ date: 2010-12-03 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -219,22 +219,6 @@ files:
219
219
  - features/support/logo.png
220
220
  - features/support/paths.rb
221
221
  - features/support/sevenfeatures.rb
222
- - generators/component/USAGE
223
- - generators/component/component_generator.rb
224
- - generators/component/lib/insert_commands.rb
225
- - generators/component/templates/admin_template.html.erb
226
- - generators/component/templates/factory.rb
227
- - generators/component/templates/model.rb
228
- - generators/component/templates/template.html.erb
229
- - generators/node/USAGE
230
- - generators/node/lib/insert_commands.rb
231
- - generators/node/node_generator.rb
232
- - generators/node/templates/admin_template.html.erb
233
- - generators/node/templates/factory.rb
234
- - generators/node/templates/model.rb
235
- - generators/node/templates/template.html.erb
236
- - generators/node_features/USAGE
237
- - generators/node_features/node_features_generator.rb
238
222
  - lib/generators/noodall/component/USAGE
239
223
  - lib/generators/noodall/component/component_generator.rb
240
224
  - lib/generators/noodall/component/templates/admin_template.html.erb
@@ -1,8 +0,0 @@
1
- Description:
2
- Explain the generator
3
-
4
- Example:
5
- ./script/generate node Thing
6
-
7
- This will create:
8
- what/will/it/create
@@ -1,35 +0,0 @@
1
- class ComponentGenerator < ScaffoldGenerator
2
-
3
- def manifest
4
- record do |m|
5
- # Check for class naming collisions.
6
- m.class_collisions(class_name)
7
-
8
- # Controller, views, test and stylesheets directories.
9
- m.directory(File.join('spec','factories'))
10
- m.directory(File.join('app','views','components'))
11
- m.directory(File.join('app','views','admin','components'))
12
-
13
- m.template(
14
- "model.rb",
15
- File.join('app','models',"#{controller_file_name.singularize}.rb")
16
- )
17
-
18
- m.template(
19
- "template.html.erb",
20
- File.join('app','views','components', "#{controller_file_name.singularize}.html.erb")
21
- )
22
-
23
- m.template(
24
- "admin_template.html.erb",
25
- File.join('app','views','admin','components', "_#{controller_file_name.singularize}.html.erb")
26
- )
27
-
28
- m.template(
29
- "factory.rb",
30
- File.join('spec','factories',"#{controller_file_name.singularize}.rb")
31
- )
32
- end
33
- end
34
-
35
- end
@@ -1,61 +0,0 @@
1
- # Mostly pinched from http://github.com/ryanb/nifty-generators/tree/master
2
- Rails::Generator::Commands::Base.class_eval do
3
- def file_contains?(relative_destination, line)
4
- File.read(destination_path(relative_destination)).include?(line)
5
- end
6
- end
7
-
8
- Rails::Generator::Commands::Create.class_eval do
9
-
10
- def route_resources_to_namespace(namespace, resource_list)
11
- sentinel = 'ActionController::Routing::Routes.draw do |map|'
12
-
13
- namespace_map = "map.namespace(:#{namespace}) do |#{namespace}|"
14
- logger.route namespace_map
15
- unless options[:pretend] || file_contains?('config/routes.rb', namespace_map)
16
- gsub_file 'config/routes.rb', /(#{Regexp.escape(sentinel)})/mi do |match|
17
- "#{match}\n #{namespace_map}\n end"
18
- end
19
- end
20
-
21
- namespace_route = "#{namespace}.resources :#{resource_list}"
22
-
23
- logger.route namespace_route
24
- unless options[:pretend] || file_contains?('config/routes.rb', namespace_route)
25
- gsub_file 'config/routes.rb', /(#{Regexp.escape(namespace_map)})/mi do |match|
26
- "#{match}\n #{namespace_route}"
27
- end
28
- end
29
- end
30
-
31
- end
32
-
33
- Rails::Generator::Commands::Destroy.class_eval do
34
-
35
- def route_resources_to_namespace(namespace, resource_list)
36
- # do ni
37
- end
38
-
39
- def insert_into(file, line)
40
- logger.remove "#{line} from #{file}"
41
- unless options[:pretend]
42
- gsub_file file, "\n #{line}", ''
43
- end
44
- end
45
-
46
- end
47
-
48
- Rails::Generator::Commands::List.class_eval do
49
-
50
- def route_resources_to_namespace(namespace, resource_list)
51
- namespace_map = "map.namespace(:#{namespace}) do |#{namespace}|"
52
- logger.route namespace_map
53
- namespace_route = "#{namespace}.resources :#{resource_list}"
54
- logger.route namespace_route
55
- end
56
-
57
- def insert_into(file, line)
58
- logger.insert "#{line} into #{file}"
59
- end
60
-
61
- end
@@ -1,50 +0,0 @@
1
- <% for attribute in attributes -%>
2
- <p>
3
- <span class="tooltip" title="Enter a<%= 'n' if ['a','e','i','o','u'].include?(attribute.name.downcase[0]) %> <%= attribute.name %>">&nbsp;</span>
4
- <%%= f.label :<%= attribute.name %> %><br/>
5
- <span class="input-wrap"><%%= f.<%= attribute.field_type %> :<%= attribute.name %> %></span>
6
- </p>
7
- <% end -%>
8
-
9
- <%%= render :partial => 'noodall/body', :locals => { :f => f } %>
10
- <%% content_for :component_table do %>
11
- <table class="component-table">
12
- <tr>
13
- <td rowspan="2" class="content"></td>
14
- <td colspan="2" rowspan="4" class="content"></td>
15
- <td><a href="#small_component_form_0" class="slot_link">4</a></td>
16
- </tr>
17
- <tr>
18
- <td><a href="#small_component_form_1" class="slot_link">5</a></td>
19
- </tr>
20
- <tr>
21
- <td></td>
22
- <td><a href="#small_component_form_2" class="slot_link">6</a></td>
23
- </tr>
24
- <tr>
25
- <td></td>
26
- <td><a href="#small_component_form_3" class="slot_link">7</a></td>
27
- </tr>
28
- <tr>
29
- <td></td>
30
- <td colspan="2"><a href="#wide_component_form_0" class="slot_link">1</a></td>
31
- <td></td>
32
- </tr>
33
- <tr>
34
- <td></td>
35
- <td colspan="2"><a href="#wide_component_form_1" class="slot_link">2</a></td>
36
- <td></td>
37
- </tr>
38
- <tr>
39
- <td></td>
40
- <td colspan="2"><a href="#wide_component_form_2" class="slot_link">3</a></td>
41
- <td></td>
42
- </tr>
43
- <tr>
44
- <td></td>
45
- <td></td>
46
- <td></td>
47
- <td></td>
48
- </tr>
49
- </table>
50
- <%% end -%>
@@ -1,5 +0,0 @@
1
- Factory.define :<%= singular_name %>, :parent => :node, :class => <%= singular_name.titleize %> do |<%= singular_name %>|
2
- <% for attribute in attributes -%>
3
- <%= singular_name %>.<%= attribute.name %> {Faker::Lorem.words(5).join(' ').titleize}
4
- <% end -%>
5
- end
@@ -1,8 +0,0 @@
1
- class <%= singular_name.camelize %> < Noodall::Node
2
- # sub_templates <%= singular_name.camelize %>
3
- # root_template!
4
-
5
- # small_slots 4
6
-
7
-
8
- end
@@ -1,41 +0,0 @@
1
- <%% content_for 'head' do %>
2
- <%%= auto_discovery_link_tag :rss, node_path(@node.parent, :format => 'rss') unless @node.parent.nil? %>
3
- <%% end %>
4
-
5
- <div id="main-content"<%%= ' class="no-nav"' unless node_has_nav? %>>
6
-
7
- <h1><%%=h @node.title %></h1>
8
-
9
- <%%= link_to 'RSS', node_path(@node.parent, :format => 'rss'), :class => 'rss-logo', :title => 'Click and copy this url into your feed reader.' unless @node.parent.nil? %>
10
-
11
- <div id="body"><%%= @node.body %></div>
12
-
13
-
14
- <% unless attributes.empty? %>
15
- <dl>
16
- <% for attribute in attributes -%>
17
- <dt><%= attribute.name.titleize %></dt>
18
- <dd><%%= @node.<% attribute.name %>%></dd>
19
- <% end -%>
20
- </dl>
21
- <% end -%>
22
-
23
-
24
- <div id="related" class="component"><%%= related_content(@node, [@node.class.name], {:limit => 3}) %></div>
25
-
26
- <%%= component(@node, 'small_slot_0') %>
27
- <%%= component(@node, 'small_slot_1') %>
28
- <%%= component(@node, 'small_slot_2') %>
29
- <%%= component(@node, 'small_slot_3') %>
30
-
31
- <%%= component(@node, 'wide_slot_0') %>
32
- <%%= component(@node, 'wide_slot_1') %>
33
- <%%= component(@node, 'wide_slot_2') %>
34
-
35
- </div>
36
-
37
- <%% if node_has_nav? -%>
38
- <div id="supporting-content">
39
- <%%= node_nav %>
40
- </div>
41
- <%% end -%>
@@ -1,8 +0,0 @@
1
- Description:
2
- Explain the generator
3
-
4
- Example:
5
- ./script/generate node Thing
6
-
7
- This will create:
8
- what/will/it/create
@@ -1,47 +0,0 @@
1
- # Mostly pinched from http://github.com/ryanb/nifty-generators/tree/master
2
- Rails::Generator::Commands::Base.class_eval do
3
- def file_contains?(relative_destination, line)
4
- File.read(destination_path(relative_destination)).include?(line)
5
- end
6
- end
7
-
8
- Rails::Generator::Commands::Create.class_eval do
9
-
10
- def press_any_key(read_me="Where's the any key?")
11
- puts read_me
12
- gets
13
- end
14
-
15
- def insert_into(file, line)
16
- logger.insert "#{line} into #{file}"
17
- unless options[:pretend] || file_contains?(file, line)
18
- gsub_file file, /^(class|module) .+$/ do |match|
19
- "#{match}\n #{line}"
20
- end
21
- end
22
- end
23
-
24
- end
25
-
26
- Rails::Generator::Commands::Destroy.class_eval do
27
-
28
- def press_any_key
29
- # do ni
30
- end
31
-
32
- def insert_into(file, line)
33
- logger.remove "#{line} from #{file}"
34
- unless options[:pretend]
35
- gsub_file file, "\n #{line}", ''
36
- end
37
- end
38
-
39
- end
40
-
41
- Rails::Generator::Commands::List.class_eval do
42
-
43
- def insert_into(file, line)
44
- logger.insert "#{line} into #{file}"
45
- end
46
-
47
- end
@@ -1,35 +0,0 @@
1
- class NodeGenerator < ScaffoldGenerator
2
-
3
- def manifest
4
- record do |m|
5
- # Check for class naming collisions.
6
- m.class_collisions(class_name)
7
-
8
- # Controller, views, test and stylesheets directories.
9
- m.directory(File.join('spec','factories'))
10
- m.directory(File.join('app','views','nodes'))
11
- m.directory(File.join('app','views','admin','nodes'))
12
-
13
- m.template(
14
- "model.rb",
15
- File.join('app','models',"#{controller_file_name.singularize}.rb")
16
- )
17
-
18
- m.template(
19
- "template.html.erb",
20
- File.join('app','views','nodes', "#{controller_file_name.singularize}.html.erb")
21
- )
22
-
23
- m.template(
24
- "admin_template.html.erb",
25
- File.join('app','views','admin','nodes', "_#{controller_file_name.singularize}.html.erb")
26
- )
27
-
28
- m.template(
29
- "factory.rb",
30
- File.join('spec','factories',"#{controller_file_name.singularize}.rb")
31
- )
32
- end
33
- end
34
-
35
- end
@@ -1,49 +0,0 @@
1
- <% for attribute in attributes -%>
2
- <p>
3
- <span class="tooltip" title="Enter a<%= 'n' if ['a','e','i','o','u'].include?(attribute.name.downcase[0]) %> <%= attribute.name %>">&nbsp;</span>
4
- <%%= f.label :<%= attribute.name %> %><br/>
5
- <span class="input-wrap"><%%= f.<%= attribute.field_type %> :<%= attribute.name %> %></span>
6
- </p>
7
- <% end -%>
8
- <%%= render :partial => 'noodall/body', :locals => { :f => f } %>
9
- <%% content_for :component_table do %>
10
- <table class="component-table">
11
- <tr>
12
- <td rowspan="2" class="content"></td>
13
- <td colspan="2" rowspan="4" class="content"></td>
14
- <td><a href="#small_component_form_0" class="slot_link">4</a></td>
15
- </tr>
16
- <tr>
17
- <td><a href="#small_component_form_1" class="slot_link">5</a></td>
18
- </tr>
19
- <tr>
20
- <td></td>
21
- <td><a href="#small_component_form_2" class="slot_link">6</a></td>
22
- </tr>
23
- <tr>
24
- <td></td>
25
- <td><a href="#small_component_form_3" class="slot_link">7</a></td>
26
- </tr>
27
- <tr>
28
- <td></td>
29
- <td colspan="2"><a href="#wide_component_form_0" class="slot_link">1</a></td>
30
- <td></td>
31
- </tr>
32
- <tr>
33
- <td></td>
34
- <td colspan="2"><a href="#wide_component_form_1" class="slot_link">2</a></td>
35
- <td></td>
36
- </tr>
37
- <tr>
38
- <td></td>
39
- <td colspan="2"><a href="#wide_component_form_2" class="slot_link">3</a></td>
40
- <td></td>
41
- </tr>
42
- <tr>
43
- <td></td>
44
- <td></td>
45
- <td></td>
46
- <td></td>
47
- </tr>
48
- </table>
49
- <%% end -%>
@@ -1,5 +0,0 @@
1
- Factory.define :<%= singular_name %>, :parent => :node, :class => <%= singular_name.camelize %> do |<%= singular_name %>|
2
- <% for attribute in attributes -%>
3
- <%= singular_name %>.<%= attribute.name %> {Faker::Lorem.words(5).join(' ').titleize}
4
- <% end -%>
5
- end
@@ -1,11 +0,0 @@
1
- class <%= singular_name.camelize %> < Noodall::Node
2
- # sub_templates <%= singular_name.camelize %>
3
- # root_template!
4
-
5
- # small_slots 4
6
-
7
-
8
- <% for attribute in attributes -%>
9
- key :<%= attribute.name %>
10
- <% end -%>
11
- end
@@ -1,41 +0,0 @@
1
- <%% content_for 'head' do %>
2
- <%%= auto_discovery_link_tag :rss, node_path(@node.parent, :format => 'rss') unless @node.parent.nil? %>
3
- <%% end %>
4
-
5
- <div id="main-content"<%%= ' class="no-nav"' unless node_has_nav? %>>
6
-
7
- <h1><%%=h @node.title %></h1>
8
-
9
- <%%= link_to 'RSS', node_path(@node.parent, :format => 'rss'), :class => 'rss-logo', :title => 'Click and copy this url into your feed reader.' unless @node.parent.nil? %>
10
-
11
- <div id="body"><%%= @node.body %></div>
12
-
13
-
14
- <% unless attributes.empty? %>
15
- <dl>
16
- <% for attribute in attributes -%>
17
- <dt><%= attribute.name.titleize %></dt>
18
- <dd><%%= @node.<% attribute.name %>%></dd>
19
- <% end -%>
20
- </dl>
21
- <% end -%>
22
-
23
-
24
- <div id="related" class="component"><%%= related_content(@node, [@node.class.name], {:limit => 3}) %></div>
25
-
26
- <%%= component(@node, 'small_slot_0') %>
27
- <%%= component(@node, 'small_slot_1') %>
28
- <%%= component(@node, 'small_slot_2') %>
29
- <%%= component(@node, 'small_slot_3') %>
30
-
31
- <%%= component(@node, 'wide_slot_0') %>
32
- <%%= component(@node, 'wide_slot_1') %>
33
- <%%= component(@node, 'wide_slot_2') %>
34
-
35
- </div>
36
-
37
- <%% if node_has_nav? -%>
38
- <div id="supporting-content">
39
- <%%= node_nav %>
40
- </div>
41
- <%% end -%>
@@ -1,8 +0,0 @@
1
- Description:
2
- Explain the generator
3
-
4
- Example:
5
- ./script/generate node Thing
6
-
7
- This will create:
8
- what/will/it/create
@@ -1,16 +0,0 @@
1
- class NodeFeaturesGenerator < ScaffoldGenerator
2
-
3
- def manifest
4
- record do |m|
5
- # Check for class naming collisions.
6
- m.class_collisions(class_name)
7
-
8
- # Controller, views, test and stylesheets directories.
9
- m.directory(File.join('spec','factories'))
10
- m.directory(File.join('features'))
11
-
12
- m.file('../features', 'features')
13
- end
14
- end
15
-
16
- end