card-mod-carrierwave 0.14.2 → 0.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/script/upload.js.coffee +72 -0
- data/assets/style/file.scss +30 -0
- data/{locales → config/locales}/en.yml +6 -0
- data/data/files/decko_logo/image-original.svg +84 -0
- data/data/files/favicon/image-icon.png +0 -0
- data/data/files/favicon/image-large.png +0 -0
- data/data/files/favicon/image-medium.png +0 -0
- data/data/files/favicon/image-original.png +0 -0
- data/data/files/favicon/image-small.png +0 -0
- data/data/files/favicon.png +0 -0
- data/data/files/file1.txt +1 -0
- data/data/files/file2.txt +1 -0
- data/data/files/file3.txt +1 -0
- data/data/files/logo/image-original.svg +84 -0
- data/data/files/logo.svg +84 -0
- data/data/files/mao2.jpg +0 -0
- data/data/files/mod_carrierwave_script_asset_output/file.js +2 -0
- data/data/files/rails.gif +0 -0
- data/data/real.yml +129 -0
- data/db/migrate_core_cards/20230130141025_move_favicon.rb +8 -0
- data/lib/card/mod/carrierwave.rb +6 -0
- data/lib/carrier_wave/card_mount.rb +2 -2
- data/lib/carrier_wave/file_card_uploader.rb +0 -7
- data/lib/carrier_wave/test_file.rb +8 -0
- data/set/abstract/attachment/coded.rb +1 -2
- data/set/abstract/attachment.rb +18 -2
- data/set/all/file_utils.rb +6 -4
- data/set/self/admin.rb +8 -22
- data/set/self/search.rb +8 -0
- data/set/type/file/preview_editor.haml +13 -17
- data/set/type/image/html_views.rb +5 -1
- data/set/type/image.rb +10 -3
- metadata +50 -13
- /data/{init → config}/early/carrierwave.rb +0 -0
- /data/{init → config}/early/mini_magick.rb +0 -0
- /data/{locales → config/locales}/de.yml +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8761dbc4ff22a5e81422bb2d7c3cc61123ebbcfcc9f20876e92279e2a9b6782
|
4
|
+
data.tar.gz: ff2104242790ad86e755c407ae262c6c7816cfa14c3287c511fefb33689be81e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b6203942ef2271d5d6d8b206017d83502a9b3a3f1788249dc2974d0d8d796b78dedde2bef545289be8f9d273fe5429eb4c4d60ca8a1c55746ef315d837448df
|
7
|
+
data.tar.gz: '0295eca5a23bcc40a95a515c60555cf62d157ccc168e4d6ed30b147714063ad9fac55016b9d38eeb71bac20a7309152e512cc877e48e6156073735f1a883817e'
|
@@ -0,0 +1,72 @@
|
|
1
|
+
decko.editors.init[".file-upload"] = -> decko.upload_file(this)
|
2
|
+
|
3
|
+
$.extend decko,
|
4
|
+
upload_file: (fileupload) ->
|
5
|
+
# for file as a subcard in a form,
|
6
|
+
# excess parameters are included in the request which cause errors.
|
7
|
+
# only the file, type_id and attachment_card_name are needed
|
8
|
+
# attachment_card_name is the original card name,
|
9
|
+
# ex: card[subcards][+logo][image], card[file]
|
10
|
+
$(fileupload).on 'fileuploadsubmit', (e,data) ->
|
11
|
+
$_this = $(this)
|
12
|
+
card_name = $_this.siblings(".attachment_card_name:first").attr("name")
|
13
|
+
type_id = $_this.siblings("#attachment_type_id").val()
|
14
|
+
data.formData = {
|
15
|
+
"card[type_id]": type_id,
|
16
|
+
"attachment_upload": card_name
|
17
|
+
}
|
18
|
+
$_fileupload = $(fileupload)
|
19
|
+
if $_fileupload.closest("form").attr("action").indexOf("update") > -1
|
20
|
+
url = "card/update/"+$(fileupload).siblings("#file_card_name").val()
|
21
|
+
else
|
22
|
+
url = "card/create"
|
23
|
+
$(fileupload).fileupload(
|
24
|
+
url: decko.path(url),
|
25
|
+
dataType: 'html',
|
26
|
+
done: decko.doneFile,
|
27
|
+
add: decko.chooseFile,
|
28
|
+
progressall: decko.progressallFile
|
29
|
+
)#, forceIframeTransport: true )
|
30
|
+
|
31
|
+
chooseFile: (e, data) ->
|
32
|
+
data.form.find('button[type=submit]').attr('disabled',true)
|
33
|
+
editor = $(this).closest '.card-editor'
|
34
|
+
$('#progress').show()
|
35
|
+
editor.append '<input type="hidden" class="extra_upload_param" ' +
|
36
|
+
'value="true" name="attachment_upload">'
|
37
|
+
editor.append '<input type="hidden" class="extra_upload_param" ' +
|
38
|
+
'value="preview_editor" name="view">'
|
39
|
+
data.submit()
|
40
|
+
editor.find('.choose-file').hide()
|
41
|
+
# editor.find(".file-upload").prop "disabled", true
|
42
|
+
editor.find('.extra_upload_param').remove()
|
43
|
+
|
44
|
+
progressallFile: (e, data) ->
|
45
|
+
progress = parseInt(data.loaded / data.total * 100, 10)
|
46
|
+
$('#progress .progress-bar').css('width', progress + '%')
|
47
|
+
|
48
|
+
doneFile: (e, data) ->
|
49
|
+
editor = $(this).closest '.card-editor'
|
50
|
+
editor.find('.chosen-file').replaceWith data.result
|
51
|
+
data.form.find('button[type=submit]').attr('disabled',false)
|
52
|
+
|
53
|
+
$(window).ready ->
|
54
|
+
$('body').on 'click', '.cancel-upload', ->
|
55
|
+
editor = $(this).closest '.card-editor'
|
56
|
+
editor.find('.choose-file').show()
|
57
|
+
# editor.find(".file-upload").prop "disabled", false
|
58
|
+
editor.find('.chosen-file').empty()
|
59
|
+
editor.find('.progress').show()
|
60
|
+
editor.find('#progress .progress-bar').css('width', '0%')
|
61
|
+
editor.find('#progress').hide()
|
62
|
+
|
63
|
+
$('body').on "submit", "form", ->
|
64
|
+
disableUploader this, true
|
65
|
+
|
66
|
+
$("body").on "ajax:complete", "form", ->
|
67
|
+
disableUploader this, false
|
68
|
+
|
69
|
+
disableUploader = (form, toggle) ->
|
70
|
+
uploader = $(form).find ".file-upload[type=file]"
|
71
|
+
if uploader[0]
|
72
|
+
uploader.prop "disabled", toggle
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/* -- file upload -- */
|
2
|
+
.fileupload-buttonbar .btn, .fileupload-buttonbar .toggle {
|
3
|
+
margin-bottom: 5px;
|
4
|
+
}
|
5
|
+
|
6
|
+
.fileinput-button {
|
7
|
+
position: relative;
|
8
|
+
overflow: hidden;
|
9
|
+
display: inline-block;
|
10
|
+
input {
|
11
|
+
position: absolute;
|
12
|
+
top: 0;
|
13
|
+
right: 0;
|
14
|
+
margin: 0;
|
15
|
+
opacity: 0;
|
16
|
+
-ms-filter: 'alpha(opacity=0)';
|
17
|
+
font-size: 200px;
|
18
|
+
direction: ltr;
|
19
|
+
cursor: pointer;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
.TYPE-image {
|
24
|
+
.d0-card-content, .d0-card-body, &.d0-card-content {
|
25
|
+
img {
|
26
|
+
max-width: 100%;
|
27
|
+
max-height: 100%;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
@@ -11,3 +11,9 @@ en:
|
|
11
11
|
carrierwave_replace_item: Replace %{attachment_name}...
|
12
12
|
carrierwave_unknown_storage_type: unknown storage type %{new_storage_type}
|
13
13
|
carrierwave_url_is_missing: url is missing
|
14
|
+
|
15
|
+
# carrierwave_task_move_files_link_text: "Move Files"
|
16
|
+
# carrierwave_task_move_files_description: "Move Files!"
|
17
|
+
|
18
|
+
carrierwave_task_delete_upload_tmp_files_link_text: "Delete upload tmp files"
|
19
|
+
carrierwave_task_delete_upload_tmp_files_description: "Delete upload tmp files!"
|
@@ -0,0 +1,84 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
2
|
+
version="1.1" viewBox="0 0 242 218">
|
3
|
+
<title>b&w_logo</title>
|
4
|
+
<desc>Created with Sketch.</desc>
|
5
|
+
<defs>
|
6
|
+
<rect id="path-1" width="157.28" height="190.607" x="35.33" y="10.485" rx="12.491"/>
|
7
|
+
<filter id="filter-2" width="125.4%" height="121%" x="-12.1%" y="-10.5%"
|
8
|
+
filterUnits="objectBoundingBox">
|
9
|
+
<feMorphology in="SourceAlpha" operator="dilate" radius="1"
|
10
|
+
result="shadowSpreadOuter1"/>
|
11
|
+
<feOffset dx="1" dy="0" in="shadowSpreadOuter1" result="shadowOffsetOuter1"/>
|
12
|
+
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1"
|
13
|
+
stdDeviation="5.5"/>
|
14
|
+
<feColorMatrix in="shadowBlurOuter1" type="matrix"
|
15
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
|
16
|
+
</filter>
|
17
|
+
<rect id="path-3" width="123.953" height="171.161" x="51.988" y="19.404" rx="9.689"/>
|
18
|
+
<filter id="filter-4" width="132.3%" height="123.4%" x="-15.3%" y="-11.7%"
|
19
|
+
filterUnits="objectBoundingBox">
|
20
|
+
<feMorphology in="SourceAlpha" operator="dilate" radius="1"
|
21
|
+
result="shadowSpreadOuter1"/>
|
22
|
+
<feOffset dx="1" dy="0" in="shadowSpreadOuter1" result="shadowOffsetOuter1"/>
|
23
|
+
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1"
|
24
|
+
stdDeviation="5.5"/>
|
25
|
+
<feColorMatrix in="shadowBlurOuter1" type="matrix"
|
26
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
|
27
|
+
</filter>
|
28
|
+
<path id="path-5"
|
29
|
+
d="M70.1050368,35.6666109 L159.089911,35.6666109 L159.089911,35.6666109 C163.678051,35.6666109 167.397473,39.386033 167.397473,43.9741728 L167.397473,87.717145 L167.397473,166.808436 L167.397473,166.808436 C167.397473,171.396576 163.678051,175.115998 159.089911,175.115998 L70.1050368,175.115998 L70.1050368,175.115998 C65.516897,175.115998 61.7974749,171.396576 61.7974749,166.808436 L61.7974749,43.9741728 L61.7974749,43.9741728 C61.7974749,39.386033 65.516897,35.6666109 70.1050368,35.6666109 Z"/>
|
30
|
+
<filter id="filter-6" width="137.9%" height="128.7%" x="-18%" y="-14.3%"
|
31
|
+
filterUnits="objectBoundingBox">
|
32
|
+
<feMorphology in="SourceAlpha" operator="dilate" radius="1"
|
33
|
+
result="shadowSpreadOuter1"/>
|
34
|
+
<feOffset dx="1" dy="0" in="shadowSpreadOuter1" result="shadowOffsetOuter1"/>
|
35
|
+
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1"
|
36
|
+
stdDeviation="5.5"/>
|
37
|
+
<feColorMatrix in="shadowBlurOuter1" type="matrix"
|
38
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
|
39
|
+
</filter>
|
40
|
+
<rect id="path-7" width="92.149" height="107.187" x="70.764" y="49.853" rx="7.866"/>
|
41
|
+
<filter id="filter-8" width="143.4%" height="137.3%" x="-20.6%" y="-18.7%"
|
42
|
+
filterUnits="objectBoundingBox">
|
43
|
+
<feMorphology in="SourceAlpha" operator="dilate" radius="1"
|
44
|
+
result="shadowSpreadOuter1"/>
|
45
|
+
<feOffset dx="1" dy="0" in="shadowSpreadOuter1" result="shadowOffsetOuter1"/>
|
46
|
+
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1"
|
47
|
+
stdDeviation="5.5"/>
|
48
|
+
<feColorMatrix in="shadowBlurOuter1" type="matrix"
|
49
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.102553216 0"/>
|
50
|
+
</filter>
|
51
|
+
</defs>
|
52
|
+
<g id="Page-3" fill="none" fill-rule="evenodd" stroke="none" stroke-width="1">
|
53
|
+
<g id="b&w_logo" fill-rule="nonzero">
|
54
|
+
<g id="Decko-Logo-" transform="translate(7.000000, 4.000000)">
|
55
|
+
<g id="g5642">
|
56
|
+
<g id="svg-card-1"
|
57
|
+
transform="translate(113.969540, 105.788552) scale(-1, 1) rotate(105.855860) translate(-113.969540, -105.788552)">
|
58
|
+
<use fill="#000" fill-opacity="1" filter="url(#filter-2)"
|
59
|
+
xlink:href="#path-1"/>
|
60
|
+
<use fill="#4D4D4D" fill-rule="evenodd" xlink:href="#path-1"/>
|
61
|
+
</g>
|
62
|
+
<g id="svg-card-2" opacity=".88"
|
63
|
+
transform="translate(113.964538, 104.984820) scale(-1, 1) rotate(117.480003) translate(-113.964538, -104.984820)">
|
64
|
+
<use fill="#000" fill-opacity="1" filter="url(#filter-4)"
|
65
|
+
xlink:href="#path-3"/>
|
66
|
+
<use fill="#FFF" fill-rule="evenodd" xlink:href="#path-3"/>
|
67
|
+
</g>
|
68
|
+
<g id="svg-card-3"
|
69
|
+
transform="translate(114.597474, 105.391304) scale(-1, 1) rotate(133.539993) translate(-114.597474, -105.391304)">
|
70
|
+
<use fill="#000" fill-opacity="1" filter="url(#filter-6)"
|
71
|
+
xlink:href="#path-5"/>
|
72
|
+
<use fill="#4C4C4C" fill-rule="evenodd" xlink:href="#path-5"/>
|
73
|
+
</g>
|
74
|
+
<g id="svg-card-4" opacity=".88"
|
75
|
+
transform="translate(116.838368, 103.446228) scale(-1, 1) rotate(142.690002) translate(-116.838368, -103.446228)">
|
76
|
+
<use fill="#000" fill-opacity="1" filter="url(#filter-8)"
|
77
|
+
xlink:href="#path-7"/>
|
78
|
+
<use fill="#FFF" fill-rule="evenodd" xlink:href="#path-7"/>
|
79
|
+
</g>
|
80
|
+
</g>
|
81
|
+
</g>
|
82
|
+
</g>
|
83
|
+
</g>
|
84
|
+
</svg>
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
file1
|
@@ -0,0 +1 @@
|
|
1
|
+
file2
|
@@ -0,0 +1 @@
|
|
1
|
+
file3, man.
|
@@ -0,0 +1,84 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
2
|
+
version="1.1" viewBox="0 0 242 218">
|
3
|
+
<title>b&w_logo</title>
|
4
|
+
<desc>Created with Sketch.</desc>
|
5
|
+
<defs>
|
6
|
+
<rect id="path-1" width="157.28" height="190.607" x="35.33" y="10.485" rx="12.491"/>
|
7
|
+
<filter id="filter-2" width="125.4%" height="121%" x="-12.1%" y="-10.5%"
|
8
|
+
filterUnits="objectBoundingBox">
|
9
|
+
<feMorphology in="SourceAlpha" operator="dilate" radius="1"
|
10
|
+
result="shadowSpreadOuter1"/>
|
11
|
+
<feOffset dx="1" dy="0" in="shadowSpreadOuter1" result="shadowOffsetOuter1"/>
|
12
|
+
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1"
|
13
|
+
stdDeviation="5.5"/>
|
14
|
+
<feColorMatrix in="shadowBlurOuter1" type="matrix"
|
15
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
|
16
|
+
</filter>
|
17
|
+
<rect id="path-3" width="123.953" height="171.161" x="51.988" y="19.404" rx="9.689"/>
|
18
|
+
<filter id="filter-4" width="132.3%" height="123.4%" x="-15.3%" y="-11.7%"
|
19
|
+
filterUnits="objectBoundingBox">
|
20
|
+
<feMorphology in="SourceAlpha" operator="dilate" radius="1"
|
21
|
+
result="shadowSpreadOuter1"/>
|
22
|
+
<feOffset dx="1" dy="0" in="shadowSpreadOuter1" result="shadowOffsetOuter1"/>
|
23
|
+
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1"
|
24
|
+
stdDeviation="5.5"/>
|
25
|
+
<feColorMatrix in="shadowBlurOuter1" type="matrix"
|
26
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
|
27
|
+
</filter>
|
28
|
+
<path id="path-5"
|
29
|
+
d="M70.1050368,35.6666109 L159.089911,35.6666109 L159.089911,35.6666109 C163.678051,35.6666109 167.397473,39.386033 167.397473,43.9741728 L167.397473,87.717145 L167.397473,166.808436 L167.397473,166.808436 C167.397473,171.396576 163.678051,175.115998 159.089911,175.115998 L70.1050368,175.115998 L70.1050368,175.115998 C65.516897,175.115998 61.7974749,171.396576 61.7974749,166.808436 L61.7974749,43.9741728 L61.7974749,43.9741728 C61.7974749,39.386033 65.516897,35.6666109 70.1050368,35.6666109 Z"/>
|
30
|
+
<filter id="filter-6" width="137.9%" height="128.7%" x="-18%" y="-14.3%"
|
31
|
+
filterUnits="objectBoundingBox">
|
32
|
+
<feMorphology in="SourceAlpha" operator="dilate" radius="1"
|
33
|
+
result="shadowSpreadOuter1"/>
|
34
|
+
<feOffset dx="1" dy="0" in="shadowSpreadOuter1" result="shadowOffsetOuter1"/>
|
35
|
+
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1"
|
36
|
+
stdDeviation="5.5"/>
|
37
|
+
<feColorMatrix in="shadowBlurOuter1" type="matrix"
|
38
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
|
39
|
+
</filter>
|
40
|
+
<rect id="path-7" width="92.149" height="107.187" x="70.764" y="49.853" rx="7.866"/>
|
41
|
+
<filter id="filter-8" width="143.4%" height="137.3%" x="-20.6%" y="-18.7%"
|
42
|
+
filterUnits="objectBoundingBox">
|
43
|
+
<feMorphology in="SourceAlpha" operator="dilate" radius="1"
|
44
|
+
result="shadowSpreadOuter1"/>
|
45
|
+
<feOffset dx="1" dy="0" in="shadowSpreadOuter1" result="shadowOffsetOuter1"/>
|
46
|
+
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1"
|
47
|
+
stdDeviation="5.5"/>
|
48
|
+
<feColorMatrix in="shadowBlurOuter1" type="matrix"
|
49
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.102553216 0"/>
|
50
|
+
</filter>
|
51
|
+
</defs>
|
52
|
+
<g id="Page-3" fill="none" fill-rule="evenodd" stroke="none" stroke-width="1">
|
53
|
+
<g id="b&w_logo" fill-rule="nonzero">
|
54
|
+
<g id="Decko-Logo-" transform="translate(7.000000, 4.000000)">
|
55
|
+
<g id="g5642">
|
56
|
+
<g id="svg-card-1"
|
57
|
+
transform="translate(113.969540, 105.788552) scale(-1, 1) rotate(105.855860) translate(-113.969540, -105.788552)">
|
58
|
+
<use fill="#000" fill-opacity="1" filter="url(#filter-2)"
|
59
|
+
xlink:href="#path-1"/>
|
60
|
+
<use fill="#4D4D4D" fill-rule="evenodd" xlink:href="#path-1"/>
|
61
|
+
</g>
|
62
|
+
<g id="svg-card-2" opacity=".88"
|
63
|
+
transform="translate(113.964538, 104.984820) scale(-1, 1) rotate(117.480003) translate(-113.964538, -104.984820)">
|
64
|
+
<use fill="#000" fill-opacity="1" filter="url(#filter-4)"
|
65
|
+
xlink:href="#path-3"/>
|
66
|
+
<use fill="#FFF" fill-rule="evenodd" xlink:href="#path-3"/>
|
67
|
+
</g>
|
68
|
+
<g id="svg-card-3"
|
69
|
+
transform="translate(114.597474, 105.391304) scale(-1, 1) rotate(133.539993) translate(-114.597474, -105.391304)">
|
70
|
+
<use fill="#000" fill-opacity="1" filter="url(#filter-6)"
|
71
|
+
xlink:href="#path-5"/>
|
72
|
+
<use fill="#4C4C4C" fill-rule="evenodd" xlink:href="#path-5"/>
|
73
|
+
</g>
|
74
|
+
<g id="svg-card-4" opacity=".88"
|
75
|
+
transform="translate(116.838368, 103.446228) scale(-1, 1) rotate(142.690002) translate(-116.838368, -103.446228)">
|
76
|
+
<use fill="#000" fill-opacity="1" filter="url(#filter-8)"
|
77
|
+
xlink:href="#path-7"/>
|
78
|
+
<use fill="#FFF" fill-rule="evenodd" xlink:href="#path-7"/>
|
79
|
+
</g>
|
80
|
+
</g>
|
81
|
+
</g>
|
82
|
+
</g>
|
83
|
+
</g>
|
84
|
+
</svg>
|
data/data/files/logo.svg
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
2
|
+
version="1.1" viewBox="0 0 242 218">
|
3
|
+
<title>b&w_logo</title>
|
4
|
+
<desc>Created with Sketch.</desc>
|
5
|
+
<defs>
|
6
|
+
<rect id="path-1" width="157.28" height="190.607" x="35.33" y="10.485" rx="12.491"/>
|
7
|
+
<filter id="filter-2" width="125.4%" height="121%" x="-12.1%" y="-10.5%"
|
8
|
+
filterUnits="objectBoundingBox">
|
9
|
+
<feMorphology in="SourceAlpha" operator="dilate" radius="1"
|
10
|
+
result="shadowSpreadOuter1"/>
|
11
|
+
<feOffset dx="1" dy="0" in="shadowSpreadOuter1" result="shadowOffsetOuter1"/>
|
12
|
+
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1"
|
13
|
+
stdDeviation="5.5"/>
|
14
|
+
<feColorMatrix in="shadowBlurOuter1" type="matrix"
|
15
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
|
16
|
+
</filter>
|
17
|
+
<rect id="path-3" width="123.953" height="171.161" x="51.988" y="19.404" rx="9.689"/>
|
18
|
+
<filter id="filter-4" width="132.3%" height="123.4%" x="-15.3%" y="-11.7%"
|
19
|
+
filterUnits="objectBoundingBox">
|
20
|
+
<feMorphology in="SourceAlpha" operator="dilate" radius="1"
|
21
|
+
result="shadowSpreadOuter1"/>
|
22
|
+
<feOffset dx="1" dy="0" in="shadowSpreadOuter1" result="shadowOffsetOuter1"/>
|
23
|
+
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1"
|
24
|
+
stdDeviation="5.5"/>
|
25
|
+
<feColorMatrix in="shadowBlurOuter1" type="matrix"
|
26
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
|
27
|
+
</filter>
|
28
|
+
<path id="path-5"
|
29
|
+
d="M70.1050368,35.6666109 L159.089911,35.6666109 L159.089911,35.6666109 C163.678051,35.6666109 167.397473,39.386033 167.397473,43.9741728 L167.397473,87.717145 L167.397473,166.808436 L167.397473,166.808436 C167.397473,171.396576 163.678051,175.115998 159.089911,175.115998 L70.1050368,175.115998 L70.1050368,175.115998 C65.516897,175.115998 61.7974749,171.396576 61.7974749,166.808436 L61.7974749,43.9741728 L61.7974749,43.9741728 C61.7974749,39.386033 65.516897,35.6666109 70.1050368,35.6666109 Z"/>
|
30
|
+
<filter id="filter-6" width="137.9%" height="128.7%" x="-18%" y="-14.3%"
|
31
|
+
filterUnits="objectBoundingBox">
|
32
|
+
<feMorphology in="SourceAlpha" operator="dilate" radius="1"
|
33
|
+
result="shadowSpreadOuter1"/>
|
34
|
+
<feOffset dx="1" dy="0" in="shadowSpreadOuter1" result="shadowOffsetOuter1"/>
|
35
|
+
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1"
|
36
|
+
stdDeviation="5.5"/>
|
37
|
+
<feColorMatrix in="shadowBlurOuter1" type="matrix"
|
38
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
|
39
|
+
</filter>
|
40
|
+
<rect id="path-7" width="92.149" height="107.187" x="70.764" y="49.853" rx="7.866"/>
|
41
|
+
<filter id="filter-8" width="143.4%" height="137.3%" x="-20.6%" y="-18.7%"
|
42
|
+
filterUnits="objectBoundingBox">
|
43
|
+
<feMorphology in="SourceAlpha" operator="dilate" radius="1"
|
44
|
+
result="shadowSpreadOuter1"/>
|
45
|
+
<feOffset dx="1" dy="0" in="shadowSpreadOuter1" result="shadowOffsetOuter1"/>
|
46
|
+
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1"
|
47
|
+
stdDeviation="5.5"/>
|
48
|
+
<feColorMatrix in="shadowBlurOuter1" type="matrix"
|
49
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.102553216 0"/>
|
50
|
+
</filter>
|
51
|
+
</defs>
|
52
|
+
<g id="Page-3" fill="none" fill-rule="evenodd" stroke="none" stroke-width="1">
|
53
|
+
<g id="b&w_logo" fill-rule="nonzero">
|
54
|
+
<g id="Decko-Logo-" transform="translate(7.000000, 4.000000)">
|
55
|
+
<g id="g5642">
|
56
|
+
<g id="svg-card-1"
|
57
|
+
transform="translate(113.969540, 105.788552) scale(-1, 1) rotate(105.855860) translate(-113.969540, -105.788552)">
|
58
|
+
<use fill="#000" fill-opacity="1" filter="url(#filter-2)"
|
59
|
+
xlink:href="#path-1"/>
|
60
|
+
<use fill="#4D4D4D" fill-rule="evenodd" xlink:href="#path-1"/>
|
61
|
+
</g>
|
62
|
+
<g id="svg-card-2" opacity=".88"
|
63
|
+
transform="translate(113.964538, 104.984820) scale(-1, 1) rotate(117.480003) translate(-113.964538, -104.984820)">
|
64
|
+
<use fill="#000" fill-opacity="1" filter="url(#filter-4)"
|
65
|
+
xlink:href="#path-3"/>
|
66
|
+
<use fill="#FFF" fill-rule="evenodd" xlink:href="#path-3"/>
|
67
|
+
</g>
|
68
|
+
<g id="svg-card-3"
|
69
|
+
transform="translate(114.597474, 105.391304) scale(-1, 1) rotate(133.539993) translate(-114.597474, -105.391304)">
|
70
|
+
<use fill="#000" fill-opacity="1" filter="url(#filter-6)"
|
71
|
+
xlink:href="#path-5"/>
|
72
|
+
<use fill="#4C4C4C" fill-rule="evenodd" xlink:href="#path-5"/>
|
73
|
+
</g>
|
74
|
+
<g id="svg-card-4" opacity=".88"
|
75
|
+
transform="translate(116.838368, 103.446228) scale(-1, 1) rotate(142.690002) translate(-116.838368, -103.446228)">
|
76
|
+
<use fill="#000" fill-opacity="1" filter="url(#filter-8)"
|
77
|
+
xlink:href="#path-7"/>
|
78
|
+
<use fill="#FFF" fill-rule="evenodd" xlink:href="#path-7"/>
|
79
|
+
</g>
|
80
|
+
</g>
|
81
|
+
</g>
|
82
|
+
</g>
|
83
|
+
</g>
|
84
|
+
</svg>
|
data/data/files/mao2.jpg
ADDED
Binary file
|
@@ -0,0 +1,2 @@
|
|
1
|
+
// upload.js.coffee
|
2
|
+
(function(){var e;decko.editors.init[".file-upload"]=function(){return decko.upload_file(this)},$.extend(decko,{upload_file:function(e){var t;return $(e).on("fileuploadsubmit",function(e,t){var r,i,a;return i=(r=$(this)).siblings(".attachment_card_name:first").attr("name"),a=r.siblings("#attachment_type_id").val(),t.formData={"card[type_id]":a,attachment_upload:i}}),t=$(e).closest("form").attr("action").indexOf("update")>-1?"card/update/"+$(e).siblings("#file_card_name").val():"card/create",$(e).fileupload({url:decko.path(t),dataType:"html",done:decko.doneFile,add:decko.chooseFile,progressall:decko.progressallFile})},chooseFile:function(e,t){var r;return t.form.find("button[type=submit]").attr("disabled",!0),r=$(this).closest(".card-editor"),$("#progress").show(),r.append('<input type="hidden" class="extra_upload_param" value="true" name="attachment_upload">'),r.append('<input type="hidden" class="extra_upload_param" value="preview_editor" name="view">'),t.submit(),r.find(".choose-file").hide(),r.find(".extra_upload_param").remove()},progressallFile:function(e,t){var r;return r=parseInt(t.loaded/t.total*100,10),$("#progress .progress-bar").css("width",r+"%")},doneFile:function(e,t){return $(this).closest(".card-editor").find(".chosen-file").replaceWith(t.result),t.form.find("button[type=submit]").attr("disabled",!1)}}),$(window).ready(function(){return $("body").on("click",".cancel-upload",function(){var e;return(e=$(this).closest(".card-editor")).find(".choose-file").show(),e.find(".chosen-file").empty(),e.find(".progress").show(),e.find("#progress .progress-bar").css("width","0%"),e.find("#progress").hide()}),$("body").on("submit","form",function(){return e(this,!0)}),$("body").on("ajax:complete","form",function(){return e(this,!1)})}),e=function(e,t){var r;if((r=$(e).find(".file-upload[type=file]"))[0])return r.prop("disabled",t)}}).call(this);
|
Binary file
|
data/data/real.yml
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
#---
|
2
|
+
- :name: File
|
3
|
+
:type: :cardtype
|
4
|
+
:codename: file
|
5
|
+
:fields:
|
6
|
+
:description: |-
|
7
|
+
<p>
|
8
|
+
Upload images to these cards and include them anywhere.
|
9
|
+
[[http://decko.org/Image|more]]
|
10
|
+
</p>
|
11
|
+
|
12
|
+
- :name: Image
|
13
|
+
:type: :cardtype
|
14
|
+
:codename: image
|
15
|
+
:fields:
|
16
|
+
:description: |-
|
17
|
+
<p>
|
18
|
+
File cards are for uploading and downloading files.
|
19
|
+
[[http://decko.org/File|more]]
|
20
|
+
</p>
|
21
|
+
- :name:
|
22
|
+
- :image
|
23
|
+
- :right
|
24
|
+
- :default
|
25
|
+
:type: :image
|
26
|
+
|
27
|
+
- :name: "*logo"
|
28
|
+
:type: :image
|
29
|
+
:codename: logo
|
30
|
+
:storage_type: :coded
|
31
|
+
:image: logo.svg
|
32
|
+
:fields:
|
33
|
+
:self:
|
34
|
+
:fields:
|
35
|
+
:read: Anyone
|
36
|
+
|
37
|
+
- :name: "Decko logo"
|
38
|
+
:type: :image
|
39
|
+
:codename: decko_logo
|
40
|
+
:storage_type: :coded
|
41
|
+
:image: logo.svg
|
42
|
+
:fields:
|
43
|
+
:self:
|
44
|
+
:fields:
|
45
|
+
:read: Anyone
|
46
|
+
|
47
|
+
- :name: "*favicon"
|
48
|
+
:type: :image
|
49
|
+
:codename: favicon
|
50
|
+
:image: favicon.png
|
51
|
+
:storage_type: :coded
|
52
|
+
|
53
|
+
|
54
|
+
- :name: "*new file"
|
55
|
+
:type: :file
|
56
|
+
:codename: new_file
|
57
|
+
:skip: validate_file_exist
|
58
|
+
- :name: "*new image"
|
59
|
+
:type: :image
|
60
|
+
:codename: new_image
|
61
|
+
:skip: validate_file_exist
|
62
|
+
|
63
|
+
# TODO: move to code. should not be editable
|
64
|
+
# Probably not in this mod, though. Needed to come after :image for eating, but it would
|
65
|
+
# probably make more sense to have this in the format mod in code.
|
66
|
+
- :name:
|
67
|
+
- :credit
|
68
|
+
- :image
|
69
|
+
:type: :html
|
70
|
+
:content: |-
|
71
|
+
<svg style="width:18px; height:14px;" viewBox="0 0 242 220" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
72
|
+
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
|
73
|
+
<title>b&w_logo</title>
|
74
|
+
<desc>Created with Sketch.</desc>
|
75
|
+
<defs>
|
76
|
+
<rect id="path-1" x="35.3297422" y="10.484836" width="157.279595" height="190.607432" rx="12.491335"></rect>
|
77
|
+
<filter x="-12.1%" y="-10.5%" width="125.4%" height="121.0%" filterUnits="objectBoundingBox" id="filter-2">
|
78
|
+
<feMorphology radius="1" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"></feMorphology>
|
79
|
+
<feOffset dx="1" dy="0" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset>
|
80
|
+
<feGaussianBlur stdDeviation="5.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
|
81
|
+
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
|
82
|
+
</filter>
|
83
|
+
<rect id="path-3" x="51.9878879" y="19.404077" width="123.9533" height="171.161486" rx="9.6888466"></rect>
|
84
|
+
<filter x="-15.3%" y="-11.7%" width="132.3%" height="123.4%" filterUnits="objectBoundingBox" id="filter-4">
|
85
|
+
<feMorphology radius="1" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"></feMorphology>
|
86
|
+
<feOffset dx="1" dy="0" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset>
|
87
|
+
<feGaussianBlur stdDeviation="5.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
|
88
|
+
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
|
89
|
+
</filter>
|
90
|
+
<path d="M70.1050368,35.6666109 L159.089911,35.6666109 L159.089911,35.6666109 C163.678051,35.6666109 167.397473,39.386033 167.397473,43.9741728 L167.397473,87.717145 L167.397473,166.808436 L167.397473,166.808436 C167.397473,171.396576 163.678051,175.115998 159.089911,175.115998 L70.1050368,175.115998 L70.1050368,175.115998 C65.516897,175.115998 61.7974749,171.396576 61.7974749,166.808436 L61.7974749,43.9741728 L61.7974749,43.9741728 C61.7974749,39.386033 65.516897,35.6666109 70.1050368,35.6666109 Z" id="path-5"></path>
|
91
|
+
<filter x="-18.0%" y="-14.3%" width="137.9%" height="128.7%" filterUnits="objectBoundingBox" id="filter-6">
|
92
|
+
<feMorphology radius="1" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"></feMorphology>
|
93
|
+
<feOffset dx="1" dy="0" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset>
|
94
|
+
<feGaussianBlur stdDeviation="5.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
|
95
|
+
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
|
96
|
+
</filter>
|
97
|
+
<rect id="path-7" x="70.7637805" y="49.8525134" width="92.149175" height="107.18743" rx="7.8659801"></rect>
|
98
|
+
<filter x="-20.6%" y="-18.7%" width="143.4%" height="137.3%" filterUnits="objectBoundingBox" id="filter-8">
|
99
|
+
<feMorphology radius="1" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"></feMorphology>
|
100
|
+
<feOffset dx="1" dy="0" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset>
|
101
|
+
<feGaussianBlur stdDeviation="5.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
|
102
|
+
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.102553216 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
|
103
|
+
</filter>
|
104
|
+
</defs>
|
105
|
+
<g id="Page-3" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
106
|
+
<g id="b&w_logo" fill-rule="nonzero">
|
107
|
+
<g id="Decko-Logo-" transform="translate(7.000000, 4.000000)">
|
108
|
+
<g id="g5642">
|
109
|
+
<g id="svg-card-1" transform="translate(113.969540, 105.788552) scale(-1, 1) rotate(105.855860) translate(-113.969540, -105.788552) ">
|
110
|
+
<use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use>
|
111
|
+
<use fill="#4D4D4D" fill-rule="evenodd" xlink:href="#path-1"></use>
|
112
|
+
</g>
|
113
|
+
<g id="svg-card-2" opacity="0.879999995" transform="translate(113.964538, 104.984820) scale(-1, 1) rotate(117.480003) translate(-113.964538, -104.984820) ">
|
114
|
+
<use fill="black" fill-opacity="1" filter="url(#filter-4)" xlink:href="#path-3"></use>
|
115
|
+
<use fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-3"></use>
|
116
|
+
</g>
|
117
|
+
<g id="svg-card-3" transform="translate(114.597474, 105.391304) scale(-1, 1) rotate(133.539993) translate(-114.597474, -105.391304) ">
|
118
|
+
<use fill="black" fill-opacity="1" filter="url(#filter-6)" xlink:href="#path-5"></use>
|
119
|
+
<use fill="#4C4C4C" fill-rule="evenodd" xlink:href="#path-5"></use>
|
120
|
+
</g>
|
121
|
+
<g id="svg-card-4" opacity="0.879999995" transform="translate(116.838368, 103.446228) scale(-1, 1) rotate(142.690002) translate(-116.838368, -103.446228) ">
|
122
|
+
<use fill="black" fill-opacity="1" filter="url(#filter-8)" xlink:href="#path-7"></use>
|
123
|
+
<use fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-7"></use>
|
124
|
+
</g>
|
125
|
+
</g>
|
126
|
+
</g>
|
127
|
+
</g>
|
128
|
+
</g>
|
129
|
+
</svg>
|
@@ -81,11 +81,11 @@ module CarrierWave
|
|
81
81
|
|
82
82
|
def assign_file file
|
83
83
|
db_column = _mounter(:#{column}).serialization_column
|
84
|
-
send(:"\#{db_column}_will_change!")
|
84
|
+
send(:"\#{db_column}_will_change!") unless duplicate?
|
85
85
|
if web?
|
86
86
|
self.content = file
|
87
87
|
else
|
88
|
-
send(:"#{column}_will_change!")
|
88
|
+
send(:"#{column}_will_change!") unless duplicate?
|
89
89
|
yield
|
90
90
|
end
|
91
91
|
end
|
@@ -160,13 +160,6 @@ module CarrierWave
|
|
160
160
|
end.downcase
|
161
161
|
end
|
162
162
|
|
163
|
-
# generate identifier that gets stored in the card's db_content field
|
164
|
-
# @param opts [Hash] generate an identifier using the given storage options
|
165
|
-
# instead of the storage options derived from the model and
|
166
|
-
# the global configuration
|
167
|
-
# @option opts [Symbol] storage_type
|
168
|
-
# @option opts [String] mod
|
169
|
-
# @option opts [Symbol] bucket
|
170
163
|
def db_content
|
171
164
|
return model.content if model.web?
|
172
165
|
return "" unless file.present?
|
@@ -29,7 +29,7 @@ def storage_type_error error_name
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def mod_from_content
|
32
|
-
if (m = content
|
32
|
+
if (m = content&.match %r{^:[^/]+/([^.]+)})
|
33
33
|
m[1] # current mod_file format
|
34
34
|
else
|
35
35
|
mod_from_deprecated_content
|
@@ -46,7 +46,6 @@ end
|
|
46
46
|
def mod_dir new_mod=nil
|
47
47
|
mod_name = new_mod || mod
|
48
48
|
dir = Cardio::Mod.dirs.path(mod_name) || (mod_name.to_sym == :test && "test")
|
49
|
-
|
50
49
|
raise Error, "can't find mod \"#{mod_name}\"" unless dir
|
51
50
|
|
52
51
|
dir
|
data/set/abstract/attachment.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
Card.action_specific_attributes << :duplicate_file
|
2
|
+
|
1
3
|
attr_writer :empty_ok
|
2
4
|
|
3
5
|
def self.included host_class
|
@@ -21,7 +23,7 @@ event :save_original_filename, :prepare_to_store, on: :save, when: :file_ready_t
|
|
21
23
|
@current_action.update! comment: original_filename
|
22
24
|
end
|
23
25
|
|
24
|
-
event :validate_file_exist, :validate, on: :create do
|
26
|
+
event :validate_file_exist, :validate, on: :create, skip: :allowed do
|
25
27
|
return if empty_ok?
|
26
28
|
|
27
29
|
if web?
|
@@ -80,10 +82,24 @@ end
|
|
80
82
|
def assign_set_specific_attributes
|
81
83
|
@attaching = set_specific[attachment_name].present?
|
82
84
|
# reset content if we really have something to upload
|
83
|
-
|
85
|
+
@mod = set_specific[:mod]
|
86
|
+
self.content = nil if @attaching && !duplicate?
|
84
87
|
super
|
85
88
|
end
|
86
89
|
|
90
|
+
# FIXME: this is weak duplicate detection and currently only catches duplicate
|
91
|
+
# updates to coded cards. Tried #read but wasn't getting the same value on both
|
92
|
+
# files even when they were definitely duplicates.
|
93
|
+
def duplicate?
|
94
|
+
real? &&
|
95
|
+
storage_type == :coded &&
|
96
|
+
(old = attachment.file) &&
|
97
|
+
(new = set_specific[attachment_name]) &&
|
98
|
+
old.size == new.size
|
99
|
+
# rescue Card::Error
|
100
|
+
# false
|
101
|
+
end
|
102
|
+
|
87
103
|
def delete_files_for_action action
|
88
104
|
with_selected_action_id(action.id) do
|
89
105
|
attachment.file.delete
|
data/set/all/file_utils.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
+
# TODO: move to lib
|
2
|
+
# eg, create new Card::File class in lib/card/file
|
1
3
|
module ClassMethods
|
2
|
-
def update_all_storage_locations
|
3
|
-
|
4
|
-
|
5
|
-
end
|
4
|
+
# def update_all_storage_locations
|
5
|
+
# Card.search(type_id: ["in", Card::FileID, Card::ImageID])
|
6
|
+
# .each(&:update_storage_location!)
|
7
|
+
# end
|
6
8
|
|
7
9
|
def delete_tmp_files_of_cached_uploads
|
8
10
|
cards_with_disposable_attachments do |card, action|
|
data/set/self/admin.rb
CHANGED
@@ -1,22 +1,8 @@
|
|
1
|
-
basket[:tasks]
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
# task: "update_file_storage_locations"
|
10
|
-
}
|
11
|
-
},
|
12
|
-
{
|
13
|
-
name: :delete_upload_tmp_files,
|
14
|
-
execute_policy: -> { Card.delete_tmp_files_of_cached_uploads },
|
15
|
-
stats: {
|
16
|
-
title: "tmp files of canceled uploads",
|
17
|
-
count: -> { ::Card.draft_actions_with_attachment },
|
18
|
-
link_text: "delete tmp files",
|
19
|
-
task: "delete_tmp_files_of_cached_uploads"
|
20
|
-
}
|
21
|
-
}
|
22
|
-
]
|
1
|
+
basket[:tasks][:delete_upload_tmp_files] = {
|
2
|
+
mod: :carrierwave,
|
3
|
+
execute_policy: -> { Card.delete_tmp_files_of_cached_uploads }
|
4
|
+
}
|
5
|
+
|
6
|
+
# { name: :move_files,
|
7
|
+
# mod: :carrierwave,
|
8
|
+
# execute_policy: -> { Card.update_all_storage_locations } },
|
data/set/self/search.rb
ADDED
@@ -1,19 +1,15 @@
|
|
1
1
|
.chosen-file
|
2
2
|
%input{ name: cached_upload_card_name, type: "hidden", value: card.selected_action_id }
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
%
|
10
|
-
|
11
|
-
|
12
|
-
%
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
%button.btn.btn-danger.delete.cancel-upload{ "data-type": "DELETE" }
|
17
|
-
= icon_tag :delete
|
18
|
-
%span
|
19
|
-
= preview_editor_delete_text
|
3
|
+
.d-flex
|
4
|
+
= preview
|
5
|
+
.d-flex.flex-column.justify-content-between.ml-2.w-100
|
6
|
+
%div
|
7
|
+
%p.name
|
8
|
+
= card.original_filename
|
9
|
+
%span.size
|
10
|
+
= number_to_human_size card.attachment.size
|
11
|
+
.align-self-end
|
12
|
+
%button.btn.btn-danger.delete.cancel-upload{ "data-type": "DELETE" }
|
13
|
+
= icon_tag :delete
|
14
|
+
%span
|
15
|
+
= preview_editor_delete_text
|
@@ -3,7 +3,7 @@ format :html do
|
|
3
3
|
|
4
4
|
# core HTML image view.
|
5
5
|
view :core do
|
6
|
-
return card.attachment.read if
|
6
|
+
return card.attachment.read.html_safe if svg?
|
7
7
|
|
8
8
|
with_valid_source do |source|
|
9
9
|
image_tag source, alt: card.name
|
@@ -76,4 +76,8 @@ format :html do
|
|
76
76
|
Card::Content::Diff.render_added_chunk _render_core
|
77
77
|
end
|
78
78
|
end
|
79
|
+
|
80
|
+
def goto_autocomplete_icon
|
81
|
+
render :core, size: :small
|
82
|
+
end
|
79
83
|
end
|
data/set/type/image.rb
CHANGED
@@ -12,6 +12,7 @@ end
|
|
12
12
|
|
13
13
|
format do
|
14
14
|
include File::Format
|
15
|
+
delegate :svg?, to: :card
|
15
16
|
|
16
17
|
view :one_line_content do
|
17
18
|
_render_core size: :icon
|
@@ -22,6 +23,10 @@ format do
|
|
22
23
|
end
|
23
24
|
|
24
25
|
view :source, unknown: :blank do
|
26
|
+
source
|
27
|
+
end
|
28
|
+
|
29
|
+
def source
|
25
30
|
return card.content if card.web?
|
26
31
|
|
27
32
|
image = selected_version
|
@@ -32,10 +37,12 @@ format do
|
|
32
37
|
|
33
38
|
def selected_version
|
34
39
|
size = determine_image_size
|
35
|
-
|
36
|
-
|
40
|
+
image = card.image
|
41
|
+
|
42
|
+
if size && size != :original && !svg?
|
43
|
+
image.versions[size]
|
37
44
|
else
|
38
|
-
|
45
|
+
image
|
39
46
|
end
|
40
47
|
end
|
41
48
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: card-mod-carrierwave
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan McCutchen
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2023-03-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: card
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.
|
21
|
+
version: 1.105.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - '='
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 1.
|
28
|
+
version: 1.105.1
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: carrierwave
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -54,34 +54,48 @@ dependencies:
|
|
54
54
|
- - "~>"
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: '4.2'
|
57
|
+
- !ruby/object:Gem::Dependency
|
58
|
+
name: ssrf_filter
|
59
|
+
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - "~>"
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: 1.0.7
|
64
|
+
type: :runtime
|
65
|
+
prerelease: false
|
66
|
+
version_requirements: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - "~>"
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: 1.0.7
|
57
71
|
- !ruby/object:Gem::Dependency
|
58
72
|
name: card-mod-history
|
59
73
|
requirement: !ruby/object:Gem::Requirement
|
60
74
|
requirements:
|
61
75
|
- - '='
|
62
76
|
- !ruby/object:Gem::Version
|
63
|
-
version: 0.
|
77
|
+
version: 0.15.1
|
64
78
|
type: :runtime
|
65
79
|
prerelease: false
|
66
80
|
version_requirements: !ruby/object:Gem::Requirement
|
67
81
|
requirements:
|
68
82
|
- - '='
|
69
83
|
- !ruby/object:Gem::Version
|
70
|
-
version: 0.
|
84
|
+
version: 0.15.1
|
71
85
|
- !ruby/object:Gem::Dependency
|
72
86
|
name: card-mod-permissions
|
73
87
|
requirement: !ruby/object:Gem::Requirement
|
74
88
|
requirements:
|
75
89
|
- - '='
|
76
90
|
- !ruby/object:Gem::Version
|
77
|
-
version: 0.
|
91
|
+
version: 0.15.1
|
78
92
|
type: :runtime
|
79
93
|
prerelease: false
|
80
94
|
version_requirements: !ruby/object:Gem::Requirement
|
81
95
|
requirements:
|
82
96
|
- - '='
|
83
97
|
- !ruby/object:Gem::Version
|
84
|
-
version: 0.
|
98
|
+
version: 0.15.1
|
85
99
|
description: ''
|
86
100
|
email:
|
87
101
|
- info@decko.org
|
@@ -89,14 +103,35 @@ executables: []
|
|
89
103
|
extensions: []
|
90
104
|
extra_rdoc_files: []
|
91
105
|
files:
|
92
|
-
-
|
93
|
-
-
|
106
|
+
- assets/script/upload.js.coffee
|
107
|
+
- assets/style/file.scss
|
108
|
+
- config/early/carrierwave.rb
|
109
|
+
- config/early/mini_magick.rb
|
110
|
+
- config/locales/de.yml
|
111
|
+
- config/locales/en.yml
|
112
|
+
- data/files/decko_logo/image-original.svg
|
113
|
+
- data/files/favicon.png
|
114
|
+
- data/files/favicon/image-icon.png
|
115
|
+
- data/files/favicon/image-large.png
|
116
|
+
- data/files/favicon/image-medium.png
|
117
|
+
- data/files/favicon/image-original.png
|
118
|
+
- data/files/favicon/image-small.png
|
119
|
+
- data/files/file1.txt
|
120
|
+
- data/files/file2.txt
|
121
|
+
- data/files/file3.txt
|
122
|
+
- data/files/logo.svg
|
123
|
+
- data/files/logo/image-original.svg
|
124
|
+
- data/files/mao2.jpg
|
125
|
+
- data/files/mod_carrierwave_script_asset_output/file.js
|
126
|
+
- data/files/rails.gif
|
127
|
+
- data/real.yml
|
128
|
+
- db/migrate_core_cards/20230130141025_move_favicon.rb
|
129
|
+
- lib/card/mod/carrierwave.rb
|
94
130
|
- lib/carrier_wave/card_mount.rb
|
95
131
|
- lib/carrier_wave/file_card_uploader.rb
|
96
132
|
- lib/carrier_wave/file_card_uploader/path.rb
|
97
133
|
- lib/carrier_wave/image_card_uploader.rb
|
98
|
-
-
|
99
|
-
- locales/en.yml
|
134
|
+
- lib/carrier_wave/test_file.rb
|
100
135
|
- set/abstract/attachment.rb
|
101
136
|
- set/abstract/attachment/00_upload_cache.rb
|
102
137
|
- set/abstract/attachment/01_storage_type.rb
|
@@ -110,6 +145,7 @@ files:
|
|
110
145
|
- set/self/favicon.rb
|
111
146
|
- set/self/new_file.rb
|
112
147
|
- set/self/new_image.rb
|
148
|
+
- set/self/search.rb
|
113
149
|
- set/type/file.rb
|
114
150
|
- set/type/file/core.haml
|
115
151
|
- set/type/file/file_chooser.haml
|
@@ -126,6 +162,7 @@ metadata:
|
|
126
162
|
wiki_uri: https://decko.org
|
127
163
|
documentation_url: http://docs.decko.org/
|
128
164
|
card-mod: carrierwave
|
165
|
+
card-mod-group: gem-defaults
|
129
166
|
post_install_message:
|
130
167
|
rdoc_options: []
|
131
168
|
require_paths:
|
@@ -141,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
178
|
- !ruby/object:Gem::Version
|
142
179
|
version: '0'
|
143
180
|
requirements: []
|
144
|
-
rubygems_version: 3.
|
181
|
+
rubygems_version: 3.3.11
|
145
182
|
signing_key:
|
146
183
|
specification_version: 4
|
147
184
|
summary: File and Image handling
|
File without changes
|
File without changes
|
File without changes
|