redde_seo 0.0.2 → 0.0.3
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82feb666ddd524614696ca376160cc7875aa48a2
|
4
|
+
data.tar.gz: ec3c5d8403b46879a87c90471152a4e00098a0df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3bd6fbb0d421082a086b0397db50aba047717dbe8e4421817b58a1a20493ebac8343c2d93a6ff60e07efab2befbcdfbabaff3c4562501fe060f5650c68079dc
|
7
|
+
data.tar.gz: d23baa4ab2188924f18b1af2c622fd0f030d0973e645491920c5f9e35ed6b3e0ec75ae98ba4393d3f85e97d2083b3cfcd67e34d59224478f5d3e47c091ad8818
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Redde::Seo::SeosHelper
|
2
|
+
def seo_link_for_url(seo)
|
3
|
+
link_to seo_url_for(seo), [:edit, :admin, seo], alt: seo.url, title: seo.url
|
4
|
+
end
|
5
|
+
|
6
|
+
def seo_url_for(seo)
|
7
|
+
title = truncate(seo.url, length: 17)
|
8
|
+
title.present? ? title : 'НЕ ЗАПОЛНЕНО'
|
9
|
+
end
|
10
|
+
|
11
|
+
def seo_link_for_object(seo)
|
12
|
+
link_to seo_object_for(seo), [:edit, :admin, seo], alt: seo.url, title: seo.url
|
13
|
+
end
|
14
|
+
|
15
|
+
def seo_object_for(seo)
|
16
|
+
return '' unless seo.seoable
|
17
|
+
"#{seo.seoable.class.model_name.human}##{seo.seoable_id}"
|
18
|
+
end
|
19
|
+
|
20
|
+
def seo_title_for(seo)
|
21
|
+
title = seo.title.present? ? seo.title : 'НЕ ЗАПОЛНЕНО'
|
22
|
+
link_to title, [:edit, :admin, seo], alt: seo.url, title: seo.url
|
23
|
+
end
|
24
|
+
|
25
|
+
def seo_empty_for(seo)
|
26
|
+
seo.empty? ? '✘' : '✔'
|
27
|
+
end
|
28
|
+
end
|
@@ -11,10 +11,10 @@
|
|
11
11
|
%table
|
12
12
|
- if @seo.url.present?
|
13
13
|
%tr
|
14
|
-
%th{colspan: 2}=
|
14
|
+
%th{colspan: 2}= seo_url_for(@seo)
|
15
15
|
- if @seo.seoable_type.present? && @seo.seoable_id.present?
|
16
16
|
%tr
|
17
|
-
%th{colspan: 2}=
|
17
|
+
%th{colspan: 2}= seo_object_for(@seo)
|
18
18
|
= render 'form', f: f
|
19
19
|
.actions
|
20
20
|
= f.submit 'Сохранить'
|
@@ -10,22 +10,19 @@
|
|
10
10
|
%col
|
11
11
|
%col
|
12
12
|
%col
|
13
|
-
%col
|
14
13
|
%col.w1
|
15
14
|
%thead
|
16
15
|
%tr
|
17
16
|
%th Url
|
18
17
|
%th Объект
|
19
18
|
%th Тайтл
|
20
|
-
%th
|
21
|
-
%th Дескрипшен
|
19
|
+
%th Заполнено?
|
22
20
|
%th
|
23
21
|
- @seos.each do |seo|
|
24
22
|
%tr
|
25
|
-
%td=
|
26
|
-
%td=
|
27
|
-
%td=
|
28
|
-
%td=
|
29
|
-
%td= link_to seo.description || 'НЕ ЗАПОЛНЕНО', [:edit, :admin, seo]
|
23
|
+
%td= seo_link_for_url(seo)
|
24
|
+
%td= seo_link_for_object(seo)
|
25
|
+
%td= seo_title_for(seo)
|
26
|
+
%td= seo_empty_for(seo)
|
30
27
|
%td= link_to 'Удалить', [:admin, seo], method: :delete, data: { confirm: 'Удалить?' }, class: :del
|
31
28
|
|
data/lib/redde_seo/engine.rb
CHANGED
data/lib/redde_seo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redde_seo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oleg Bovykin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -203,6 +203,7 @@ files:
|
|
203
203
|
- Rakefile
|
204
204
|
- app/controllers/admin/seos_controller.rb
|
205
205
|
- app/controllers/concerns/with_seo_ctrl.rb
|
206
|
+
- app/helpers/redde/seo/seos_helper.rb
|
206
207
|
- app/models/concerns/with_seo.rb
|
207
208
|
- app/models/redde/seo.rb
|
208
209
|
- app/models/redde/seo/custom_class_names.rb
|