activeadmin_expandable_inputs 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 127bd44cc3b3e2af33ade5a5978711e8d5ece222
4
+ data.tar.gz: ae1dc6d05b73ee910075702160a942db8bcd36b0
5
+ SHA512:
6
+ metadata.gz: 09dc54404429b6ca1425a4ef927a932f3c8553a49536bda42f5ad8496cac27ab448f46bc26789745f447ee7dfa2f3349b00f105e4f1a465b43684597c3752069
7
+ data.tar.gz: 3e05d0f897f4fe0104b69318748eea7ad25ca955e35df38227b235fc3b9625a0bad919cfcc1ca12055970e3b95784767b68c5b4cea8bffd2a2e06f6958112aba
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in activeadmin_expandable_inputs.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Ariel Schvartz
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,82 @@
1
+ # ActiveadminExpandableInputs
2
+
3
+ This GEM adds the ability for the user to minimize and maximize the inputs boxes in activeadmin.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'activeadmin_expandable_inputs'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install activeadmin_expandable_inputs
18
+
19
+ ## Usage
20
+
21
+ ### Import the Assets
22
+
23
+ Add to application.js:
24
+
25
+ ```javascript
26
+ //= require activeadmin-expandable
27
+ ```
28
+
29
+ Add to application.css
30
+ ```css
31
+ *= require activeadmin-expandable
32
+ ```
33
+ ### Create expandable elements
34
+
35
+ Add the class 'expandable' and 'in' (if you want it to start expanded) or 'out' (to start closed)
36
+
37
+ Example:
38
+ ```ruby
39
+ ActiveAdmin.register AdminUser do
40
+ form do |f|
41
+ f.inputs "Admin Details", :class => 'expandable in' do
42
+ f.input :email
43
+ f.input :password
44
+ f.input :password_confirmation
45
+ end
46
+ f.actions
47
+ end
48
+ end
49
+ ```
50
+
51
+ You can add it to nested_resources too! This automatically adds a legend to the new inputs box based on the add button name.
52
+
53
+ For example:
54
+ ```ruby
55
+ ActiveAdmin.register Post do
56
+
57
+ form do |f|
58
+ f.inputs "Details" do
59
+ f.input :title
60
+ f.input :published_at, :label => "Publish Post At"
61
+ end
62
+ f.inputs "Content" do
63
+ f.input :body
64
+ end
65
+
66
+ # The legend added to the inputs box it's based on the new_record button text. In this case, the text in the button will be 'Add Theme'. So the legend, will be 'Theme'.
67
+ f.has_many :categories, :allow_destroy => true, :heading => 'Themes', :new_record => 'Add Theme', :class => 'expandable in' do |cf|
68
+ cf.input :title
69
+ end
70
+ f.actions
71
+ end
72
+
73
+ end
74
+ ```
75
+
76
+ ## Contributing
77
+
78
+ 1. Fork it ( http://github.com/arielschvartz/activeadmin_expandable_inputs/fork )
79
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
80
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
81
+ 4. Push to the branch (`git push origin my-new-feature`)
82
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'activeadmin_expandable_inputs/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "activeadmin_expandable_inputs"
8
+ spec.version = ActiveadminExpandableInputs::VERSION
9
+ spec.authors = ["Ariel Schvartz"]
10
+ spec.email = ["ari.shh@gmail.com"]
11
+ spec.summary = %q{Adds expandable boxes to the activeadmin inputs}
12
+ spec.description = %q{This gem uses JQuery to create expandable input boxes on activeadmin}
13
+ spec.homepage = "https://github.com/arielschvartz/activeadmin_expandable_inputs"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.5"
22
+ spec.add_development_dependency "rake"
23
+ end
@@ -0,0 +1,5 @@
1
+ require "activeadmin_expandable_inputs/version"
2
+ require "activeadmin_expandable_inputs/engine"
3
+
4
+ module ActiveadminExpandableInputs
5
+ end
@@ -0,0 +1,4 @@
1
+ module ActiveadminExpandableInputs
2
+ class Engine < ::Rails::Engine
3
+ end
4
+ end
@@ -0,0 +1,3 @@
1
+ module ActiveadminExpandableInputs
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1 @@
1
+ (function(){var e,t,n;n=typeof exports!="undefined"&&exports!==null?exports:this,$(function(){return $(".expandable").each(function(){return n.set_collapse($(this))})}),$(function(){return $(".button.has_many_add").click(function(e){return t($(this))})}),t=function(t){var r;return r=t.parents(".has_many_container"),n.delay(10,function(){var t;return t=r.find(".expandable:last"),e(t),n.set_collapse(t)})},n.set_collapse=function(e){var t;return t=e.children("legend:first"),t.click(function(t){return t.preventDefault(),e.children("ol:first").toggle("fast",function(){return e.hasClass("in")?(e.removeClass("in"),e.addClass("out")):(e.addClass("in"),e.removeClass("out"))})})},e=function(e,t){var n;t==null&&(t=void 0);if(e.children("legend").length<1)return t===void 0&&(t=e.parents(".has_many_container").find(".button.has_many_add").text().split(" ").slice(1).join(" ")),n=$("<legend>").append($("<span>").text(t)),e.prepend(n)},$(function(){return $(".expandable.out").each(function(){return $(this).find("ol:first").css({display:"none"})})})}).call(this);
@@ -0,0 +1 @@
1
+ .expandable legend{position:relative;width:100%}.expandable legend:after,.expandable legend:before{position:absolute;right:10px;top:5px;z-index:1;text-shadow:#fff 0 1px 0;font-size:1em;font-weight:700;line-height:18px;color:#5e6469}.expandable legend:after{content:"Expandir +"}.expandable legend:before{content:"Minimizar -"}.expandable.in legend:before{display:block}.expandable.in legend:after,.expandable.out legend:before{display:none}.expandable.out legend:after{display:block}form .inputs ol li.input fieldset legend span{position:static;margin-bottom:.5em}form .inputs ol li.input fieldset ol{padding:0;width:100%}form .inputs ol li.input fieldset ol li{padding:10px}
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: activeadmin_expandable_inputs
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Ariel Schvartz
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.5'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: This gem uses JQuery to create expandable input boxes on activeadmin
42
+ email:
43
+ - ari.shh@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - activeadmin_expandable_inputs.gemspec
54
+ - lib/activeadmin_expandable_inputs.rb
55
+ - lib/activeadmin_expandable_inputs/engine.rb
56
+ - lib/activeadmin_expandable_inputs/version.rb
57
+ - vendor/assets/javascripts/expandable.js
58
+ - vendor/assets/stylesheets/.sass-cache/cd04f03d5f08768244c712111d4561d456022331/expandable.css.sassc
59
+ - vendor/assets/stylesheets/expandable.css
60
+ homepage: https://github.com/arielschvartz/activeadmin_expandable_inputs
61
+ licenses:
62
+ - MIT
63
+ metadata: {}
64
+ post_install_message:
65
+ rdoc_options: []
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ requirements: []
79
+ rubyforge_project:
80
+ rubygems_version: 2.2.2
81
+ signing_key:
82
+ specification_version: 4
83
+ summary: Adds expandable boxes to the activeadmin inputs
84
+ test_files: []