simple_form_attachments 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41b3b4abe24b321d237b831f0b7c674ad77a3d22
4
- data.tar.gz: 4f81d7a6e9578b666a09420d587ddba141c2cc91
3
+ metadata.gz: 75d8e9396efb588b4dffa12c91aeba4416933ea4
4
+ data.tar.gz: d397b0c78369aafb384aec012b86878c106d2a0e
5
5
  SHA512:
6
- metadata.gz: cdb12404eaac4a1b511093337bf8d2a420d4b1d749dcad02d8f75773d5c8c42bad8fd9cea39e2da9f70a4903b06f74107635a2f19b8c970847e0e1504cabb524
7
- data.tar.gz: 49d7b7f414e734c2a746ff4a237ba83796a360444e27c9858fd25554c9a6cfe6816dfcd7a7e2c8a9f79dd0de1b4f6b4a2e7bf7b4a4686624a67c059ceb92a51a
6
+ metadata.gz: 7e25e24f7adb571ffe350168aae72539d2cb2205e021b9cdc2e42d331cb469fd10eab49ace5c85ac91eca5e8ea52b8df6cd9caf08272e8204ed3846edcac6582
7
+ data.tar.gz: f765ad02d7674232ad72ceded36afabea16a8b0e91376cfdaf18c822653c5b0cb444a0be784b008c32d01a23f488f89592e68114cba31973ff035a89d5fc00f6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_form_attachments (0.2.2)
4
+ simple_form_attachments (0.2.3)
5
5
  jquery-ui-rails
6
6
  rails (>= 4.2)
7
7
  rails-assets-blueimp-file-upload (>= 9.6.0)
@@ -53,7 +53,7 @@ GEM
53
53
  bson (3.2.6)
54
54
  builder (3.2.2)
55
55
  coderay (1.1.0)
56
- concurrent-ruby (1.0.0)
56
+ concurrent-ruby (1.0.1)
57
57
  connection_pool (2.2.0)
58
58
  coveralls (0.8.10)
59
59
  json (~> 1.8)
@@ -146,16 +146,16 @@ GEM
146
146
  bundler (>= 1.3.0, < 2.0)
147
147
  railties (= 4.2.5)
148
148
  sprockets-rails
149
- rails-assets-blueimp-canvas-to-blob (3.1.0)
150
- rails-assets-blueimp-file-upload (9.11.2)
149
+ rails-assets-blueimp-canvas-to-blob (3.3.0)
150
+ rails-assets-blueimp-file-upload (9.12.1)
151
151
  rails-assets-blueimp-canvas-to-blob (>= 2.1.1)
152
152
  rails-assets-blueimp-load-image (>= 1.13.0)
153
153
  rails-assets-blueimp-tmpl (>= 2.5.4)
154
154
  rails-assets-jquery (>= 1.6)
155
- rails-assets-blueimp-load-image (2.1.0)
156
- rails-assets-blueimp-tmpl (3.1.0)
155
+ rails-assets-blueimp-load-image (2.6.1)
156
+ rails-assets-blueimp-tmpl (3.3.0)
157
157
  rails-assets-handlebars (4.0.5)
158
- rails-assets-jquery (2.2.0)
158
+ rails-assets-jquery (2.2.2)
159
159
  rails-deprecated_sanitizer (1.0.3)
160
160
  activesupport (>= 4.2.0.alpha)
161
161
  rails-dom-testing (1.0.7)
@@ -193,7 +193,7 @@ GEM
193
193
  sprockets (3.5.2)
194
194
  concurrent-ruby (~> 1.0)
195
195
  rack (> 1, < 3)
196
- sprockets-rails (3.0.0)
196
+ sprockets-rails (3.0.4)
197
197
  actionpack (>= 4.0)
198
198
  activesupport (>= 4.0)
199
199
  sprockets (>= 3.0.0)
@@ -1,12 +1,12 @@
1
1
  tr.attachment class=('uploaded' if attachment.present? && attachment.errors.to_a.blank?)
2
2
  td.handle
3
3
 
4
+ = yield
5
+
4
6
  td.hidden
5
7
  = fields.hidden_field :id
6
8
  = form.hidden_field(relation_key, multiple: multiple, value: attachment.id) if attachment.errors.empty?
7
9
 
8
- = yield
9
-
10
10
  td.cancel.delete.close
11
11
  - if attachment.errors.to_a.any?
12
12
  button.button.close = I18n.t(:close, scope: 'simple_form_attachments.buttons')
@@ -14,6 +14,7 @@
14
14
  items: '> tr'
15
15
  forcePlaceholderSize: true
16
16
  placeholder: 'attachment-placeholder'
17
+ containment: 'parent'
17
18
  start: (event, ui) ->
