volt-simple_icon_selector 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a34e780489cbe7ce2f672b05b7910dc38482677d
4
+ data.tar.gz: 794efa5b7d12f3256639f3131574695998cba46f
5
+ SHA512:
6
+ metadata.gz: 1c1a93d8805bc175177463f3f3dc0c731f15fa0e3442b3952474f8dc02dc32f98a68220fcaf2bc0076e4e04d35a3a970b774d7a05ae24bb6bf55898c19a40bc7
7
+ data.tar.gz: def95f53f1be06dd0edbbf197ea58045aacaf0f8a02a3768fb0a6182b32a92b50f6b8607e7799246744df1b2220859a5c9f92bf3e177261e8f663718bc6aeabf
data/.gitignore ADDED
@@ -0,0 +1,19 @@
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
18
+
19
+ .repo_timeline
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,15 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
12
+
13
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
14
+
15
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.1.0, available at [http://contributor-covenant.org/version/1/1/0/](http://contributor-covenant.org/version/1/1/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in volt-simple_icon_selector.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Neurodynamic
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,53 @@
1
+ # Volt::SimpleIconSelector
2
+
3
+ A selector, with icons, that is simple.
4
+
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ gem 'volt-simple_icon_selector'
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install volt-simple_icon_selector
19
+
20
+ ## Usage
21
+
22
+ ```<:icon_selector options="{{options}}" selected="{{selected_option}}" />```
23
+
24
+ ```options``` must be an array of hashes with name and icon keys, like so:
25
+
26
+ ```
27
+ options = [
28
+ {
29
+ name: 'Euros',
30
+ icon: 'euro'
31
+ },
32
+ {
33
+ name: 'Pounds',
34
+ icon: 'gbp'
35
+ },
36
+ {
37
+ name: 'US Dollars',
38
+ icon: 'usd'
39
+ }
40
+ ]
41
+ ```
42
+ Uses [Font Awesome icons](http://fontawesome.io/icons/).
43
+
44
+ ```selected_option``` must correspond with the *name* of one of the options.
45
+
46
+
47
+ ## Contributing
48
+
49
+ 1. Fork it ( http://github.com/neurodynamic/volt-simple_icon_selector/fork )
50
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
51
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
52
+ 4. Push to the branch (`git push origin my-new-feature`)
53
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,35 @@
1
+ .selector {
2
+ text-align: center;
3
+ margin: auto;
4
+
5
+ .option {
6
+ display: inline-block;
7
+ padding: 12px;
8
+ margin: 10px;
9
+ font-size: 16px;
10
+ min-width: 100px;
11
+ color: black;
12
+
13
+ -moz-border-radius: 24px;
14
+ -webkit-border-radius: 24px;
15
+ -khtml-border-radius: 24px;
16
+ border-radius: 24px;
17
+
18
+ &.selected {
19
+ background-color: rgba(0,0,0,0.25);
20
+ }
21
+
22
+ &:focus {
23
+ text-decoration: none;
24
+ }
25
+
26
+ &:hover {
27
+ cursor: pointer;
28
+ background-color: rgba(0,0,0,0.15);
29
+
30
+ &.selected {
31
+ background-color: rgba(0,0,0,0.35);
32
+ }
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,2 @@
1
+ # Component dependencies
2
+ component 'font_awesome'
@@ -0,0 +1,15 @@
1
+ module SimpleIconSelector
2
+ class MainController < Volt::ModelController
3
+ def options
4
+ attrs.options
5
+ end
6
+
7
+ def select(option)
8
+ attrs.selected = option[:name]
9
+ end
10
+
11
+ def selected_class(option)
12
+ 'selected' if option[:name] == attrs.selected
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ <div class="selector">
2
+
3
+ {{ options.each do |option| }}
4
+
5
+ <a href="#" e-click="select(option)" class="option {{selected_class(option)}}">
6
+
7
+ <i class='fa fa-3x fa-{{ option[:icon] }}'></i>
8
+ <div class="name">
9
+ {{ option[:name] }}
10
+ </a>
11
+ </div>
12
+
13
+ {{ end }}
14
+
15
+ </div>
@@ -0,0 +1,18 @@
1
+ # If you need to require in code in the gem's app folder, keep in mind that
2
+ # the app is not on the load path when the gem is required. Use
3
+ # app/{gemname}/config/initializers/boot.rb to require in client or server
4
+ # code.
5
+ #
6
+ # Also, in volt apps, you typically use the lib folder in the
7
+ # app/{componentname} folder instead of this lib folder. This lib folder is
8
+ # for setting up gem code when Bundler.require is called. (or the gem is
9
+ # required.)
10
+ #
11
+ # If you need to configure volt in some way, you can add a Volt.configure block
12
+ # in this file.
13
+
14
+ module Volt
15
+ module SimpleIconSelector
16
+ # Your code goes here...
17
+ end
18
+ end
@@ -0,0 +1,5 @@
1
+ module Volt
2
+ module SimpleIconSelector
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,14 @@
1
+ # Volt sets up rspec and capybara for testing.
2
+ require 'volt/spec/setup'
3
+ Volt.spec_setup
4
+
5
+ RSpec.configure do |config|
6
+ config.run_all_when_everything_filtered = true
7
+ config.filter_run :focus
8
+
9
+ # Run specs in random order to surface order dependencies. If you find an
10
+ # order dependency and want to debug it, you can fix the order by providing
11
+ # the seed, which is printed after each run.
12
+ # --seed 1234
13
+ config.order = 'random'
14
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe Volt::SimpleIconSelector do
4
+ it 'should have a version number' do
5
+ expect(Volt::SimpleIconSelector::VERSION).not_to be nil
6
+ end
7
+
8
+ it 'should do something useful' do
9
+ expect(false).to be true
10
+ end
11
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'volt/simple_icon_selector/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "volt-simple_icon_selector"
8
+ spec.version = Volt::SimpleIconSelector::VERSION
9
+ spec.authors = ["Neurodynamic"]
10
+ spec.email = ["developer@neurodynamic.io"]
11
+ spec.summary = %q{A simple icon selector for the Volt Framework.}
12
+ spec.description = %q{}
13
+ spec.homepage = ""
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 "volt", "~> 0.9.0"
22
+ spec.add_development_dependency "volt-font_awesome"
23
+ spec.add_development_dependency 'rspec', '~> 3.2.0'
24
+ spec.add_development_dependency "rake"
25
+ end
metadata ADDED
@@ -0,0 +1,118 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: volt-simple_icon_selector
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Neurodynamic
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-07-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: volt
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.9.0
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.9.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: volt-font_awesome
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
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 3.2.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 3.2.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: ''
70
+ email:
71
+ - developer@neurodynamic.io
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".rspec"
78
+ - CODE_OF_CONDUCT.md
79
+ - Gemfile
80
+ - LICENSE.txt
81
+ - README.md
82
+ - Rakefile
83
+ - app/icon_selector/assets/css/icon_selector.scss
84
+ - app/icon_selector/config/dependencies.rb
85
+ - app/icon_selector/controllers/main_controller.rb
86
+ - app/icon_selector/views/main/index.html
87
+ - lib/volt/simple_icon_selector.rb
88
+ - lib/volt/simple_icon_selector/version.rb
89
+ - spec/spec_helper.rb
90
+ - spec/volt/simple_icon_selector_spec.rb
91
+ - volt-simple_icon_selector.gemspec
92
+ homepage: ''
93
+ licenses:
94
+ - MIT
95
+ metadata: {}
96
+ post_install_message:
97
+ rdoc_options: []
98
+ require_paths:
99
+ - lib
100
+ required_ruby_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ required_rubygems_version: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ requirements: []
111
+ rubyforge_project:
112
+ rubygems_version: 2.4.5
113
+ signing_key:
114
+ specification_version: 4
115
+ summary: A simple icon selector for the Volt Framework.
116
+ test_files:
117
+ - spec/spec_helper.rb
118
+ - spec/volt/simple_icon_selector_spec.rb