pieces-rails 0.3.20

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,89 @@
1
+ // Global
2
+ //
3
+ // colors
4
+ $white: #ffffff
5
+ $light-grey: #d7d7d7
6
+ $grey-text: #858585
7
+ $blue-link: #007fe3
8
+ $popup-grey: #fcfcfc
9
+ $black: #000000
10
+ $red: #ff1313
11
+ $light-red: #ffc5c5
12
+ $light-green: #bfd9bf
13
+ $grey: #4b4b4b
14
+ $grey-bg: #f3f3f3
15
+
16
+ // Z-indeces
17
+
18
+ $ground: 5
19
+ $first: 10
20
+ $second: 20
21
+ $third: 30
22
+ $heaven: 100000
23
+ $hell: 0
24
+
25
+ // fonts
26
+ $font-family: 'Helvetica', sans !default
27
+ $font-size-small: 10px !default
28
+ $font-size-normal: 12px !default
29
+ $font-size-base: 13px !default
30
+ $font-size-title: 15px !default
31
+ $font-size-big: 20px !default
32
+ $font-size-large: 26px !default
33
+
34
+ /// Button
35
+ $btn-height: 30px
36
+ $red-button: #f10028
37
+ $red-button-border: #d10033
38
+ $grey-btn-text: #5a5a5a
39
+ $grey-button: #f7f7f7
40
+ $grey-button-border: #d7d7d7
41
+ $green-button: #11b700
42
+ $green-button-border: #10a100
43
+ $blue-button: #0090ff
44
+ $blue-button-border: #007de6
45
+
46
+ // Checkbox
47
+ $cb-color: #858585
48
+ $cb-focus-color: #007fe3
49
+
50
+ // SearchInput
51
+ $search-left-pad: 10px
52
+ $search-right-pad: 30px
53
+ $search-total-pad: ($search-right-pad + $search-left-pad)
54
+
55
+ // List
56
+ $grey-list-border: #e8e8e8
57
+ $item-selected: #fffdd9
58
+ $item-hover: #fffef2
59
+
60
+
61
+ @import 'easings'
62
+
63
+ // Mixins
64
+
65
+ @mixin font($size, $color: $black, $bold:false)
66
+ font-family: $font-family
67
+ color: $color
68
+ @if $bold
69
+ font-weight: bold
70
+ @else
71
+ font-weight: normal
72
+ font-size: $size
73
+
74
+ @mixin dotted($color)
75
+ color: $color
76
+ cursor: pointer
77
+ border-bottom: 1px dotted $color
78
+ text-decoration: none
79
+ &:hover
80
+ border-width: 0
81
+
82
+ // Placeholders
83
+ %centered
84
+ margin: 0 auto
85
+
86
+ %focusable
87
+ transition: box-shadow 300ms
88
+ &:focus
89
+ box-shadow: 0 0 2px 2px $light-grey
@@ -0,0 +1,75 @@
1
+ module Pieces
2
+ module Rails
3
+ module PiHelper
4
+ def pi_text_field(options={}, &block)
5
+ merge_class! options, 'pi-text-input-wrap pi'
6
+ content_tag(:div, nil, options) do
7
+ concat capture(&block)
8
+ end
9
+ end
10
+
11
+ def pi_select_field(name, val, placeholder='', items=[], options={})
12
+ merge_class! options, "pi-select-field pi"
13
+ merge_data! options, {:name => name, "default-value" => val}
14
+ list_options = (options[:dropdown]||{}).merge(pid: "dropdown")
15
+ merge_class! list_options, 'pi is-hidden list-container pi-select-list'
16
+ options.delete :dropdown
17
+ content_tag(:div, nil, options) do
18
+ concat hidden_field_tag(options[:hidden_name], val)
19
+ concat content_tag(:div, placeholder, class: 'pi placeholder', pid: "placeholder", data:{placeholder: placeholder})
20
+ concat(
21
+ content_tag(:div, nil, list_options) do
22
+ content_tag(:ul, nil, class: 'list') do
23
+ items.each do |item|
24
+ concat content_tag(:li, item[:name], {:class => 'item', "data-value" => item[:value]})
25
+ end
26
+ end
27
+ end
28
+ )
29
+ end
30
+ end
31
+
32
+ def pi_search_field(name = 'keyword', placeholder ='', options = {})
33
+ merge_class! options,'pi-search-field pi'
34
+ content_tag(:div, nil, options) do
35
+ concat content_tag(:i, nil, {:class => 'pi reset-btn fa fa-times', "data-on-click" => "@host.reset"})
36
+ concat text_field_tag(name,nil, class: "text-input", placeholder: placeholder)
37
+ end
38
+ end
39
+
40
+ def pi_checkbox(name = nil, val = nil, label = '', options = {})
41
+ merge_class! options,'pi-checkbox-wrap pi'
42
+ content_tag(:div, nil, options) do
43
+ concat hidden_field_tag(name, val)
44
+ concat label
45
+ end
46
+ end
47
+
48
+ def pi_stepper(options = {},&block)
49
+ merge_class! options,'pi-stepper pi'
50
+ content_tag(:div, nil, options) do
51
+ concat capture(&block)
52
+ concat content_tag(:span, nil, class: 'step step-up')
53
+ concat content_tag(:span, nil, class: 'step step-down')
54
+ end
55
+ end
56
+
57
+ def pi_file_upload(name=nil, label='', options = {})
58
+ merge_class! options,'pi-file-input-wrap pi'
59
+ content_tag(:div, nil, options) do
60
+ concat label
61
+ concat file_field_tag name, class: 'file-input'
62
+ end
63
+ end
64
+
65
+ protected
66
+ def merge_class!(options,klass)
67
+ options[:class] = (options[:class] ? "#{options[:class]} " : '') << klass
68
+ end
69
+
70
+ def merge_data!(options,data)
71
+ options[:data] = (options[:data] ? options[:data] : {}).merge(data)
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,3 @@
1
+ require "pieces/rails/version"
2
+ require "pieces/rails/railtie"
3
+ require "pieces/rails/engine" if defined?(::Rails)
@@ -0,0 +1,6 @@
1
+ module Pieces
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,17 @@
1
+ module Pieces
2
+ module Rails
3
+ def self.install_to_slim!
4
+ shortcut = Slim::Parser.default_options[:shortcut]
5
+ shortcut['@'] = { attr: 'data-pid'}
6
+ shortcut['@@'] = { attr: 'data-component'}
7
+ Slim::Engine.default_options[:merge_attrs]['data-pid'] = ' '
8
+ Slim::Engine.default_options[:merge_attrs]['data-component'] = ' '
9
+ end
10
+
11
+ class Railtie < ::Rails::Railtie
12
+ initializer "pieces.slim" do
13
+ Pieces::Rails.install_to_slim! if defined?(Slim::Parser)
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,5 @@
1
+ module Pieces
2
+ module Rails
3
+ VERSION = "0.3.20"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,133 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pieces-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.20
5
+ platform: ruby
6
+ authors:
7
+ - palkan
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: railties
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '4.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '5.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '4.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '5.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: activesupport
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: bundler
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '1.5'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '1.5'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rake
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ description: ''
76
+ email:
77
+ - dementiev.vm@gmail.com
78
+ executables: []
79
+ extensions: []
80
+ extra_rdoc_files: []
81
+ files:
82
+ - LICENSE.txt
83
+ - README.md
84
+ - app/assets/javascripts/pieces.js
85
+ - app/assets/stylesheets/pieces.css.sass
86
+ - app/assets/stylesheets/pieces/_all.css.sass
87
+ - app/assets/stylesheets/pieces/_button.css.sass
88
+ - app/assets/stylesheets/pieces/_checkbox.css.sass
89
+ - app/assets/stylesheets/pieces/_easings.css.sass
90
+ - app/assets/stylesheets/pieces/_file_input.css.sass
91
+ - app/assets/stylesheets/pieces/_form.css.sass
92
+ - app/assets/stylesheets/pieces/_main.css.sass
93
+ - app/assets/stylesheets/pieces/_popup.css.sass
94
+ - app/assets/stylesheets/pieces/_progressbar.css.sass
95
+ - app/assets/stylesheets/pieces/_radio_group.css.sass
96
+ - app/assets/stylesheets/pieces/_scroller.css.sass
97
+ - app/assets/stylesheets/pieces/_search_field.css.sass
98
+ - app/assets/stylesheets/pieces/_select_field.css.sass
99
+ - app/assets/stylesheets/pieces/_sort_button.css.sass
100
+ - app/assets/stylesheets/pieces/_stepper.css.sass
101
+ - app/assets/stylesheets/pieces/_text_input.css.sass
102
+ - app/assets/stylesheets/pieces/_vars.css.sass
103
+ - app/helpers/pieces/rails/pi_helper.rb
104
+ - lib/pieces/rails.rb
105
+ - lib/pieces/rails/engine.rb
106
+ - lib/pieces/rails/railtie.rb
107
+ - lib/pieces/rails/version.rb
108
+ homepage: ''
109
+ licenses:
110
+ - MIT
111
+ metadata: {}
112
+ post_install_message:
113
+ rdoc_options: []
114
+ require_paths:
115
+ - lib
116
+ required_ruby_version: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - ">="
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
121
+ required_rubygems_version: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ requirements: []
127
+ rubyforge_project:
128
+ rubygems_version: 2.2.2
129
+ signing_key:
130
+ specification_version: 4
131
+ summary: pieces.js for rails
132
+ test_files: []
133
+ has_rdoc: