Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
third-party
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
third-party
Commits
be9db336
Commit
be9db336
authored
Jun 21, 2022
by
Félicie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
message added
parent
18789343
Pipeline
#2258
passed with stage
in 1 minute 27 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
9 deletions
+12
-9
shelfs_admin.css
shelfs/static/css/shelfs_admin.css
+1
-1
shelfs_admin.js
shelfs/static/js/shelfs_admin.js
+5
-7
admin.html
templates/shelfs/admin.html
+6
-1
No files found.
shelfs/static/css/shelfs_admin.css
View file @
be9db336
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
padding
:
20px
;
padding
:
20px
;
}
}
span
.shelf
{
font-weight
:
bold
;}
span
.shelf
{
font-weight
:
bold
;}
button
.add-products
{
display
:
none
;}
.add-products
{
display
:
none
;}
td
.p_nb
,
td
.p_nb
,
td
.products
.fa-plus-circle
,
td
.products
.fa-plus-circle
,
...
...
shelfs/static/js/shelfs_admin.js
View file @
be9db336
...
@@ -16,7 +16,6 @@ var main_content = $('#main-content'),
...
@@ -16,7 +16,6 @@ var main_content = $('#main-content'),
adding_pdts_tpl
=
$
(
'#adding-products'
).
clone
()
adding_pdts_tpl
=
$
(
'#adding-products'
).
clone
()
.
removeAttr
(
'id'
),
.
removeAttr
(
'id'
),
active_phase
=
'main'
,
active_phase
=
'main'
,
add_pdts_btn_text
=
'AJOUTER AU RAYON'
,
add_to_shelf_product_ids
=
[],
add_to_shelf_product_ids
=
[],
barcodes
=
null
;
barcodes
=
null
;
...
@@ -418,8 +417,7 @@ var addProductToList = async function(barcode) {
...
@@ -418,8 +417,7 @@ var addProductToList = async function(barcode) {
$
(
'<td>'
).
html
(
delete_icon
+
" "
+
print_icon
)
$
(
'<td>'
).
html
(
delete_icon
+
" "
+
print_icon
)
.
appendTo
(
pdt_line
);
.
appendTo
(
pdt_line
);
adding_pdts_tpl
.
find
(
'#added_products tbody'
).
append
(
pdt_line
);
adding_pdts_tpl
.
find
(
'#added_products tbody'
).
append
(
pdt_line
);
main_content
.
find
(
'button.add-products'
).
css
(
'display'
,
'block'
)
main_content
.
find
(
'.add-products'
).
css
(
'display'
,
'block'
)
.
html
(
add_pdts_btn_text
);
}
}
}
}
};
};
...
@@ -436,7 +434,7 @@ var addProducts = async function() {
...
@@ -436,7 +434,7 @@ var addProducts = async function() {
main_content
.
html
(
adding_pdts_tpl
);
main_content
.
html
(
adding_pdts_tpl
);
active_phase
=
"adding_products"
;
active_phase
=
"adding_products"
;
main_content
.
find
(
'
button
.add-products'
).
css
(
'display'
,
'none'
);
main_content
.
find
(
'.add-products'
).
css
(
'display'
,
'none'
);
if
(
admin_ids
.
find
(
id
=>
id
==
getCookie
(
"uid"
)))
$
(
'.add-search'
).
show
();
if
(
admin_ids
.
find
(
id
=>
id
==
getCookie
(
"uid"
)))
$
(
'.add-search'
).
show
();
};
};
...
@@ -453,7 +451,7 @@ var recordProductsAddedShelf = function() {
...
@@ -453,7 +451,7 @@ var recordProductsAddedShelf = function() {
});
});
if
(
is_time_to
(
'add_pdts_to_shelf'
,
5000
))
{
// prevent double click or browser hic up bug
if
(
is_time_to
(
'add_pdts_to_shelf'
,
5000
))
{
// prevent double click or browser hic up bug
main_content
.
find
(
'
button
.add-products'
).
html
(
loading_img
);
main_content
.
find
(
'.add-products'
).
html
(
loading_img
);
post_form
(
post_form
(
'/shelfs/admin/add_products'
,
'/shelfs/admin/add_products'
,
{
bc
:
JSON
.
stringify
(
barcodes
),
shelf_id
:
id
},
{
bc
:
JSON
.
stringify
(
barcodes
),
shelf_id
:
id
},
...
@@ -477,7 +475,7 @@ var recordProductsAddedShelf = function() {
...
@@ -477,7 +475,7 @@ var recordProductsAddedShelf = function() {
else
if
(
typeof
rData
.
res
.
msg
!=
"undefined"
)
else
if
(
typeof
rData
.
res
.
msg
!=
"undefined"
)
msg
=
rData
.
res
.
msg
;
msg
=
rData
.
res
.
msg
;
alert
(
msg
);
alert
(
msg
);
main_content
.
find
(
'
button.add-products'
).
html
(
add_pdts_btn_text
);
main_content
.
find
(
'
.add-products'
)
}
}
}
}
...
@@ -571,7 +569,7 @@ $(document).ready(function() {
...
@@ -571,7 +569,7 @@ $(document).ready(function() {
$
(
document
).
on
(
'click'
,
'.obc .fa-trash'
,
deleteBarcodeFromList
);
$
(
document
).
on
(
'click'
,
'.obc .fa-trash'
,
deleteBarcodeFromList
);
$
(
document
).
on
(
'click'
,
'.obc .fa-print'
,
printProduct
);
$
(
document
).
on
(
'click'
,
'.obc .fa-print'
,
printProduct
);
$
(
document
).
on
(
'click'
,
'td.products .fa-plus-circle'
,
addProducts
);
$
(
document
).
on
(
'click'
,
'td.products .fa-plus-circle'
,
addProducts
);
$
(
document
).
on
(
'click'
,
'#main-content
button
.add-products'
,
recordProductsAddedShelf
);
$
(
document
).
on
(
'click'
,
'#main-content .add-products'
,
recordProductsAddedShelf
);
$
(
document
).
on
(
'click'
,
'td.p_nb'
,
showProductsList
);
$
(
document
).
on
(
'click'
,
'td.p_nb'
,
showProductsList
);
try
{
try
{
if
(
admin_ids
.
find
(
id
=>
id
==
getCookie
(
"uid"
)))
{
if
(
admin_ids
.
find
(
id
=>
id
==
getCookie
(
"uid"
)))
{
...
...
templates/shelfs/admin.html
View file @
be9db336
...
@@ -70,7 +70,12 @@
...
@@ -70,7 +70,12 @@
</tbody>
</tbody>
</table>
</table>
<button
type=
"button"
class=
"btn--primary add-products"
></button>
<div
class =
"add-products"
>
<p>
VOUS POUVEZ AJOUTER PLUSIEURS PRODUITS A LA FOIS AVANT DE VALIDER
</p>
<button
type=
"button"
class=
"btn--primary"
>
AJOUTER LES PRODUITS AU RAYON
</button>
</div>
</div>
</div>
<div
id=
"main-table-wrap"
>
<div
id=
"main-table-wrap"
>
<table
class=
"display shelfs"
width=
"99%"
cellspacing=
"0"
></table>
<table
class=
"display shelfs"
width=
"99%"
cellspacing=
"0"
></table>
...
...
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