lalala 4.1.0.dev.322 → 4.1.0.dev.324
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/lalala/modules/multiple-files-uploader.module.js +3 -0
- data/app/assets/javascripts/lalala/modules/single-file-uploader.module.js +1 -0
- data/app/assets/stylesheets/lalala/modules/_multiple-file-uploader.css.scss +6 -2
- data/app/assets/stylesheets/lalala/modules/_single-file-uploader.css.scss +106 -3
- data/lib/formtastic/inputs/multiple_files_input.rb +4 -0
- data/lib/formtastic/inputs/single_file_input.rb +11 -3
- data/lib/lalala/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fd9c3d041be7883f1e339e76504fe7da24a6f5c
|
4
|
+
data.tar.gz: 77df2687bd1950d45d43e579b27b16371abcd917
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30745adbc31c0ef5bc0ba9a96994376866d3eebe827791ca6590f1553bcfdc6fa4bac0ebc97c3fd1ddf5ba86c4bc9e4a60bd762b64649642871c27549f298404
|
7
|
+
data.tar.gz: dcebce27e01f21076000b67f7be1175fa66c59558f2f9cf2c34ebfe305a95cd510c08384a38f433962e915406a762eceee27657e9b5cfce6da74c51d55717156
|
@@ -210,6 +210,9 @@ MultipleFilesUploader.prototype.file_done_handler = function(e) {
|
|
210
210
|
this.$el.removeClass("processing");
|
211
211
|
this.$el.addClass("uploaded");
|
212
212
|
|
213
|
+
// title
|
214
|
+
this.$el.find(".title").html(this.metadata.file_name);
|
215
|
+
|
213
216
|
// attr
|
214
217
|
var id = this.$el.find("input[name$=\"[id]\"]").val();
|
215
218
|
if (id) this.$el.attr("data-src-original", "//c.assets.sh/" + id + "/thumb");
|
@@ -45,8 +45,8 @@ x-files[multiple-files] {
|
|
45
45
|
border-right: 1px solid #E2E2E2;
|
46
46
|
float: left;
|
47
47
|
width: 40%;
|
48
|
-
|
49
|
-
|
48
|
+
|
49
|
+
@include calc(width, "40% - 1px");
|
50
50
|
|
51
51
|
.name {
|
52
52
|
padding-left: 4px;
|
@@ -167,7 +167,10 @@ x-files[multiple-files] {
|
|
167
167
|
// X-file -- Menu
|
168
168
|
//
|
169
169
|
x-file .menu {
|
170
|
+
bottom: 6px;
|
171
|
+
left: 8px;
|
170
172
|
display: none;
|
173
|
+
position: absolute;
|
171
174
|
|
172
175
|
a {
|
173
176
|
background-position: center;
|
@@ -216,6 +219,7 @@ x-files[multiple-files] {
|
|
216
219
|
> div {
|
217
220
|
left: 0;
|
218
221
|
top: 0;
|
222
|
+
width: 0;
|
219
223
|
}
|
220
224
|
}
|
221
225
|
|
@@ -8,6 +8,7 @@ x-files[single-file] {
|
|
8
8
|
color: #6F6F71;
|
9
9
|
display: block;
|
10
10
|
font-size: 12px;
|
11
|
+
font-weight: bold;
|
11
12
|
height: 38px;
|
12
13
|
line-height: 38px;
|
13
14
|
margin: 31px 0 45px;
|
@@ -30,7 +31,6 @@ x-files[single-file] {
|
|
30
31
|
.association {
|
31
32
|
display: inline-block;
|
32
33
|
font-size: 14px;
|
33
|
-
font-weight: bold;
|
34
34
|
line-height: 16px;
|
35
35
|
margin-left: 2px;
|
36
36
|
position: relative;
|
@@ -63,7 +63,6 @@ x-files[single-file] {
|
|
63
63
|
color: #CDCDCD;
|
64
64
|
cursor: pointer;
|
65
65
|
display: inline-block;
|
66
|
-
font-weight: bold;
|
67
66
|
line-height: 24px;
|
68
67
|
padding-left: 22px;
|
69
68
|
padding-top: 2px;
|
@@ -80,14 +79,16 @@ x-files[single-file] {
|
|
80
79
|
//
|
81
80
|
.content {
|
82
81
|
@include calc(width, "80% - 101px - 26px");
|
82
|
+
height: 38px;
|
83
83
|
position: absolute;
|
84
84
|
right: 0;
|
85
85
|
top: 0;
|
86
86
|
}
|
87
87
|
|
88
|
+
// image
|
88
89
|
.image {
|
89
90
|
float: left;
|
90
|
-
height:
|
91
|
+
height: 100%;
|
91
92
|
width: 58px;
|
92
93
|
}
|
93
94
|
|
@@ -117,14 +118,116 @@ x-files[single-file] {
|
|
117
118
|
);
|
118
119
|
}
|
119
120
|
|
121
|
+
// title
|
122
|
+
.title {
|
123
|
+
color: #a3a3a3;
|
124
|
+
float: left;
|
125
|
+
margin: 0 19px;
|
126
|
+
overflow: hidden;
|
127
|
+
text-overflow: ellipsis;
|
128
|
+
white-space: nowrap;
|
129
|
+
width: 120px;
|
130
|
+
|
131
|
+
.name {
|
132
|
+
display: none;
|
133
|
+
}
|
134
|
+
}
|
135
|
+
|
136
|
+
// status
|
137
|
+
.status {
|
138
|
+
display: none;
|
139
|
+
float: right;
|
140
|
+
height: 100%;
|
141
|
+
position: relative;
|
142
|
+
|
143
|
+
@include calc(width, "100% - 58px - 120px - (2 * 19px)");
|
144
|
+
|
145
|
+
.status-bar {
|
146
|
+
background-color: #e2e2e2;
|
147
|
+
height: 1px;
|
148
|
+
left: 0;
|
149
|
+
margin-top: -1px;
|
150
|
+
position: absolute;
|
151
|
+
right: 0;
|
152
|
+
top: 50%;
|
153
|
+
}
|
154
|
+
|
155
|
+
.status-bar > div {
|
156
|
+
height: 1px;
|
157
|
+
left: 0;
|
158
|
+
position: absolute;
|
159
|
+
top: 0;
|
160
|
+
width: 0;
|
161
|
+
}
|
162
|
+
|
163
|
+
.status-bar .upload-bar {
|
164
|
+
background-color: #FFC914;
|
165
|
+
box-shadow: 0 0 9px rgba(#FFC914, .75);
|
166
|
+
z-index: 1;
|
167
|
+
}
|
168
|
+
|
169
|
+
.status-bar .process-bar {
|
170
|
+
background-color: #36F269;
|
171
|
+
box-shadow: 0 0 9px rgba(#36F269, .75);
|
172
|
+
z-index: 2;
|
173
|
+
}
|
174
|
+
}
|
175
|
+
|
176
|
+
// actions
|
177
|
+
.actions {
|
178
|
+
border-left: 1px solid #E2E2E2;
|
179
|
+
display: none;
|
180
|
+
float: left;
|
181
|
+
padding-left: 19px;
|
182
|
+
}
|
183
|
+
|
120
184
|
|
121
185
|
//
|
122
186
|
// Statusses
|
123
187
|
//
|
188
|
+
&.waiting .title:after {
|
189
|
+
content: "Waiting...";
|
190
|
+
}
|
191
|
+
|
192
|
+
&.uploading .title:after {
|
193
|
+
content: "Uploading...";
|
194
|
+
}
|
195
|
+
|
196
|
+
&.processing .title:after {
|
197
|
+
content: "Processing...";
|
198
|
+
}
|
199
|
+
|
200
|
+
&.waiting,
|
201
|
+
&.uploading,
|
202
|
+
&.processing { .status {
|
203
|
+
display: block;
|
204
|
+
}}
|
205
|
+
|
206
|
+
// uploaded
|
124
207
|
&.uploaded .image canvas,
|
125
208
|
&.uploaded .image img {
|
126
209
|
opacity: 1;
|
127
210
|
}
|
128
211
|
|
212
|
+
&.uploaded .title {
|
213
|
+
@include calc(width, "100% - 260px");
|
214
|
+
|
215
|
+
.name {
|
216
|
+
display: block;
|
217
|
+
}
|
218
|
+
}
|
219
|
+
|
220
|
+
// error
|
221
|
+
&.error {
|
222
|
+
.status .status-bar {
|
223
|
+
background-color: $red;
|
224
|
+
}
|
225
|
+
|
226
|
+
.status .upload-bar,
|
227
|
+
.status .process-bar {
|
228
|
+
display: none;
|
229
|
+
}
|
230
|
+
}
|
231
|
+
|
129
232
|
|
130
233
|
}
|
@@ -141,6 +141,10 @@ class Formtastic::Inputs::MultipleFilesInput
|
|
141
141
|
#{ template.hidden_field_tag(param_key + "[][id]", asset.id) }
|
142
142
|
#{ template.hidden_field_tag(param_key + "[][_destroy]", "") }
|
143
143
|
|
144
|
+
<div class="title">
|
145
|
+
#{ asset.file_name }
|
146
|
+
</div>
|
147
|
+
|
144
148
|
<div class="attributes">
|
145
149
|
#{ input.asset_attributes_form(template, param_key, asset) }
|
146
150
|
</div>
|
@@ -11,10 +11,11 @@ class Formtastic::Inputs::SingleFileInput
|
|
11
11
|
accepts = defn.profile.try(:accepted_file_types)
|
12
12
|
accepts = accepts.join(", ") if accepts
|
13
13
|
versions = compile_versions_array(defn.profile)
|
14
|
+
css_class = asset ? "uploaded" : ""
|
14
15
|
|
15
16
|
<<-HTML
|
16
17
|
|
17
|
-
<x-files single-file profile="#{defn.profile.name}" accept="#{accepts}" name="#{param_key}">
|
18
|
+
<x-files single-file profile="#{defn.profile.name}" accept="#{accepts}" name="#{param_key}" class="#{css_class}">
|
18
19
|
<div class="association">#{ title }</div>
|
19
20
|
|
20
21
|
<div class="buttons">
|
@@ -23,14 +24,21 @@ class Formtastic::Inputs::SingleFileInput
|
|
23
24
|
|
24
25
|
<div class="content">
|
25
26
|
<div class="image">#{ asset ? image_html(asset, versions) : "" }</div>
|
27
|
+
<div class="title">
|
28
|
+
<span class="name">
|
29
|
+
#{ asset ? asset.file_name : "" }
|
30
|
+
</span>
|
31
|
+
</div>
|
26
32
|
<div class="status">
|
27
|
-
<div class="status-title"></div>
|
28
33
|
<div class="status-bar">
|
29
34
|
<div class="upload-bar"></div>
|
30
35
|
<div class="process-bar"></div>
|
31
36
|
</div>
|
32
37
|
</div>
|
33
|
-
<div class="
|
38
|
+
<div class="actions">
|
39
|
+
<a data-action="delete"></a>
|
40
|
+
<a data-action="meta"></a>
|
41
|
+
</div>
|
34
42
|
</div>
|
35
43
|
</x-files>
|
36
44
|
|
data/lib/lalala/version.rb
CHANGED