c80_yax 0.1.0.10 → 0.1.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/c80_yax/cats/cat_lists_helper.rb +33 -0
- data/lib/c80_yax/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 167539a3ddc657f9981d87a228f087e383231e69
|
4
|
+
data.tar.gz: debbbff6afa1582278bb9ee148dac082c0339e9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10d105168f64205e966cd9544fa1c68456969da2a467db77ffde1a8cadada1a940e7de7b6e2583b7bdad39aa6fd1d4e846e59a9f5a33731316e24774ca147851
|
7
|
+
data.tar.gz: a2dbb7613f446f29e668f1c0658880ed106e130d53b1ed9315751abb52500934c585d39b5db1858c20ab943888f1df430af75c220834bb6ff343d3ad02707842
|
@@ -12,6 +12,39 @@ module C80Yax
|
|
12
12
|
}
|
13
13
|
end
|
14
14
|
|
15
|
+
def render_cats_strsubcats(&make_strsubcat_url)
|
16
|
+
|
17
|
+
rdo = Cat.includes(:strsubcats)
|
18
|
+
res = ''
|
19
|
+
|
20
|
+
rdo.each do |category|
|
21
|
+
r = "<h2 class='title'>#{category.title}</h2>"
|
22
|
+
ds = ul_strsubcats(category, &make_strsubcat_url)
|
23
|
+
next if ds.blank? # (**)
|
24
|
+
r += ds
|
25
|
+
res += "<li class='li_category' id='category_#{category.id}'>#{r}</li>"
|
26
|
+
end
|
27
|
+
|
28
|
+
"<ul class='ul_cats_strsubcats'>#{res}</ul>".html_safe
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def ul_strsubcats(category, &make_url)
|
35
|
+
res = ''
|
36
|
+
# noinspection RubyResolve
|
37
|
+
category.strsubcats.each do |strsubcat|
|
38
|
+
id = "strsubcat_#{strsubcat.id}"
|
39
|
+
t = strsubcat.title
|
40
|
+
u = make_url.call(strsubcat)
|
41
|
+
d = "<a href='#{u}' title='#{t}'>#{t}</a>"
|
42
|
+
res += "<li class='li_strsubcat' id='#{id}'>#{d}</li>"
|
43
|
+
end
|
44
|
+
return res if res.blank? # (*)
|
45
|
+
"<ul class='ul_strsubcats'>#{res}</ul>"#.html_safe
|
46
|
+
end
|
47
|
+
|
15
48
|
end
|
16
49
|
end
|
17
50
|
end
|
data/lib/c80_yax/version.rb
CHANGED