lolita-menu 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/app/models/menu_item.rb +2 -3
- data/config/locales/sv_SE.yml +24 -0
- data/lib/lolita-menu/nested_tree.rb +7 -7
- data/lolita-menu.gemspec +2 -2
- metadata +11 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 505f225fb1ed4299ce82086783862ce90eec17a1
|
4
|
+
data.tar.gz: 631d0731cd47d52dca9a4d9ec05eb2d187909706
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd594e5a46d9e5d985e8137b13455713cc8f483918fc7e10bf99363b9ffd51a3f5ce62854baa532a24c9b957a911410566b74279e80e7d6fd8bbb543a56a4e76
|
7
|
+
data.tar.gz: c245d054577a989dd095d7d334b0c6ca29407d09c650b876371b98bca249ddebe102602eee505a98e8d602c2d0dd6415a5ed4b97ef7743c2ac6e82dc97a92c55
|
data/Gemfile
CHANGED
data/app/models/menu_item.rb
CHANGED
@@ -3,11 +3,10 @@ class MenuItem < ActiveRecord::Base
|
|
3
3
|
include Lolita::Menu::NestedTree
|
4
4
|
self.table_name = 'lolita_menu_items'
|
5
5
|
|
6
|
-
belongs_to :menu, :class_name => "Menu"
|
7
|
-
attr_accessible :lft, :rgt, :depth, :parent_id, :menu_id, :url, :name
|
6
|
+
belongs_to :menu, :class_name => "Menu", touch: true
|
8
7
|
|
9
8
|
validates :name,:presence => true
|
10
|
-
validates :url, :format => {:with =>
|
9
|
+
validates :url, :format => { :with => /\A(\/)|(http).*/ }, :unless=>:root?
|
11
10
|
|
12
11
|
before_save :normalize_url
|
13
12
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
en:
|
2
|
+
lolita:
|
3
|
+
menu:
|
4
|
+
notice: "Menu saved."
|
5
|
+
error: "Couldn't save a menu. Try again."
|
6
|
+
"branch created": "New menu item created."
|
7
|
+
"branch deleted": "Menu item deleted."
|
8
|
+
add_new: "Add new"
|
9
|
+
save_menu: "Save menu"
|
10
|
+
nested_tree:
|
11
|
+
"branch created": "Barnch %{name} created."
|
12
|
+
"branch deleted": "%{name} deleted."
|
13
|
+
notice: "%{name} successfully saved."
|
14
|
+
error: "%{name} failed to save. Try again."
|
15
|
+
menu_item:
|
16
|
+
new: "Ny punkt"
|
17
|
+
activerecord:
|
18
|
+
models:
|
19
|
+
menu_item:
|
20
|
+
one: Menu item
|
21
|
+
other: Menus
|
22
|
+
menu:
|
23
|
+
one: Menu
|
24
|
+
other: Menus
|
@@ -111,7 +111,7 @@ module Lolita
|
|
111
111
|
end
|
112
112
|
|
113
113
|
def update_item(item)
|
114
|
-
self.where(:id => item.value_for(:item_id)).update_all(item.attribute_value_pairs_hash)
|
114
|
+
self.where(:id => item.value_for(:item_id)).update_all(item.attribute_value_pairs_hash)
|
115
115
|
end
|
116
116
|
|
117
117
|
def remove_items(ids)
|
@@ -199,7 +199,7 @@ module Lolita
|
|
199
199
|
self.class.lolita_nested_tree.scope_keys.inject({}) do |result, key|
|
200
200
|
result[key] = self.send(key)
|
201
201
|
result
|
202
|
-
end
|
202
|
+
end
|
203
203
|
end
|
204
204
|
|
205
205
|
private
|
@@ -213,7 +213,7 @@ module Lolita
|
|
213
213
|
end
|
214
214
|
|
215
215
|
def am_i_new_root?
|
216
|
-
#scope_ids.all? && scope_records.all? &&
|
216
|
+
#scope_ids.all? && scope_records.all? &&
|
217
217
|
!(self.class.with_tree_scope(self) do
|
218
218
|
root
|
219
219
|
end)
|
@@ -230,11 +230,11 @@ module Lolita
|
|
230
230
|
# scope.constantize.exists?(self.send(scope.foreign_key.to_sym))
|
231
231
|
# end
|
232
232
|
#end
|
233
|
-
|
233
|
+
|
234
234
|
def put_in_place
|
235
235
|
if place==:append
|
236
236
|
item = self
|
237
|
-
self.class.with_tree_scope(self) do
|
237
|
+
self.class.with_tree_scope(self) do
|
238
238
|
root.append(item)
|
239
239
|
end
|
240
240
|
end
|
@@ -256,7 +256,7 @@ module Lolita
|
|
256
256
|
|
257
257
|
def recalculate_positions_after(action)
|
258
258
|
if action==:append
|
259
|
-
self.class.update_all(
|
259
|
+
self.class.where(:id => self.id).update_all(:rgt=> self.rgt+2)
|
260
260
|
end
|
261
261
|
end
|
262
262
|
|
@@ -269,7 +269,7 @@ module Lolita
|
|
269
269
|
}
|
270
270
|
end
|
271
271
|
end
|
272
|
-
|
272
|
+
|
273
273
|
end
|
274
274
|
end
|
275
275
|
end
|
data/lolita-menu.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "lolita-menu"
|
6
|
-
s.version = "0.4.
|
6
|
+
s.version = "0.4.2"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
9
9
|
s.authors = ["ITHouse", "Arturs Meisters"]
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.require_paths = ["lib"]
|
19
19
|
s.summary = "Menu managing plugin for Lolita."
|
20
20
|
|
21
|
-
s.add_runtime_dependency(%q<lolita>, [">= 3.3
|
21
|
+
s.add_runtime_dependency(%q<lolita>, [">= 3.3"])
|
22
22
|
s.files = `git ls-files`.split("\n")
|
23
23
|
s.test_files = `git ls-files -- {test_orm,spec}/*`.split("\n")
|
24
24
|
s.require_paths = ["lib"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lolita-menu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ITHouse
|
@@ -9,26 +9,20 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-06-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: lolita
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: 3.3.1
|
21
|
-
- - ~>
|
18
|
+
- - ">="
|
22
19
|
- !ruby/object:Gem::Version
|
23
20
|
version: '3.3'
|
24
21
|
type: :runtime
|
25
22
|
prerelease: false
|
26
23
|
version_requirements: !ruby/object:Gem::Requirement
|
27
24
|
requirements:
|
28
|
-
- -
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
version: 3.3.1
|
31
|
-
- - ~>
|
25
|
+
- - ">="
|
32
26
|
- !ruby/object:Gem::Version
|
33
27
|
version: '3.3'
|
34
28
|
description: Manage public menus for each project inside Lolita.
|
@@ -39,9 +33,9 @@ extra_rdoc_files:
|
|
39
33
|
- LICENSE.txt
|
40
34
|
- README.rdoc
|
41
35
|
files:
|
42
|
-
- .document
|
43
|
-
- .gitignore
|
44
|
-
- .rspec
|
36
|
+
- ".document"
|
37
|
+
- ".gitignore"
|
38
|
+
- ".rspec"
|
45
39
|
- Gemfile
|
46
40
|
- History.rdoc
|
47
41
|
- LICENSE.txt
|
@@ -71,6 +65,7 @@ files:
|
|
71
65
|
- app/views/components/lolita/menu_item/_display.html.haml
|
72
66
|
- config/locales/en.yml
|
73
67
|
- config/locales/lv.yml
|
68
|
+
- config/locales/sv_SE.yml
|
74
69
|
- config/routes.rb
|
75
70
|
- lib/generators/lolita/menu/install_generator.rb
|
76
71
|
- lib/generators/lolita/menu/templates/lolita-menu-urls.rb
|
@@ -122,17 +117,17 @@ require_paths:
|
|
122
117
|
- lib
|
123
118
|
required_ruby_version: !ruby/object:Gem::Requirement
|
124
119
|
requirements:
|
125
|
-
- -
|
120
|
+
- - ">="
|
126
121
|
- !ruby/object:Gem::Version
|
127
122
|
version: '0'
|
128
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
124
|
requirements:
|
130
|
-
- -
|
125
|
+
- - ">="
|
131
126
|
- !ruby/object:Gem::Version
|
132
127
|
version: '0'
|
133
128
|
requirements: []
|
134
129
|
rubyforge_project:
|
135
|
-
rubygems_version: 2.
|
130
|
+
rubygems_version: 2.2.2
|
136
131
|
signing_key:
|
137
132
|
specification_version: 4
|
138
133
|
summary: Menu managing plugin for Lolita.
|