ecm_tags 1.0.0 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/ecm/tags/application.js +1 -1
- data/app/assets/javascripts/ecm/tags/application/dummy.js +0 -0
- data/app/assets/javascripts/ecm_tags.js +1 -0
- data/app/assets/stylesheets/ecm/tags/application.css +1 -1
- data/app/assets/stylesheets/ecm/tags/application/tag-labels.css +4 -0
- data/app/assets/stylesheets/ecm_tags.css +3 -0
- data/app/concerns/model/ecm/tags/taggable_concern.rb +13 -0
- data/app/controllers/ecm/tags/tag_searchs_controller.rb +10 -2
- data/app/helpers/ecm/tags/application_helper.rb +4 -0
- data/app/models/ecm/tags/null_tag.rb +9 -0
- data/app/models/ecm/tags/tag_search.rb +6 -2
- data/app/views/ecm/tags/_tag_labels_for_resource.html.haml +4 -0
- data/app/views/ecm/tags/tag_searchs/new.haml +5 -4
- data/config/initializers/assets.rb +0 -0
- data/config/locales/de.yml +5 -4
- data/config/locales/en.yml +3 -2
- data/config/routes.rb +10 -4
- data/db/migrate/20160208121254_create_ecm_tags_tags.rb +1 -1
- data/db/migrate/20160208121300_create_ecm_tags_taggings.rb +1 -1
- data/db/migrate/20161101170254_add_color_to_ecm_tags_tags.rb +5 -0
- data/lib/ecm/tags/configuration.rb +5 -0
- data/lib/ecm/tags/engine.rb +7 -0
- data/lib/ecm/tags/version.rb +1 -1
- data/lib/generators/ecm/tags/install/templates/initializer.rb +7 -0
- metadata +12 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8104551bb3079c872697c2ef2326969d4e92eeec
|
4
|
+
data.tar.gz: ec77be070876b144b3584d177d1b3dc5d0219d28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2e7e3771df88f49098225c547a2d73177cffaf9b37f276bcca64f51177c632ffbd57b7cf698650e543e92927fc3c9efdd1fa80e1f9b7844d24c675967665a79
|
7
|
+
data.tar.gz: 4b1ca17e0f524fd03172994ec0860452115445789f469a3cf93c0e7e476096f38443afbdde95a2a6295638978eac0448f052a58ad3e89a6222438aa1f8986328
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require ./ecm/tags/application
|
@@ -9,6 +9,6 @@
|
|
9
9
|
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
10
|
* files in this directory. It is generally better to create a new file per style scope.
|
11
11
|
*
|
12
|
-
*= require_tree
|
12
|
+
*= require_tree ./application
|
13
13
|
*= require_self
|
14
14
|
*/
|
@@ -13,7 +13,11 @@ module Ecm
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def create
|
16
|
-
|
16
|
+
if request.get?
|
17
|
+
@tag_search = TagSearch.new(tag_list: permitted_params)
|
18
|
+
else
|
19
|
+
@tag_search = TagSearch.new(permitted_params)
|
20
|
+
end
|
17
21
|
@result = @tag_search.result
|
18
22
|
respond_with @tag_search do |format|
|
19
23
|
format.html { render :new }
|
@@ -28,7 +32,11 @@ module Ecm
|
|
28
32
|
end
|
29
33
|
|
30
34
|
def permitted_params
|
31
|
-
|
35
|
+
if request.get?
|
36
|
+
params.require(:tag)
|
37
|
+
else
|
38
|
+
params.require(:tag_search).permit(:tag_list, :exact)
|
39
|
+
end
|
32
40
|
end
|
33
41
|
end
|
34
42
|
end
|
@@ -39,7 +39,7 @@ module Ecm::Tags
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def taggable_classes
|
42
|
-
@taggable_classes ||= Ecm::Tags::Tagging.
|
42
|
+
@taggable_classes ||= Ecm::Tags::Tagging.distinct.pluck(:taggable_type)
|
43
43
|
end
|
44
44
|
|
45
45
|
def exact
|
@@ -47,7 +47,11 @@ module Ecm::Tags
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def exact=(value)
|
50
|
-
|
50
|
+
if Rails.version < '5.1'
|
51
|
+
@exact = ActiveRecord::Type::Boolean.new.type_cast_from_database(value)
|
52
|
+
else
|
53
|
+
@exact = ActiveRecord::Type::Boolean.new.cast(value)
|
54
|
+
end
|
51
55
|
end
|
52
56
|
|
53
57
|
private
|
@@ -1,7 +1,8 @@
|
|
1
|
-
|
2
|
-
=
|
3
|
-
|
4
|
-
|
1
|
+
- unless params[:tag].present?
|
2
|
+
= simple_form_for(@tag_search, url: ecm_tags.tag_searchs_path) do |f|
|
3
|
+
= f.input :tag_list
|
4
|
+
= f.input :exact, as: :boolean
|
5
|
+
= f.button :submit, class: 'btn btn-primary'
|
5
6
|
|
6
7
|
#tag_search_result
|
7
8
|
- @result.each do |class_name, resources|
|
File without changes
|
data/config/locales/de.yml
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
de:
|
2
|
+
classes:
|
3
|
+
ecm/tags/engine: Tags
|
2
4
|
attributes:
|
3
5
|
tag_list: Tags
|
4
6
|
activerecord:
|
@@ -15,11 +17,11 @@ de:
|
|
15
17
|
ecm/tags/tag_search:
|
16
18
|
exact: Wortgenau
|
17
19
|
tag_list: Tags
|
18
|
-
|
20
|
+
models:
|
19
21
|
ecm/tags/tag:
|
20
22
|
one: Tag
|
21
23
|
other: Tags
|
22
|
-
ecm/tags/
|
24
|
+
ecm/tags/tagging:
|
23
25
|
one: Tagging
|
24
26
|
other: Taggings
|
25
27
|
ecm:
|
@@ -31,5 +33,4 @@ de:
|
|
31
33
|
tag_search:
|
32
34
|
create: 'Suchen'
|
33
35
|
routes:
|
34
|
-
|
35
|
-
ecm_tags: '/backend/tags'
|
36
|
+
ecm_tags_engine: tags
|
data/config/locales/en.yml
CHANGED
data/config/routes.rb
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
Ecm::Tags::Engine.routes.draw do
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
localized do
|
3
|
+
scope :ecm_tags_engine do
|
4
|
+
resources :tag_searchs, only: [:new, :create] do
|
5
|
+
get '/', on: :collection, to: "tag_searchs#create"
|
6
|
+
end
|
7
|
+
|
8
|
+
get '/:tag', to: "tag_searchs#create", as: 'tag'
|
5
9
|
|
6
|
-
|
10
|
+
root to: 'tag_searchs#new'
|
11
|
+
end
|
12
|
+
end
|
7
13
|
end
|
@@ -11,6 +11,11 @@ module Ecm
|
|
11
11
|
mattr_accessor(:base_controller) { 'FrontendController' }
|
12
12
|
mattr_accessor(:add_submit_button_to_search_box) { true }
|
13
13
|
mattr_accessor(:tag_search_exact_default_value) { false }
|
14
|
+
mattr_accessor(:taggable_models) { [] }
|
15
|
+
|
16
|
+
def self.taggable_models
|
17
|
+
@@taggable_models.map(&:constantize)
|
18
|
+
end
|
14
19
|
end
|
15
20
|
end
|
16
21
|
end
|
data/lib/ecm/tags/engine.rb
CHANGED
@@ -2,6 +2,13 @@ module Ecm
|
|
2
2
|
module Tags
|
3
3
|
class Engine < ::Rails::Engine
|
4
4
|
isolate_namespace Ecm::Tags
|
5
|
+
|
6
|
+
config.after_initialize do
|
7
|
+
Configuration.taggable_models.each do |model|
|
8
|
+
puts "Including Models::Ecm::Tags::TaggableConcern in #{model}"
|
9
|
+
model.send(:include, Model::Ecm::Tags::TaggableConcern)
|
10
|
+
end
|
11
|
+
end
|
5
12
|
end
|
6
13
|
end
|
7
14
|
end
|
data/lib/ecm/tags/version.rb
CHANGED
@@ -16,4 +16,11 @@ Ecm::Tags.configure do |config|
|
|
16
16
|
# Default: config.tag_search_exact_default_value = false
|
17
17
|
#
|
18
18
|
config.tag_search_exact_default_value = false
|
19
|
+
|
20
|
+
|
21
|
+
# Specify the models to be tagged.
|
22
|
+
#
|
23
|
+
# Default: config.taggable_models = %w()
|
24
|
+
#
|
25
|
+
config.taggable_models = %w()
|
19
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecm_tags
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -231,22 +231,31 @@ files:
|
|
231
231
|
- README.rdoc
|
232
232
|
- Rakefile
|
233
233
|
- app/assets/javascripts/ecm/tags/application.js
|
234
|
+
- app/assets/javascripts/ecm/tags/application/dummy.js
|
235
|
+
- app/assets/javascripts/ecm_tags.js
|
234
236
|
- app/assets/stylesheets/ecm/tags/application.css
|
237
|
+
- app/assets/stylesheets/ecm/tags/application/tag-labels.css
|
238
|
+
- app/assets/stylesheets/ecm_tags.css
|
235
239
|
- app/attribute_renderers/tag_list_renderer.rb
|
240
|
+
- app/concerns/model/ecm/tags/taggable_concern.rb
|
236
241
|
- app/controllers/ecm/tags/application_controller.rb
|
237
242
|
- app/controllers/ecm/tags/tag_searchs_controller.rb
|
238
243
|
- app/helpers/ecm/tags/application_helper.rb
|
244
|
+
- app/models/ecm/tags/null_tag.rb
|
239
245
|
- app/models/ecm/tags/tag.rb
|
240
246
|
- app/models/ecm/tags/tag_search.rb
|
241
247
|
- app/models/ecm/tags/tagging.rb
|
242
248
|
- app/views/ecm/tags/_search_box.haml
|
249
|
+
- app/views/ecm/tags/_tag_labels_for_resource.html.haml
|
243
250
|
- app/views/ecm/tags/tag_searchs/new.haml
|
244
251
|
- app/views/layouts/ecm/tags/application.html.erb
|
252
|
+
- config/initializers/assets.rb
|
245
253
|
- config/locales/de.yml
|
246
254
|
- config/locales/en.yml
|
247
255
|
- config/routes.rb
|
248
256
|
- db/migrate/20160208121254_create_ecm_tags_tags.rb
|
249
257
|
- db/migrate/20160208121300_create_ecm_tags_taggings.rb
|
258
|
+
- db/migrate/20161101170254_add_color_to_ecm_tags_tags.rb
|
250
259
|
- lib/ecm/tags.rb
|
251
260
|
- lib/ecm/tags/configuration.rb
|
252
261
|
- lib/ecm/tags/engine.rb
|
@@ -277,9 +286,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
277
286
|
version: '0'
|
278
287
|
requirements: []
|
279
288
|
rubyforge_project:
|
280
|
-
rubygems_version: 2.
|
289
|
+
rubygems_version: 2.6.11
|
281
290
|
signing_key:
|
282
291
|
specification_version: 4
|
283
292
|
summary: Easy tagging for itsf backend
|
284
293
|
test_files: []
|
285
|
-
has_rdoc:
|