Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
f506a562
Commit
f506a562
authored
5 years ago
by
Patrick Jentsch
Browse files
Options
Downloads
Patches
Plain Diff
Add version field for ocr job
parent
a1be95ff
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/services/forms.py
+14
-0
14 additions, 0 deletions
app/services/forms.py
app/services/views.py
+1
-1
1 addition, 1 deletion
app/services/views.py
app/templates/services/ocr.html.j2
+29
-15
29 additions, 15 deletions
app/templates/services/ocr.html.j2
with
44 additions
and
16 deletions
app/services/forms.py
+
14
−
0
View file @
f506a562
...
...
@@ -29,6 +29,13 @@ class NewOCRJobForm(FlaskForm):
'
Title
'
,
validators
=
[
DataRequired
(),
Length
(
1
,
32
)]
)
version
=
SelectField
(
'
Version
'
,
choices
=
[(
''
,
'
Choose your option
'
),
(
'
latest
'
,
'
Latest
'
),
],
validators
=
[
DataRequired
()]
)
def
validate_files
(
form
,
field
):
for
file
in
field
.
data
:
...
...
@@ -62,6 +69,13 @@ class NewNLPJobForm(FlaskForm):
'
Title
'
,
validators
=
[
DataRequired
(),
Length
(
1
,
32
)]
)
version
=
SelectField
(
'
Version
'
,
choices
=
[(
''
,
'
Choose your option
'
),
(
'
latest
'
,
'
Latest
'
),
],
validators
=
[
DataRequired
()]
)
def
validate_files
(
form
,
field
):
for
file
in
field
.
data
:
...
...
This diff is collapsed.
Click to expand it.
app/services/views.py
+
1
−
1
View file @
f506a562
...
...
@@ -28,7 +28,7 @@ def ocr():
'
requested_memory
'
:
2048
,
'
service
'
:
'
ocr
'
,
'
service_args
'
:
{
'
lang
'
:
new_ocr_job_form
.
language
.
data
,
'
version
'
:
'
latest
'
'
version
'
:
new_ocr_job_form
.
version
.
data
},
'
status
'
:
'
queued
'
}
...
...
This diff is collapsed.
Click to expand it.
app/templates/services/ocr.html.j2
+
29
−
15
View file @
f506a562
...
...
@@ -78,8 +78,8 @@
<div class="col s12">
<div class="card">
<
div class="card-content
">
<
form method="POST" enctype="multipart/form-data
">
<
form method="POST" enctype="multipart/form-data
">
<
div class="card-content
">
{{ new_ocr_job_form.hidden_tag() }}
<div class="row">
<div class="col s12 m4">
...
...
@@ -92,17 +92,29 @@
{% endfor %}
</div>
</div>
<div class="col s12 m
8
">
<div class="col s12 m
4
">
<div class="input-field">
<i class="material-icons prefix">
description
</i>
{{ new_ocr_job_form.
description
() }}
{{ new_ocr_job_form.
description
.label }}
{% for error in new_ocr_job_form.
description
.errors %}
<i class="material-icons prefix">
language
</i>
{{ new_ocr_job_form.
language
() }}
{{ new_ocr_job_form.
language
.label }}
{% for error in new_ocr_job_form.
language
.errors %}
<span class="helper-text red-text">{{ error }}</span>
{% endfor %}
</div>
</div>
<div class="col s12 m8">
<div class="col s12 m4">
<div class="input-field">
<i class="material-icons prefix">language</i>
{{ new_ocr_job_form.version() }}
{{ new_ocr_job_form.version.label }}
{% for error in new_ocr_job_form.version.errors %}
<span class="helper-text red-text">{{ error }}</span>
{% endfor %}
</div>
</div>
</div>
<div class="row">
<div class="col s12 m6">
<div class="file-field input-field">
<div class="btn">
<span>{{ new_ocr_job_form.files.label.text }}</span>
...
...
@@ -116,20 +128,22 @@
{% endfor %}
</div>
</div>
<div class="col s12 m
4
">
<div class="col s12 m
6
">
<div class="input-field">
<i class="material-icons prefix">
language
</i>
{{ new_ocr_job_form.
language
() }}
{{ new_ocr_job_form.
language
.label }}
{% for error in new_ocr_job_form.
language
.errors %}
<i class="material-icons prefix">
description
</i>
{{ new_ocr_job_form.
description
() }}
{{ new_ocr_job_form.
description
.label }}
{% for error in new_ocr_job_form.
description
.errors %}
<span class="helper-text red-text">{{ error }}</span>
{% endfor %}
</div>
</div>
</div>
</div>
<div class="card-action right-align">
{{ new_ocr_job_form.submit(class='btn') }}
</
form
>
</
div
>
</
div
>
</
form
>
</div>
</div>
{% endblock %}
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