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 +4 -4
- data/Gemfile.lock +8 -8
- data/app/views/layouts/simple_form_attachments/_attachment_layout.html.slim +2 -2
- data/lib/assets/javascripts/simple_form_attachments/simple_form_attachments.js.coffee +1 -0
- data/lib/simple_form_attachments/version.rb +1 -1
- data/test/dummy/app/assets/stylesheets/tests.scss +136 -129
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75d8e9396efb588b4dffa12c91aeba4416933ea4
|
4
|
+
data.tar.gz: d397b0c78369aafb384aec012b86878c106d2a0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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.
|
150
|
-
rails-assets-blueimp-file-upload (9.
|
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
|
156
|
-
rails-assets-blueimp-tmpl (3.
|
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.
|
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.
|
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')
|
@@ -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
|
-
|
55
|
-
width: 100%;
|
56
|
-
margin-bottom: $default-line-height;
|
57
|
-
border-collapse: collapse;
|
58
|
-
|
59
|
-
// ---------------------------------------------------------------------
|
49
|
+
div.simple_form_attachments {
|
60
50
|
|
61
|
-
|
62
|
-
|
63
|
-
|
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
|
-
|
72
|
-
tr.attachment {
|
58
|
+
table.attachments.list {
|
73
59
|
width: 100%;
|
74
|
-
|
75
|
-
|
60
|
+
margin-bottom: $default-line-height;
|
61
|
+
border-collapse: collapse;
|
76
62
|
|
77
|
-
|
78
|
-
background-color: #eee;
|
79
|
-
border-bottom: 1px solid white;
|
63
|
+
// ---------------------------------------------------------------------
|
80
64
|
|
81
|
-
&.
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
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
|
-
|
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
|
-
|
117
|
-
|
75
|
+
tr.attachment-placeholder,
|
76
|
+
tr.attachment {
|
77
|
+
width: 100%;
|
78
|
+
height: $image-height + ($padding-large*2);
|
118
79
|
}
|
119
80
|
|
120
|
-
|
121
|
-
|
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
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
91
|
+
td.handle {
|
92
|
+
color: transparent;
|
93
|
+
text-shadow: none;
|
94
|
+
border-right: 0;
|
95
|
+
}
|
127
96
|
}
|
128
97
|
|
129
|
-
|
130
|
-
|
131
|
-
|
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
|
-
|
136
|
-
|
120
|
+
td.hidden {
|
121
|
+
display: none;
|
122
|
+
}
|
137
123
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
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
|
-
|
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
|
-
|
149
|
-
|
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
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
158
|
+
td.file_info {
|
159
|
+
@include small-font-size;
|
160
|
+
text-overflow: ellipsis;
|
161
|
+
white-space: nowrap;
|
162
|
+
overflow: hidden;
|
159
163
|
|
160
|
-
|
161
|
-
|
164
|
+
span {
|
165
|
+
display: block;
|
162
166
|
|
163
|
-
|
164
|
-
|
165
|
-
|
167
|
+
&.size {
|
168
|
+
&:after {
|
169
|
+
content: ' KB';
|
170
|
+
}
|
166
171
|
}
|
167
172
|
}
|
168
173
|
}
|
169
|
-
}
|
170
174
|
|
171
|
-
|
172
|
-
|
173
|
-
|
175
|
+
td.size {
|
176
|
+
@include small-font-size;
|
177
|
+
}
|
174
178
|
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
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
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
+
td.fields {
|
190
|
+
input {
|
191
|
+
width: 100%;
|
192
|
+
max-width: 500px;
|
193
|
+
}
|
189
194
|
}
|
190
|
-
}
|
191
195
|
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
196
|
+
td.progress {
|
197
|
+
div.progress.container {
|
198
|
+
background-color: #ccc;
|
199
|
+
width: 100%;
|
200
|
+
max-width: 500px;
|
197
201
|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
+
div.progress.bar {
|
203
|
+
background-color: blue;
|
204
|
+
width: 0;
|
205
|
+
height: 20px;
|
206
|
+
}
|
202
207
|
}
|
203
208
|
}
|
204
|
-
}
|
205
209
|
|
206
|
-
|
207
|
-
|
208
|
-
|
210
|
+
td.cancel.delete.close {
|
211
|
+
white-space: nowrap;
|
212
|
+
width: 1%;
|
209
213
|
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
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
|
-
|
223
|
-
|
224
|
-
|
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.
|
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-
|
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.
|
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
|