18
19
  cellCount = 0
19
20
  $('td, th', ui.helper).each ->
@@ -1,3 +1,3 @@
1
1
  module SimpleFormAttachments
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -37,11 +37,6 @@ body {
37
37
 
38
38
  // --------------------------------------------------------------------
39
39
 
40
- input[type="file"] {
41
- margin: 0;
42
- padding: 0;
43
- }
44
-
45
40
  div.input.attachment {
46
41
  label[for="attachment_file"] {
47
42
  margin-bottom: $default-line-height;
@@ -51,176 +46,188 @@ div.input.attachment {
51
46
  }
52
47
  }
53
48
 
54
- table.attachments.list {
55
- width: 100%;
56
- margin-bottom: $default-line-height;
57
- border-collapse: collapse;
58
-
59
- // ---------------------------------------------------------------------
49
+ div.simple_form_attachments {
60
50
 
61
- &.sortable {
62
- tr.attachment {
63
- td.handle {
64
- display: table-cell;
65
- }
66
- }
51
+ input[type="file"] {
52
+ margin: 0;
53
+ padding: 0;
67
54
  }
68
55
 
69
56
  // ---------------------------------------------------------------------
70
57
 
71
- tr.attachment-placeholder,
72
- tr.attachment {
58
+ table.attachments.list {
73
59
  width: 100%;
74
- height: $image-height + ($padding-large*2);
75
- }
60
+ margin-bottom: $default-line-height;
61
+ border-collapse: collapse;
76
62
 
77
- tr.attachment {
78
- background-color: #eee;
79
- border-bottom: 1px solid white;
63
+ // ---------------------------------------------------------------------
80
64
 
81
- &.has_error {
82
- color: red;
83
- background-color: pink;
84
- width: 100%;
85
- height: $image-height + ($padding-large*2);
86
-
87
- td.handle {
88
- color: transparent;
89
- text-shadow: none;
90
- border-right: 0;
65
+ &.sortable {
66
+ tr.attachment {
67
+ td.handle {
68
+ display: table-cell;
69
+ }
91
70
  }
92
71
  }
93
72
 
94
- td.handle {
95
- display: none;
96
- content: '....';
97
- border-right: 1px solid #FFF;
98
- padding: 0 $padding $padding-large $padding;
99
- overflow: hidden;
100
- cursor: move;
101
- margin-top: -20px;
102
- vertical-align: middle;
103
- font-size: 12px;
104
- line-height: 5px;
105
- font-family: sans-serif;
106
- letter-spacing: 2px;
107
- color: #aaa;
108
- text-shadow: 1px 0 1px #eee;
109
- width: 10px;
110
-
111
- &:after {
112
- content: '.. .. .. ..';
113
- }
114
- }
73
+ // ---------------------------------------------------------------------
115
74
 
116
- td.hidden {
117
- display: none;
75
+ tr.attachment-placeholder,
76
+ tr.attachment {
77
+ width: 100%;
78
+ height: $image-height + ($padding-large*2);
118
79
  }
119
80
 
120
- td {
121
- padding: $padding-large;
81
+ tr.attachment {
82
+ background-color: #eee;
83
+ border-bottom: 1px solid white;
84
+
85
+ &.has_error {
86
+ color: red;
87
+ background-color: pink;
88
+ width: 100%;
89
+ height: $image-height + ($padding-large*2);
122
90
 
123
- &:first-child {
124
- border-top-left-radius: 2px;
125
- border-bottom-left-radius: 2px;
126
- max-width: $padding-large*2;
91
+ td.handle {
92
+ color: transparent;
93
+ text-shadow: none;
94
+ border-right: 0;
95
+ }
127
96
  }
128
97
 
129
- &:last-child {
130
- border-top-right-radius: 2px;
131
- border-bottom-right-radius: 2px;
98
+ td.handle {
99
+ display: none;
100
+ content: '....';
101
+ border-right: 1px solid #FFF;
102
+ padding: 0 $padding $padding-large $padding;
103
+ overflow: hidden;
104
+ cursor: move;
105
+ margin-top: -20px;
106
+ vertical-align: middle;
107
+ font-size: 12px;
108
+ line-height: 5px;
109
+ font-family: sans-serif;
110
+ letter-spacing: 2px;
111
+ color: #aaa;
112
+ text-shadow: 1px 0 1px #eee;
113
+ width: 10px;
114
+
115
+ &:after {
116
+ content: '.. .. .. ..';
117
+ }
132
118
  }
133
- }
134
119
 
135
- td.thumb {
136
- width: $image-height + ($padding-large*2);
120
+ td.hidden {
121
+ display: none;
122
+ }
137
123
 
138
- div.thumb {
139
- width: $image-height;
140
- height: $image-height;
141
- background-position: center center;
142
- background-repeat: no-repeat;
143
- overflow: hidden;
124
+ td {
125
+ padding: $padding-large;
126
+
127
+ &:first-child {
128
+ border-top-left-radius: 2px;
129
+ border-bottom-left-radius: 2px;
130
+ max-width: $padding-large*2;
131
+ }
132
+
133
+ &:last-child {
134
+ border-top-right-radius: 2px;
135
+ border-bottom-right-radius: 2px;
136
+ }
137
+ }
144
138
 
145
- img {
139
+ td.thumb {
140
+ width: $image-height + ($padding-large*2);
141
+
142
+ div.thumb {
146
143
  width: $image-height;
147
144
  height: $image-height;
148
- object-fit: cover;
149
- object-position: center;
145
+ background-position: center center;
146
+ background-repeat: no-repeat;
147
+ overflow: hidden;
148
+
149
+ img {
150
+ width: $image-height;
151
+ height: $image-height;
152
+ object-fit: cover;
153
+ object-position: center;
154
+ }
150
155
  }
151
156
  }
152
- }
153
157
 
154
- td.file_info {
155
- @include small-font-size;
156
- text-overflow: ellipsis;
157
- white-space: nowrap;
158
- overflow: hidden;
158
+ td.file_info {
159
+ @include small-font-size;
160
+ text-overflow: ellipsis;
161
+ white-space: nowrap;
162
+ overflow: hidden;
159
163
 
160
- span {
161
- display: block;
164
+ span {
165
+ display: block;
162
166
 
163
- &.size {
164
- &:after {
165
- content: ' KB';
167
+ &.size {
168
+ &:after {
169
+ content: ' KB';
170
+ }
166
171
  }
167
172
  }
168
173
  }
169
- }
170
174
 
171
- td.size {
172
- @include small-font-size;
173
- }
175
+ td.size {
176
+ @include small-font-size;
177
+ }
174
178
 
175
- td.errors {
176
- @include small-font-size;
177
- ul.errors {
178
- list-style: none;
179
- padding: 0;
180
- margin: 0;
181
- li.error {}
179
+ td.errors {
180
+ @include small-font-size;
181
+ ul.errors {
182
+ list-style: none;
183
+ padding: 0;
184
+ margin: 0;
185
+ li.error {}
186
+ }
182
187
  }
183
- }
184
188
 
185
- td.fields {
186
- input {
187
- width: 100%;
188
- max-width: 500px;
189
+ td.fields {
190
+ input {
191
+ width: 100%;
192
+ max-width: 500px;
193
+ }
189
194
  }
190
- }
191
195
 
192
- td.progress {
193
- div.progress.container {
194
- background-color: #ccc;
195
- width: 100%;
196
- max-width: 500px;
196
+ td.progress {
197
+ div.progress.container {
198
+ background-color: #ccc;
199
+ width: 100%;
200
+ max-width: 500px;
197
201
 
198
- div.progress.bar {
199
- background-color: blue;
200
- width: 0;
201
- height: 20px;
202
+ div.progress.bar {
203
+ background-color: blue;
204
+ width: 0;
205
+ height: 20px;
206
+ }
202
207
  }
203
208
  }
204
- }
205
209
 
206
- td.cancel.delete.close {
207
- white-space: nowrap;
208
- width: 1%;
210
+ td.cancel.delete.close {
211
+ white-space: nowrap;
212
+ width: 1%;
209
213
 
210
- button.close {
211
- // @include font-awesome-before('\f00d');
212
- &:before {
213
- content: "\00D7";
214
+ button.close {
215
+ // @include font-awesome-before('\f00d');
216
+ &:before {
217
+ content: "\00D7";
218
+ }
219
+ margin-right: $padding-large;
220
+ color: red;
214
221
  }
215
- margin-right: $padding-large;
216
- color: red;
217
222
  }
218
223
  }
219
224
  }
220
- }
221
225
 
222
- &.dragover {
223
- border-radius: 2px;
224
- outline: 6px solid yellow;
226
+ // ---------------------------------------------------------------------
227
+
228
+ &.dragover {
229
+ border-radius: 2px;
230
+ outline: 1px solid yellow;
231
+ }
225
232
  }
226
233
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_attachments
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-14 00:00:00.000000000 Z
12
+ date: 2016-03-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -388,7 +388,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
388
388
  version: '0'
389
389
  requirements: []
390
390
  rubyforge_project:
391
- rubygems_version: 2.4.6
391
+ rubygems_version: 2.4.8
392
392
  signing_key:
393
393
  specification_version: 4
394
394
  summary: A Rails engine which takes care of creating Attachments using the jQuery