refinerycms-tags 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/admin/tags_controller.rb +6 -0
- data/app/controllers/admin/tags_controller.rb~ +6 -0
- data/app/views/shared/admin/_tag_editor.html.erb +16 -0
- data/app/views/shared/admin/_tag_editor.html.erb~ +16 -0
- data/config/locales/en.yml +6 -0
- data/config/locales/en.yml~ +5 -0
- data/config/locales/es.yml +6 -0
- data/config/locales/es.yml~ +5 -0
- data/config/locales/lolcat.yml +6 -0
- data/config/locales/lolcat.yml~ +5 -0
- data/config/routes.rb +5 -0
- data/config/routes.rb~ +9 -0
- data/lib/generators/refinerycms_tags_generator.rb +6 -0
- data/lib/refinerycms-tags.rb +27 -0
- data/lib/refinerycms-tags.rb~ +26 -0
- data/lib/tasks/tags.rake +13 -0
- metadata +95 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
<span class="label_with_help">
|
2
|
+
<%= f.label field -%>
|
3
|
+
<%= refinery_help_tag t('.tag_help') %>
|
4
|
+
</span>
|
5
|
+
<%= f.text_area field %>
|
6
|
+
<%
|
7
|
+
unless @tag_editor_included
|
8
|
+
@tag_editor_included = true
|
9
|
+
content_for :after_javascript_libraries, javascript_include_tag("jquery.tagsinput#{'.min' unless Rails.env.development?}.js")
|
10
|
+
content_for :stylesheets, stylesheet_link_tag('jquery.tagsinput.css')
|
11
|
+
end
|
12
|
+
|
13
|
+
autocomplete_url ||= admin_tags_path if autocomplete
|
14
|
+
default_text ||= '.default_text'
|
15
|
+
content_for :javascripts, javascript_tag("$(document).ready(function() { $('##{f.object_name}_#{field}').tagsInput({defaultText: '#{t default_text}'#{', autocomplete_url: ' + autocomplete_url.to_json if autocomplete}}); })")
|
16
|
+
%>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<span class="label_with_help">
|
2
|
+
<%= f.label field -%>
|
3
|
+
<%= refinery_help_tag t('.tag_help') %>
|
4
|
+
</span>
|
5
|
+
<%= f.text_area field %>
|
6
|
+
<%
|
7
|
+
unless @tag_editor_included
|
8
|
+
@tag_editor_included = true
|
9
|
+
content_for :after_javascript_libraries, javascript_include_tag("jquery.tagsinput#{'.min' unless Rails.env.development?}.js")
|
10
|
+
content_for :stylesheets, stylesheet_link_tag('jquery.tagsinput.css')
|
11
|
+
end
|
12
|
+
debugger
|
13
|
+
autocomplete_url ||= admin_tags_path if autocomplete
|
14
|
+
default_text ||= '.default_text'
|
15
|
+
content_for :javascripts, javascript_tag("$(document).ready(function() { $('##{f.object_name}_#{field}').tagsInput({defaultText: '#{t default_text}'#{', autocomplete_url: ' + autocomplete_url.to_json if autocomplete}}); })")
|
16
|
+
%>
|
data/config/routes.rb
ADDED
data/config/routes.rb~
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'refinerycms-base'
|
2
|
+
|
3
|
+
module Refinery
|
4
|
+
module Tags
|
5
|
+
|
6
|
+
class << self
|
7
|
+
attr_accessor :root
|
8
|
+
def root
|
9
|
+
@root ||= Pathname.new(File.expand_path('../../', __FILE__))
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
class Engine < Rails::Engine
|
14
|
+
initializer "static assets" do |app|
|
15
|
+
app.middleware.insert_after ::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public"
|
16
|
+
end
|
17
|
+
|
18
|
+
config.after_initialize do
|
19
|
+
Refinery::Plugin.register do |plugin|
|
20
|
+
plugin.name = "tags"
|
21
|
+
plugin.pathname = root
|
22
|
+
plugin.hide_from_menu = true
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'refinerycms-base'
|
2
|
+
|
3
|
+
module Refinery
|
4
|
+
module Tags
|
5
|
+
|
6
|
+
class << self
|
7
|
+
attr_accessor :root
|
8
|
+
def root
|
9
|
+
@root ||= Pathname.new(File.expand_path('../../', __FILE__))
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
class Engine < Rails::Engine
|
14
|
+
initializer "static assets" do |app|
|
15
|
+
app.middleware.insert_after ::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public"
|
16
|
+
end
|
17
|
+
|
18
|
+
config.after_initialize do
|
19
|
+
Refinery::Plugin.register do |plugin|
|
20
|
+
plugin.name = "tags"
|
21
|
+
plugin.pathname = root
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/tasks/tags.rake
ADDED
metadata
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: refinerycms-tags
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 1.0.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Sergio Cambra
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2012-02-07 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: acts-as-taggable-on
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ~>
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 2
|
31
|
+
- 2
|
32
|
+
- 2
|
33
|
+
version: 2.2.2
|
34
|
+
type: :runtime
|
35
|
+
version_requirements: *id001
|
36
|
+
description: acts-as-taggable-on interface for Refinery CMS
|
37
|
+
email: sergio@entrecables.com
|
38
|
+
executables: []
|
39
|
+
|
40
|
+
extensions: []
|
41
|
+
|
42
|
+
extra_rdoc_files: []
|
43
|
+
|
44
|
+
files:
|
45
|
+
- lib/generators/refinerycms_tags_generator.rb
|
46
|
+
- lib/refinerycms-tags.rb
|
47
|
+
- lib/tasks/tags.rake
|
48
|
+
- lib/refinerycms-tags.rb~
|
49
|
+
- config/locales/en.yml
|
50
|
+
- config/locales/en.yml~
|
51
|
+
- config/locales/lolcat.yml
|
52
|
+
- config/locales/es.yml
|
53
|
+
- config/locales/lolcat.yml~
|
54
|
+
- config/locales/es.yml~
|
55
|
+
- config/routes.rb
|
56
|
+
- config/routes.rb~
|
57
|
+
- app/controllers/admin/tags_controller.rb
|
58
|
+
- app/controllers/admin/tags_controller.rb~
|
59
|
+
- app/views/shared/admin/_tag_editor.html.erb
|
60
|
+
- app/views/shared/admin/_tag_editor.html.erb~
|
61
|
+
homepage: http://github.com/scambra/refinerycms-tags
|
62
|
+
licenses: []
|
63
|
+
|
64
|
+
post_install_message:
|
65
|
+
rdoc_options: []
|
66
|
+
|
67
|
+
require_paths:
|
68
|
+
- lib
|
69
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
hash: 3
|
75
|
+
segments:
|
76
|
+
- 0
|
77
|
+
version: "0"
|
78
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
|
+
none: false
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
hash: 3
|
84
|
+
segments:
|
85
|
+
- 0
|
86
|
+
version: "0"
|
87
|
+
requirements: []
|
88
|
+
|
89
|
+
rubyforge_project:
|
90
|
+
rubygems_version: 1.8.10
|
91
|
+
signing_key:
|
92
|
+
specification_version: 3
|
93
|
+
summary: Tags engine for Refinery CMS
|
94
|
+
test_files: []
|
95
|
+
|