adva-categories 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,19 +1,21 @@
|
|
1
1
|
class Admin::Categories::Menu < Adva::View::Menu::Admin::Actions
|
2
2
|
include do
|
3
3
|
def main
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
parent_resource_label
|
5
|
+
index
|
6
|
+
edit_parent
|
7
7
|
end
|
8
8
|
|
9
9
|
def right
|
10
|
-
|
11
|
-
if
|
12
|
-
item(:'.destroy', resource_path, :method => :delete, :confirm => t(:'.confirm_destroy', :model_name => resource.class.model_name.human))
|
13
|
-
else
|
14
|
-
item(:'.reorder', show_parent_path, :class => 'reorder', :'data-resource_type' => parent_resource.class.name.underscore, :'data-sortable_type' => 'categories')
|
15
|
-
end
|
10
|
+
collection? ? new : destroy
|
11
|
+
reorder if index? # TODO should only happen if we actually have more than 1 category
|
16
12
|
end
|
13
|
+
|
14
|
+
protected
|
15
|
+
|
16
|
+
def reorder
|
17
|
+
super( :'data-resource_type' => 'section', :'data-sortable_type' => 'categories')
|
18
|
+
end
|
17
19
|
end
|
18
20
|
end
|
19
21
|
|
@@ -1,12 +1,13 @@
|
|
1
1
|
class Admin::Categories::Index < Minimal::Template
|
2
2
|
include do
|
3
3
|
def to_html
|
4
|
-
table_for collection do |t|
|
4
|
+
table_for collection, :class => 'categories list tree' do |t|
|
5
5
|
t.column :category, :actions
|
6
6
|
|
7
7
|
t.row do |r, category|
|
8
8
|
r.options[:id] = dom_id(category)
|
9
|
-
|
9
|
+
r.options[:class] = "level_#{category.level.to_i}"
|
10
|
+
r.cell capture { link_to_edit(category.name, category) }
|
10
11
|
r.cell links_to_actions([:edit, :destroy], category)
|
11
12
|
end
|
12
13
|
|
data/config/locales/en.yml
CHANGED
@@ -1,21 +1,23 @@
|
|
1
1
|
en:
|
2
|
+
menu:
|
3
|
+
categories: Categories
|
4
|
+
columns:
|
5
|
+
category: Category
|
6
|
+
actions:
|
2
7
|
categories:
|
3
8
|
columns:
|
4
9
|
category: Category
|
5
|
-
actions:
|
10
|
+
actions:
|
6
11
|
admin:
|
7
12
|
categories:
|
8
|
-
menu:
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
columns:
|
17
|
-
category: Category
|
18
|
-
actions:
|
13
|
+
# menu:
|
14
|
+
# index: Categories
|
15
|
+
# products: Products
|
16
|
+
# new: New Category
|
17
|
+
# edit_parent: Settings
|
18
|
+
# destroy: Delete
|
19
|
+
# reorder: Reorder
|
20
|
+
# confirm_destroy: Do you really want to delete this category?
|
19
21
|
index:
|
20
22
|
create_item: Create Category
|
21
23
|
edit: Edit
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adva-categories
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ingo Weiss
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-
|
19
|
+
date: 2010-11-08 00:00:00 +01:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: "0"
|
34
34
|
type: :runtime
|
35
35
|
version_requirements: *id001
|
36
|
-
description:
|
36
|
+
description: Categories engine for adva-cms2
|
37
37
|
email: nobody@adva-cms.org
|
38
38
|
executables: []
|
39
39
|
|
@@ -57,6 +57,7 @@ files:
|
|
57
57
|
- config/routes.rb
|
58
58
|
- config/locales/en.yml
|
59
59
|
- lib/adva-categories.rb
|
60
|
+
- lib/adva_categories/version.rb
|
60
61
|
- lib/adva/categories.rb
|
61
62
|
- lib/adva/routing_filters/categories.rb
|
62
63
|
- lib/testing/factories.rb
|
@@ -95,6 +96,6 @@ rubyforge_project: "[none]"
|
|
95
96
|
rubygems_version: 1.3.7
|
96
97
|
signing_key:
|
97
98
|
specification_version: 3
|
98
|
-
summary:
|
99
|
+
summary: Categories engine for adva-cms2
|
99
100
|
test_files: []
|
100
101
|
|