noodall-ui 0.1.6 → 0.1.8
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.
- data/app/controllers/noodall/admin/nodes_controller.rb +1 -1
- data/app/helpers/noodall/layout_helper.rb +1 -1
- data/app/views/noodall/admin/nodes/index.html.erb +1 -1
- data/app/views/noodall/admin/nodes/show.html.erb +84 -85
- data/features/step_definitions/groups_access_steps.rb +4 -4
- data/lib/noodall/engine.rb +10 -1
- data/lib/noodall/ui/version.rb +1 -1
- data/noodall-ui.gemspec +1 -1
- metadata +9 -7
@@ -116,7 +116,7 @@ module Noodall
|
|
116
116
|
flash[:notice] = "#{@node.class.name.titleize} '#{@node.title}' was successfully deleted."
|
117
117
|
|
118
118
|
respond_to do |format|
|
119
|
-
format.html { redirect_to(
|
119
|
+
format.html { redirect_to(@node.root? ? noodall_admin_nodes_path : noodall_admin_node_nodes_path(@node.parent)) }
|
120
120
|
format.xml { head :ok }
|
121
121
|
end
|
122
122
|
end
|
@@ -8,7 +8,7 @@ module Noodall::LayoutHelper
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def page_title
|
11
|
-
@page_title ||= controller.controller_name.titleize + (controller.action_name == 'index' ? " #{controller.action_name.titleize}"
|
11
|
+
@page_title ||= controller.controller_name.titleize + (controller.action_name == 'index' ? ' ' : " #{controller.action_name.titleize}" )
|
12
12
|
end
|
13
13
|
|
14
14
|
attr_reader :page_description, :page_keywords
|
@@ -50,7 +50,7 @@
|
|
50
50
|
<td class="date" title="by <%= node.updater.full_name if node.updater %>"><%=h node.updated_at.to_formatted_s(:short_ordinal) %></td>
|
51
51
|
<td class=""><%= link_to 'Show', node_path(node), :class => 'show', :title => 'View this content' if node.published? %></td>
|
52
52
|
<td class="date" title="<%= node.published? ? 'Published ':'Draft' %><%= node.published_at.to_formatted_s(:short_ordinal) unless node.published_at.nil? %><%= " - #{node.published_to.to_formatted_s(:short_ordinal)}" unless node.published_to.nil? %>"><%= (node.published? ? '<span class="check">Published</span>' : '<span class="draft">Draft</span>').html_safe %></td>
|
53
|
-
<td><%= link_to 'Delete', noodall_admin_node_path(node), :confirm => 'Are you sure?', :method => :delete, :class => 'delete', :title => 'Delete this content' %></td>
|
53
|
+
<td><%= link_to 'Delete', noodall_admin_node_path(node), :confirm => 'Are you sure?', :method => :delete, :class => 'delete', :title => 'Delete this content' unless node.in_site_map? %></td>
|
54
54
|
</tr>
|
55
55
|
<% end %>
|
56
56
|
</tbody>
|
@@ -7,40 +7,34 @@
|
|
7
7
|
<%= form_for(@node, :as => :node, :url => noodall_admin_node_path(@node), :html => {:method => :put, :id => "node-form"}) do |f| %>
|
8
8
|
<%= f.error_messages %>
|
9
9
|
|
10
|
-
<div id="main-form">
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
<span class="tooltip" title="Enter a custom url or leave it as the default value shown."> </span>
|
39
|
-
<%= f.label :permalink, 'Page Url' %><br/>
|
40
|
-
<span class="input-wrap"><%= f.text_field :permalink %></span>
|
41
|
-
</p>
|
42
|
-
|
43
|
-
</div>
|
10
|
+
<div id="main-form">
|
11
|
+
|
12
|
+
<p>
|
13
|
+
<span class="tooltip" title="Enter a title for this page (used in page headings and titles)"> </span>
|
14
|
+
<%= f.label :title, 'Title *' %><br/>
|
15
|
+
<span class="input-wrap"><%= f.text_field :title %></span>
|
16
|
+
</p>
|
17
|
+
<p>
|
18
|
+
<span class="tooltip" title="Enter a name for this page (used in links and navigation, defaults to title)"> </span>
|
19
|
+
<%= f.label :name %><br/>
|
20
|
+
<span class="input-wrap"><%= f.text_field :name %></span>
|
21
|
+
</p>
|
22
|
+
|
23
|
+
<%= render :partial => "admin/nodes/#{@node.class.name.underscore}", :locals => { :f => f } %>
|
24
|
+
|
25
|
+
<p>
|
26
|
+
<span class="tooltip" title="Enter a short summary of this content."> </span>
|
27
|
+
<%= f.label :description, "Short Description" %><br/>
|
28
|
+
<span class="input-wrap"><%= f.text_area :description, :class => 'description' %></span>
|
29
|
+
</p>
|
30
|
+
|
31
|
+
<p>
|
32
|
+
<span class="tooltip" title="Enter a comma seperated list of keywords to describe this content."website,launch,event""> </span>
|
33
|
+
<%= f.label :keywords, "Keywords" %><br/>
|
34
|
+
<span class="input-wrap"><%= f.text_field :keywords %></span>
|
35
|
+
</p>
|
36
|
+
|
37
|
+
</div>
|
44
38
|
|
45
39
|
<div class="fixed-form">
|
46
40
|
<div id="buttons">
|
@@ -49,74 +43,79 @@
|
|
49
43
|
<%= link_to 'Cancel', @node.root? ? noodall_admin_nodes_path : noodall_admin_node_nodes_path(@node.parent), :class => 'cancel' %>
|
50
44
|
</div>
|
51
45
|
|
52
|
-
<% if can_publish?(@node) %>
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
46
|
+
<% if can_publish?(@node) %>
|
47
|
+
<!-- Advanced Publishing Options -->
|
48
|
+
<div class="show-advanced">
|
49
|
+
<fieldset>
|
50
|
+
<legend class="advanced">Advanced</legend>
|
51
|
+
<div id="advanced">
|
52
|
+
<p class="published">
|
53
|
+
<%= f.label :published_at, "Publish at" %><br/>
|
54
|
+
<span class="input-wrap"><%= f.datetime_select :published_at, :include_blank => true %></span>
|
55
|
+
</p>
|
56
|
+
|
57
|
+
<p class="published">
|
58
|
+
<%= f.label :published_to, "Publish until" %><br/>
|
59
|
+
<%
|
60
|
+
# Remove select for far future dates
|
67
61
|
@node.published_to = nil unless @node.published_to.nil? or @node.published_to < 5.years.from_now
|
68
62
|
%>
|
69
|
-
|
70
|
-
|
71
|
-
|
63
|
+
<span class="input-wrap"><%= f.datetime_select :published_to, :include_blank => true %></span>
|
64
|
+
</p>
|
65
|
+
<% unless @node.in_site_map? %>
|
72
66
|
<p>
|
73
67
|
<span class="node-mover">Parent Content</span>
|
74
68
|
<span class="input-wrap" id="parent-title">
|
75
|
-
|
76
|
-
|
69
|
+
<%= @node.root? ? "Root" : @node.parent.title %>
|
70
|
+
<a href="#" class="edit-item">Edit</a>
|
77
71
|
</span>
|
78
72
|
<%= f.hidden_field :parent, :value => @node.parent_id %>
|
79
73
|
<%= hidden_field_tag :parent_types, @node.class.parent_classes.join(','), :disabled => true %>
|
80
74
|
</p>
|
75
|
+
<p>
|
76
|
+
<span class="tooltip" title="Enter a custom url or leave it as the default value shown."> </span>
|
77
|
+
<%= f.label :permalink, 'Page Url' %><br/>
|
78
|
+
<span class="input-wrap"><%= f.text_field :permalink %></span>
|
79
|
+
</p>
|
80
|
+
<% end %>
|
81
81
|
|
82
|
-
|
83
|
-
<% if current_user.admin? -%>
|
82
|
+
<% if current_user.admin? -%>
|
84
83
|
<fieldset>
|
85
84
|
<span class="tooltip" title="User Permissions"> </span>
|
86
85
|
<legend>User Permission</legend>
|
87
86
|
<span class="input-wrap">
|
88
87
|
<table>
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
88
|
+
<thead>
|
89
|
+
<tr>
|
90
|
+
<th width="85">Action</th>
|
91
|
+
<th width="90%">Groups</th>
|
92
|
+
</tr>
|
93
|
+
</thead>
|
94
|
+
<tbody>
|
95
|
+
<tr>
|
96
|
+
<th><%= f.label :updatable_groups_list, "Update" %></th>
|
97
|
+
<td><%= f.text_field :updatable_groups_list, :class => "groups-completer" %></td>
|
98
|
+
</tr>
|
99
|
+
<tr>
|
100
|
+
<th><%= f.label :publishable_groups_list, "Publish" %></th>
|
101
|
+
<td><%= f.text_field :publishable_groups_list, :class => "groups-completer" %></td>
|
102
|
+
</tr>
|
103
|
+
<tr>
|
104
|
+
<th><%= f.label :destroyable_groups_list, "Delete" %></th>
|
105
|
+
<td><%= f.text_field :destroyable_groups_list, :class => "groups-completer" %></td>
|
106
|
+
</tr>
|
107
|
+
<tr>
|
108
|
+
<th><%= f.label :viewable_groups_list, "View" %></th>
|
109
|
+
<td><%= f.text_field :viewable_groups_list, :class => "groups-completer" %></td>
|
110
|
+
</tr>
|
111
|
+
</tbody>
|
112
|
+
</table>
|
114
113
|
</span>
|
115
114
|
</fieldset>
|
116
|
-
<% end -%>
|
117
|
-
|
118
|
-
|
119
|
-
|
115
|
+
<% end -%>
|
116
|
+
</div>
|
117
|
+
</fieldset>
|
118
|
+
</div>
|
120
119
|
<% end -%>
|
121
120
|
</div>
|
122
121
|
|
@@ -5,10 +5,10 @@ Then /^I should be able to set the permissions on that content$/ do
|
|
5
5
|
fill_in "View", :with => "Us, Stuff"
|
6
6
|
click_button "Publish"
|
7
7
|
@_content.reload
|
8
|
-
@_content.updatable_groups.should == ['
|
9
|
-
@_content.destroyable_groups.should == ['
|
10
|
-
@_content.publishable_groups.should == ['
|
11
|
-
@_content.viewable_groups.should == ['
|
8
|
+
@_content.updatable_groups.should == ['them', 'us', 'things']
|
9
|
+
@_content.destroyable_groups.should == ['us', 'things', 'stuff']
|
10
|
+
@_content.publishable_groups.should == ['us', 'stuff']
|
11
|
+
@_content.viewable_groups.should == ['us', 'stuff']
|
12
12
|
end
|
13
13
|
|
14
14
|
Given(/^content's ([^\"]*) is set to "([^\"]*)" and "([^\"]*)"$/) do |permission, group1, group2|
|
data/lib/noodall/engine.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'dynamic_form'
|
2
|
-
require
|
2
|
+
require 'will_paginate'
|
3
|
+
require 'noodall/site'
|
3
4
|
|
4
5
|
module Noodall
|
5
6
|
class Engine < Rails::Engine
|
@@ -8,6 +9,14 @@ module Noodall
|
|
8
9
|
app.middleware.use ::ActionDispatch::Static, "#{root}/public"
|
9
10
|
end
|
10
11
|
|
12
|
+
initializer "load site map" do |app|
|
13
|
+
begin
|
14
|
+
Noodall::Site.map = YAML::load(File.open(File.join(Rails.root, 'config', 'sitemap.yml')))
|
15
|
+
rescue Exception => e
|
16
|
+
puts "Failed to load noodall site map: #{e}"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
11
20
|
end
|
12
21
|
end
|
13
22
|
|
data/lib/noodall/ui/version.rb
CHANGED
data/noodall-ui.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
|
|
14
14
|
|
15
15
|
s.required_rubygems_version = ">= 1.3.6"
|
16
16
|
|
17
|
-
s.add_dependency 'noodall-core', "
|
17
|
+
s.add_dependency 'noodall-core', "~> 0.4.3"
|
18
18
|
s.add_dependency 'thoughtbot-sortable_table', "= 0.0.6"
|
19
19
|
s.add_dependency 'will_paginate', "~> 3.0.pre2"
|
20
20
|
s.add_dependency 'dynamic_form', ">= 0"
|
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: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 8
|
10
|
+
version: 0.1.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Steve England
|
@@ -15,19 +15,21 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-01-
|
18
|
+
date: 2011-01-21 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
requirement: &id001 !ruby/object:Gem::Requirement
|
23
23
|
none: false
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - ~>
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
hash:
|
27
|
+
hash: 9
|
28
28
|
segments:
|
29
29
|
- 0
|
30
|
-
|
30
|
+
- 4
|
31
|
+
- 3
|
32
|
+
version: 0.4.3
|
31
33
|
name: noodall-core
|
32
34
|
prerelease: false
|
33
35
|
version_requirements: *id001
|