Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gabriel Monnerat
erp5
Commits
e7213f93
Commit
e7213f93
authored
Feb 04, 2020
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_document_scanner: mark a thumbnail in red if the upload failed
parent
527e9c3f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
7 deletions
+17
-7
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_css.css
...eItem/web_page_module/rjs_gadget_document_scanner_css.css
+4
-0
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_css.xml
...eItem/web_page_module/rjs_gadget_document_scanner_css.xml
+1
-1
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.js
...ateItem/web_page_module/rjs_gadget_document_scanner_js.js
+10
-4
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.xml
...teItem/web_page_module/rjs_gadget_document_scanner_js.xml
+2
-2
No files found.
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_css.css
View file @
e7213f93
...
...
@@ -68,4 +68,8 @@ div[data-gadget-url$="gadget_document_scanner.html"] > .camera > .thumbnail-list
div
[
data-gadget-url
$
=
"gadget_document_scanner.html"
]
.show-img
{
width
:
35%
;
}
div
[
data-gadget-url
$
=
"gadget_document_scanner.html"
]
.upload-error
{
border
:
3px
solid
red
;
}
\ No newline at end of file
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_css.xml
View file @
e7213f93
...
...
@@ -262,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>
1580
768900.5
</float>
<float>
1580
843720.26
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.js
View file @
e7213f93
...
...
@@ -101,7 +101,7 @@
},
function
()
{
// XXX TODO: Handle error case
var
state_dict
=
{};
state_dict
[
'
blob_state_
'
+
blob_page
]
=
'
E
rror
'
;
state_dict
[
'
blob_state_
'
+
blob_page
]
=
'
e
rror
'
;
return
gadget
.
changeState
(
state_dict
);
});
}
...
...
@@ -177,6 +177,7 @@
function
buildPreviousThumbnailDom
(
gadget
)
{
var
i
,
img_class
,
len
=
gadget
.
state
.
page_count
,
thumbnail_dom_list
=
[];
...
...
@@ -193,12 +194,17 @@
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
// XXX TODO display a loader when saving
if
(
gadget
.
state
[
'
blob_state_
'
+
i
]
!==
'
deleted
'
)
{
if
(
gadget
.
state
[
'
blob_state_
'
+
i
]
===
"
error
"
)
{
img_class
=
"
show-img upload-error
"
;
}
else
{
img_class
=
"
show-img
"
;
}
thumbnail_dom_list
.
push
(
domsugar
(
'
button
'
,
{
type
:
"
button
"
,
// Do not allow to show again the current image
// or do not allow to show saving image (to simplify button management)
disabled
:
(
i
===
gadget
.
state
.
page
)
||
(
gadget
.
state
[
'
blob_state_
'
+
i
]
===
'
saving
'
)
},
[
domsugar
(
"
img
"
,
{
"
class
"
:
"
show-img
"
,
},
[
domsugar
(
"
img
"
,
{
"
class
"
:
img_class
,
'
data-page
'
:
i
,
src
:
gadget
.
state
[
'
blob_url_
'
+
i
]})]));
}
...
...
@@ -362,7 +368,7 @@
],
div
;
if
(
gadget
.
state
[
'
blob_state_
'
+
gadget
.
state
.
page
]
===
'
failed
'
)
{
if
(
gadget
.
state
[
'
blob_state_
'
+
gadget
.
state
.
page
]
===
'
error
'
)
{
button_list
.
push
(
// XXX TODO improve icon
domsugar
(
'
button
'
,
{
type
:
'
button
'
,
...
...
@@ -475,7 +481,7 @@
// XXX TODO use a more precise selector
return
buildPreviousThumbnailDom
(
gadget
)
.
push
(
function
(
result
)
{
thumbnail_container
=
gadget
.
element
.
querySelector
(
'
ol
'
);
thumbnail_container
=
gadget
.
element
.
querySelector
(
'
.thumbnail-list
'
);
thumbnail_container
.
parentElement
.
replaceChild
(
result
,
thumbnail_container
...
...
bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.xml
View file @
e7213f93
...
...
@@ -244,7 +244,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
981.
39871.25821.10052
</string>
</value>
<value>
<string>
981.
40903.42421.64529
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -262,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>
15808
32330.0
8
</float>
<float>
15808
45018.9
8
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment