refinerycms-tags 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,6 @@
1
+ class Admin::TagsController < Admin::BaseController
2
+ def index
3
+ @tags = ActsAsTaggableOn::Tag.named_like(params[:term]).all
4
+ render :json => @tags.map(&:name) if request.xhr?
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ class Admin::TagsController < Admin::BaseController
2
+ def index
3
+ @tags = ActsAsTaggableOn::Tag.named_like(params[:term]).all
4
+ render :json => @tags if request.xhr?
5
+ end
6
+ end
@@ -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
+ %>
@@ -0,0 +1,6 @@
1
+ en:
2
+ shared:
3
+ admin:
4
+ tag_editor:
5
+ tag_help: Write a tag and press enter
6
+ default_text: add a tag
@@ -0,0 +1,5 @@
1
+ en:
2
+ shared:
3
+ admin:
4
+ tag_editor:
5
+ tag_help: Write a tag and press enter
@@ -0,0 +1,6 @@
1
+ es:
2
+ shared:
3
+ admin:
4
+ tag_editor:
5
+ tag_help: Escribe una etiqueta y pulsa intro para añadirla
6
+ default_text: añade una etiqueta
@@ -0,0 +1,5 @@
1
+ es:
2
+ shared:
3
+ admin:
4
+ tag_editor:
5
+ tag_help: Escribe una etiqueta y pulsa intro para añadirla
@@ -0,0 +1,6 @@
1
+ lolcat:
2
+ shared:
3
+ admin:
4
+ tag_editor:
5
+ tag_help: WRITE A TAG AND PRESS ENTER
6
+ default_text: ADD A TAG
@@ -0,0 +1,5 @@
1
+ lolcat:
2
+ shared:
3
+ admin:
4
+ tag_editor:
5
+ tag_help: WRITE A TAG AND PRESS ENTER
data/config/routes.rb ADDED
@@ -0,0 +1,5 @@
1
+ ::Refinery::Application.routes.draw do
2
+ scope(:path => 'refinery', :as => 'admin', :module => 'admin') do
3
+ resources :tags, :only => :index
4
+ end
5
+ end
data/config/routes.rb~ ADDED
@@ -0,0 +1,9 @@
1
+ ::Refinery::Application.routes.draw do
2
+ scope(:path => 'refinery', :as => 'admin', :module => 'admin') do
3
+ resources :tags, :only => [] do
4
+ collection do
5
+ get :search
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,6 @@
1
+ class RefinerycmsTags < Refinery::Generators::EngineInstaller
2
+
3
+ source_root File.expand_path('../../../', __FILE__)
4
+ engine_name "tags"
5
+
6
+ end
@@ -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
@@ -0,0 +1,13 @@
1
+ namespace :refinery do
2
+
3
+ namespace :tags do
4
+
5
+ # call this task my running: rake refinery:tags:my_task
6
+ # desc "Description of my task below"
7
+ # task :my_task => :environment do
8
+ # # add your logic here
9
+ # end
10
+
11
+ end
12
+
13
+ end
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
+