togo 0.4.1 → 0.6.0
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/README.md +210 -0
- data/lib/togo/admin/admin.rb +6 -25
- data/lib/togo/admin/helpers.rb +57 -0
- data/lib/togo/admin/public/css/screen.css +329 -190
- data/lib/togo/admin/public/img/arrow-down.png +0 -0
- data/lib/togo/admin/public/img/arrows.png +0 -0
- data/lib/togo/admin/public/img/bg-header.png +0 -0
- data/lib/togo/admin/public/img/button-bg-delete.png +0 -0
- data/lib/togo/admin/public/img/button-bg-save.png +0 -0
- data/lib/togo/admin/public/img/footer-bg.png +0 -0
- data/lib/togo/admin/public/img/subhead-bg.png +0 -0
- data/lib/togo/admin/public/js/edit.js +23 -24
- data/lib/togo/admin/public/js/index.js +3 -2
- data/lib/togo/admin/public/js/togo.js +46 -14
- data/lib/togo/admin/views/_paging.erb +14 -0
- data/lib/togo/admin/views/edit.erb +6 -9
- data/lib/togo/admin/views/index.erb +44 -44
- data/lib/togo/admin/views/layout.erb +14 -16
- data/lib/togo/admin/views/new.erb +5 -2
- data/lib/togo/model/model.rb +20 -38
- data/lib/togo/model/relationship_manager/many_to_one.rb +19 -0
- data/lib/togo/model/relationship_manager/one_to_many.rb +19 -0
- data/lib/togo/model/relationship_manager/relationship_manager.rb +40 -0
- data/lib/togo/model/types/belongs_to.erb +42 -40
- data/lib/togo/model/types/has_n.erb +44 -42
- data/lib/togo/model/types/many_to_many.erb +44 -42
- metadata +17 -7
- data/README +0 -29
@@ -5,51 +5,53 @@
|
|
5
5
|
<input type="hidden" name="related_<%= property.name %>" class="related_ids" value="unset" />
|
6
6
|
<label for="<%= property.name %>"><%= related_model.display_name %></label>
|
7
7
|
<div class="search" id="search-<%= related_model.name %>">
|
8
|
-
<input type="text" name="search-<%= property.name %>" value="Search..." />
|
9
8
|
<div class="paging">
|
10
|
-
|
11
|
-
<
|
9
|
+
<input type="text" name="search-<%= property.name %>" value="Search..." />
|
10
|
+
Page <span class="page-number">1</span> of <span class="page-count"><%= (content_count/10).ceil %></span> /
|
11
|
+
<a href="#" rel="prev">Previous</a> <a href="#" rel="next">Next</a>
|
12
12
|
</div>
|
13
13
|
</div>
|
14
|
-
<table>
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
</
|
14
|
+
<div class="list-table-wrapper">
|
15
|
+
<table cellspacing="0">
|
16
|
+
<thead>
|
17
|
+
<tr>
|
18
|
+
<th class="checkbox"> </th>
|
19
|
+
<% related_model.get_list_properties.each do |p| %>
|
20
|
+
<th><%= p.name.to_s.humanize.titleize %></th>
|
21
|
+
<% end %>
|
22
|
+
</tr>
|
23
|
+
</thead>
|
24
|
+
<tfoot>
|
25
|
+
<tr>
|
26
|
+
<td class="checkbox"></td>
|
27
|
+
<td>
|
28
|
+
<span class="associated-count-display" style="<%= (content_count == 0 or content_count < 10) ? 'display: none;' : '' %>">
|
29
|
+
...and <span class="associated-count"><%= content_count-related_content.size %></span> more associated items
|
30
|
+
</span>
|
31
|
+
</td>
|
32
|
+
<td colspan="<%= related_model.get_list_properties.size-1 %>">
|
33
|
+
<button class="association-modify">Modify</button>
|
34
|
+
</td>
|
35
|
+
</tr>
|
36
|
+
</tfoot>
|
37
|
+
<tbody>
|
38
|
+
<% if related_content.empty? %>
|
39
|
+
<tr>
|
40
|
+
<td colspan="<%= related_model.get_list_properties.size %>">No Content Associated.</td>
|
41
|
+
</tr>
|
42
|
+
<% else %>
|
43
|
+
<% related_content.each do |c| %>
|
44
|
+
<tr>
|
45
|
+
<td class="checkbox"><input type="checkbox" name="selection[<%= c.id %>]" value="<%= c.id %>" id="selection_<%= related_model.name %>_<%= c.id %>" checked="checked" /></td>
|
46
|
+
<% related_model.get_list_properties.each_with_index do |p,i| %>
|
47
|
+
<td><% if i == 0 %><a href="/edit/<%= related_model.name %>/<%= c.id %>"><%= c.send(p.name.to_sym) || '-' %></a><% else %><%= c.send(p.name.to_sym) %><% end %></td>
|
48
|
+
<% end %>
|
49
|
+
</tr>
|
50
|
+
<% end %>
|
51
|
+
<% end %>
|
52
|
+
</tbody>
|
53
|
+
</table>
|
54
|
+
</div>
|
53
55
|
<script type="text/javascript">
|
54
56
|
new AssociationManager({
|
55
57
|
relationship: 'has_n',
|
@@ -5,51 +5,53 @@
|
|
5
5
|
<input type="hidden" name="related_<%= property.name %>" class="related_ids" value="unset" />
|
6
6
|
<label for="<%= property.name %>"><%= related_model.display_name %></label>
|
7
7
|
<div class="search" id="search-<%= related_model.name %>">
|
8
|
-
<input type="text" name="search-<%= property.name %>" value="Search..." />
|
9
8
|
<div class="paging">
|
10
|
-
|
11
|
-
<
|
9
|
+
<input type="text" name="search-<%= property.name %>" value="Search..." />
|
10
|
+
Page <span class="page-number">1</span> of <span class="page-count"><%= (content_count/10).ceil %></span> /
|
11
|
+
<a href="#" rel="prev">Previous</a> <a href="#" rel="next">Next</a>
|
12
12
|
</div>
|
13
13
|
</div>
|
14
|
-
<table>
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
</
|
14
|
+
<div class="list-table-wrapper">
|
15
|
+
<table cellspacing="0">
|
16
|
+
<thead>
|
17
|
+
<tr>
|
18
|
+
<th class="checkbox"> </th>
|
19
|
+
<% related_model.get_list_properties.each do |p| %>
|
20
|
+
<th><%= p.name.to_s.humanize.titleize %></th>
|
21
|
+
<% end %>
|
22
|
+
</tr>
|
23
|
+
</thead>
|
24
|
+
<tfoot>
|
25
|
+
<tr>
|
26
|
+
<td class="checkbox"></td>
|
27
|
+
<td>
|
28
|
+
<span class="associated-count-display" style="<%= (content_count == 0 or content_count < 10) ? 'display: none;' : '' %>">
|
29
|
+
...and <span class="associated-count"><%= content_count-related_content.size %></span> more associated items
|
30
|
+
</span>
|
31
|
+
</td>
|
32
|
+
<td colspan="<%= related_model.get_list_properties.size-1 %>">
|
33
|
+
<button class="association-modify">Modify</button>
|
34
|
+
</td>
|
35
|
+
</tr>
|
36
|
+
</tfoot>
|
37
|
+
<tbody>
|
38
|
+
<% if related_content.empty? %>
|
39
|
+
<tr>
|
40
|
+
<td colspan="<%= related_model.get_list_properties.size %>">No Content Associated.</td>
|
41
|
+
</tr>
|
42
|
+
<% else %>
|
43
|
+
<% related_content.each do |c| %>
|
44
|
+
<tr>
|
45
|
+
<td class="checkbox"><input type="checkbox" name="selection[<%= c.id %>]" value="<%= c.id %>" id="selection_<%= related_model.name %>_<%= c.id %>" checked="checked" /></td>
|
46
|
+
<% related_model.get_list_properties.each_with_index do |p,i| %>
|
47
|
+
<td><% if i == 0 %><a href="/edit/<%= related_model.name %>/<%= c.id %>"><%= c.send(p.name.to_sym) || '-' %></a><% else %><%= c.send(p.name.to_sym) %><% end %></td>
|
48
|
+
<% end %>
|
49
|
+
</tr>
|
50
|
+
<% end %>
|
51
|
+
<% end %>
|
52
|
+
</tbody>
|
53
|
+
</table>
|
54
|
+
</div>
|
53
55
|
<script type="text/javascript">
|
54
56
|
new AssociationManager({
|
55
57
|
relationship: 'many_to_many',
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: togo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 6
|
9
|
+
- 0
|
10
|
+
version: 0.6.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matt King
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-11-15 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -51,7 +51,7 @@ dependencies:
|
|
51
51
|
type: :runtime
|
52
52
|
version_requirements: *id002
|
53
53
|
description: With a few lines of code in your Ruby ORMs, you get a highly configurable and extensive content administration tool.
|
54
|
-
email: matt@
|
54
|
+
email: matt@mking.me
|
55
55
|
executables:
|
56
56
|
- togo-admin
|
57
57
|
extensions: []
|
@@ -59,21 +59,28 @@ extensions: []
|
|
59
59
|
extra_rdoc_files: []
|
60
60
|
|
61
61
|
files:
|
62
|
-
- README
|
62
|
+
- README.md
|
63
63
|
- Changelog
|
64
64
|
- LICENSE
|
65
65
|
- lib/togo/admin/admin.rb
|
66
66
|
- lib/togo/admin/helpers.rb
|
67
67
|
- lib/togo/admin/public/css/screen.css
|
68
|
+
- lib/togo/admin/public/img/arrow-down.png
|
69
|
+
- lib/togo/admin/public/img/arrows.png
|
68
70
|
- lib/togo/admin/public/img/bg-header.png
|
69
71
|
- lib/togo/admin/public/img/bg-headline.png
|
70
72
|
- lib/togo/admin/public/img/bg-nav.png
|
71
73
|
- lib/togo/admin/public/img/bg-side.png
|
72
74
|
- lib/togo/admin/public/img/btn-bg.gif
|
73
75
|
- lib/togo/admin/public/img/btn-bg.png
|
76
|
+
- lib/togo/admin/public/img/button-bg-delete.png
|
77
|
+
- lib/togo/admin/public/img/button-bg-save.png
|
78
|
+
- lib/togo/admin/public/img/footer-bg.png
|
79
|
+
- lib/togo/admin/public/img/subhead-bg.png
|
74
80
|
- lib/togo/admin/public/js/edit.js
|
75
81
|
- lib/togo/admin/public/js/index.js
|
76
82
|
- lib/togo/admin/public/js/togo.js
|
83
|
+
- lib/togo/admin/views/_paging.erb
|
77
84
|
- lib/togo/admin/views/custom_title.erb
|
78
85
|
- lib/togo/admin/views/edit.erb
|
79
86
|
- lib/togo/admin/views/index.erb
|
@@ -83,6 +90,9 @@ files:
|
|
83
90
|
- lib/togo/dispatch/dispatch.rb
|
84
91
|
- lib/togo/dispatch.rb
|
85
92
|
- lib/togo/model/model.rb
|
93
|
+
- lib/togo/model/relationship_manager/many_to_one.rb
|
94
|
+
- lib/togo/model/relationship_manager/one_to_many.rb
|
95
|
+
- lib/togo/model/relationship_manager/relationship_manager.rb
|
86
96
|
- lib/togo/model/types/belongs_to.erb
|
87
97
|
- lib/togo/model/types/boolean.erb
|
88
98
|
- lib/togo/model/types/datetime.erb
|
data/README
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
== Togo: Automatic Admin for Ruby ORMs
|
2
|
-
|
3
|
-
With just a few lines of code in your ORM classes, you get a full-featured content administration tool.
|
4
|
-
|
5
|
-
Quick example for DataMapper:
|
6
|
-
|
7
|
-
require 'togo'
|
8
|
-
|
9
|
-
class BlogEntry
|
10
|
-
|
11
|
-
include DataMapper::Resource
|
12
|
-
include Togo::DataMapper::Model
|
13
|
-
|
14
|
-
property :id, Serial
|
15
|
-
property :title, String
|
16
|
-
property :body, Text
|
17
|
-
property :published, Boolean
|
18
|
-
|
19
|
-
list_properties :title, :published
|
20
|
-
|
21
|
-
configure_property :published, :label => "Choose 'yes' to publish blog entry"
|
22
|
-
|
23
|
-
end
|
24
|
-
|
25
|
-
Go to your app with your models in a folder called "models", then run:
|
26
|
-
|
27
|
-
togo-admin
|
28
|
-
|
29
|
-
Current only works with DataMapper.
|