Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
web app
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ICNML
web app
Commits
209f4b3b
Commit
209f4b3b
authored
5 years ago
by
Marco De Donno
Browse files
Options
Downloads
Patches
Plain Diff
Add the button to delete a segmentation zone from a tenprint card
parent
6e998702
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/app.css
+1
-1
1 addition, 1 deletion
app/app.css
module.py
+20
-0
20 additions, 0 deletions
module.py
templates/tp_template/template.html
+46
-5
46 additions, 5 deletions
templates/tp_template/template.html
with
67 additions
and
6 deletions
app/app.css
+
1
−
1
View file @
209f4b3b
...
...
@@ -205,7 +205,7 @@ button:focus {
#tenprint_zones_table
{
display
:
grid
;
grid-template-columns
:
auto
repeat
(
5
,
1
fr
);
grid-template-columns
:
auto
repeat
(
5
,
1
fr
)
auto
;
grid-gap
:
10px
;
margin-top
:
40px
;
}
...
...
This diff is collapsed.
Click to expand it.
module.py
+
20
−
0
View file @
209f4b3b
...
...
@@ -2112,6 +2112,7 @@ def tp_template( id, t ):
card_id
=
id
,
t
=
t
,
datacolumns
=
datacolumns
,
**
config
.
misc
)
else
:
...
...
@@ -2143,6 +2144,25 @@ def update_zone_coordinates( id ):
else
:
return
abort
(
403
)
@app.route
(
baseurl
+
'
/template/tenprint/<id>/delete/zone
'
,
methods
=
[
"
POST
"
]
)
@login_required
def
delete_zone_coordinates
(
id
):
pc
=
request
.
form
.
get
(
"
pc
"
)
try
:
sql
=
"
DELETE FROM tenprint_zones WHERE card = %s AND pc = %s
"
config
.
db
.
query
(
sql
,
(
id
,
pc
,
)
)
config
.
db
.
commit
()
return
jsonify
(
{
'
error
'
:
False
}
)
except
:
return
jsonify
(
{
'
error
'
:
True
}
)
################################################################################
# Home page
...
...
This diff is collapsed.
Click to expand it.
templates/tp_template/template.html
+
46
−
5
View file @
209f4b3b
...
...
@@ -11,6 +11,19 @@
<script
type=
"text/javascript"
src=
"{{ url_for( 'send_app_files', path = 'functions.js' ) }}"
></script>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"{{ url_for( 'send_app_files', path = 'app.css' ) }}"
>
<style
type=
"text/css"
>
#tenprint_zones_table
>
div
>
a
{
padding
:
2px
;
width
:
16px
;
height
:
16px
;
background
:
#d22e2a
;
}
.ui-button
.ui-icon
,
.ui-button
:hover
.ui-icon
{
background-image
:
url( {{ jquery_ui_white_bg_icons }} )
;
}
</style>
<script
type=
"text/javascript"
>
baseurl
=
"
{{ baseurl }}
"
;
var
start_f1_f5_button
=
false
;
...
...
@@ -209,6 +222,22 @@
}
}
}
var
delete_zone
=
function
(
pc
)
{
$
.
ajax
(
{
url
:
"
{{ url_for( 'delete_zone_coordinates', id = card_id ) }}
"
,
dataType
:
'
json
'
,
method
:
'
POST
'
,
data
:
{
pc
:
pc
},
success
:
function
(
data
)
{
location
.
reload
();
}
}
);
}
</script>
</head>
<body
class=
"icnml_main_layout"
>
...
...
@@ -257,11 +286,12 @@
</div>
<div
id=
"tenprint_zones_table"
>
<div></div>
<div>
Top left x
</div>
<div>
Top left y
</div>
<div>
Bottom right x
</div>
<div>
Bottom right y
</div>
<div>
Rotation
</div>
<div>
TL x
</div>
<div>
TL y
</div>
<div>
BR x
</div>
<div>
BR y
</div>
<div>
Angle
</div>
<div>
Delete
</div>
{% for zone in zones %}
<div
id=
"icnml_zone_{{ zone[ 'pc' ] }}_name"
style=
"padding-right: 20px"
>
{{ zone[ 'pc_name' ] }}
</div>
...
...
@@ -281,6 +311,12 @@
<div
id=
"icnml_zone_{{ zone[ 'pc' ] }}_angle"
>
<input
class=
"tenprint_zones_table_input"
value=
"{{ zone[ 'angle' ] }}"
/>
</div>
<div
id=
"icnml_zone_{{ zone[ 'pc' ] }}_delete"
>
<a
class=
"ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
id=
"icnml_zone_{{ zone[ 'pc' ] }}_delete_button"
role=
"button"
aria-disabled=
"false"
>
<span
class=
"ui-icon ui-icon-closethick"
></span>
</a>
</div>
{% endfor %}
</div>
<div
style=
"margin-top: 20px"
>
...
...
@@ -461,6 +497,11 @@
update_zone_coordinates
(
"
{{ zone[ 'pc' ] }}
"
,
"
{{ d }}
"
,
$
(
this
).
val
()
);
}
);
{
%
endfor
%
}
$
(
"
#icnml_zone_{{ zone[ 'pc' ] }}_delete_button
"
).
on
(
'
click
'
,
function
()
{
delete_zone
(
"
{{ zone[ 'pc' ] }}
"
);
}
);
{
%
endfor
%
}
$
(
'
#template_svg
'
).
on
(
'
mousemove
'
,
function
(
event
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment