mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +00:00
Merge branch 'development' of gitlab.ub.uni-bielefeld.de:sfb1288inf/nopaque into development
This commit is contained in:
commit
b0447e2544
@ -42,6 +42,9 @@ class ContributionBaseForm(FlaskForm):
|
|||||||
'Publishing year',
|
'Publishing year',
|
||||||
validators=[InputRequired()]
|
validators=[InputRequired()]
|
||||||
)
|
)
|
||||||
|
compatible_service_versions = SelectMultipleField(
|
||||||
|
'Compatible service versions'
|
||||||
|
)
|
||||||
shared = BooleanField(
|
shared = BooleanField(
|
||||||
'Shared'
|
'Shared'
|
||||||
)
|
)
|
||||||
@ -53,9 +56,6 @@ class CreateTesseractOCRPipelineModelForm(ContributionBaseForm):
|
|||||||
'File',
|
'File',
|
||||||
validators=[FileRequired()]
|
validators=[FileRequired()]
|
||||||
)
|
)
|
||||||
compatible_service_versions = SelectMultipleField(
|
|
||||||
'Compatible service versions'
|
|
||||||
)
|
|
||||||
|
|
||||||
def validate_tesseract_model_file(self, field):
|
def validate_tesseract_model_file(self, field):
|
||||||
current_app.logger.warning(field.data.filename)
|
current_app.logger.warning(field.data.filename)
|
||||||
@ -77,9 +77,6 @@ class CreateSpaCyNLPPipelineModelForm(ContributionBaseForm):
|
|||||||
'File',
|
'File',
|
||||||
validators=[FileRequired()]
|
validators=[FileRequired()]
|
||||||
)
|
)
|
||||||
compatible_service_versions = SelectMultipleField(
|
|
||||||
'Compatible service versions'
|
|
||||||
)
|
|
||||||
pipeline_name = StringField(
|
pipeline_name = StringField(
|
||||||
'Pipeline name',
|
'Pipeline name',
|
||||||
validators=[InputRequired(), Length(max=64)]
|
validators=[InputRequired(), Length(max=64)]
|
||||||
@ -103,9 +100,15 @@ class CreateSpaCyNLPPipelineModelForm(ContributionBaseForm):
|
|||||||
class EditContributionBaseForm(ContributionBaseForm):
|
class EditContributionBaseForm(ContributionBaseForm):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class EditTesseractOCRPipelineModelForm(EditContributionBaseForm):
|
class EditTesseractOCRPipelineModelForm(EditContributionBaseForm):
|
||||||
pass
|
def __init__(self, *args, **kwargs):
|
||||||
|
service_manifest = SERVICES['tesseract-ocr-pipeline']
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
self.compatible_service_versions.choices = [('', 'Choose your option')]
|
||||||
|
self.compatible_service_versions.choices += [
|
||||||
|
(x, x) for x in service_manifest['versions'].keys()
|
||||||
|
]
|
||||||
|
self.compatible_service_versions.default = ''
|
||||||
|
|
||||||
|
|
||||||
class EditSpaCyNLPPipelineModelForm(EditContributionBaseForm):
|
class EditSpaCyNLPPipelineModelForm(EditContributionBaseForm):
|
||||||
@ -113,3 +116,11 @@ class EditSpaCyNLPPipelineModelForm(EditContributionBaseForm):
|
|||||||
'Pipeline name',
|
'Pipeline name',
|
||||||
validators=[InputRequired(), Length(max=64)]
|
validators=[InputRequired(), Length(max=64)]
|
||||||
)
|
)
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
service_manifest = SERVICES['spacy-nlp-pipeline']
|
||||||
|
self.compatible_service_versions.choices = [('', 'Choose your option')]
|
||||||
|
self.compatible_service_versions.choices += [
|
||||||
|
(x, x) for x in service_manifest['versions'].keys()
|
||||||
|
]
|
||||||
|
self.compatible_service_versions.default = ''
|
||||||
|
@ -429,7 +429,7 @@ class Utils {
|
|||||||
} else {
|
} else {
|
||||||
msg = `Model "${tesseractOCRPipelineModel.title}" is now private`;
|
msg = `Model "${tesseractOCRPipelineModel.title}" is now private`;
|
||||||
}
|
}
|
||||||
fetch(`/contributions/spacy-nlp-pipeline-models/${tesseractOCRPipelineModel.id}/toggle-public-status`, {method: 'POST', headers: {Accept: 'application/json'}})
|
fetch(`/contributions/tesseract-ocr-pipeline-models/${tesseractOCRPipelineModel.id}/toggle-public-status`, {method: 'POST', headers: {Accept: 'application/json'}})
|
||||||
.then(
|
.then(
|
||||||
(response) => {
|
(response) => {
|
||||||
app.flash(msg, 'corpus');
|
app.flash(msg, 'corpus');
|
||||||
|
@ -41,6 +41,9 @@
|
|||||||
<div class="col s12 l10">
|
<div class="col s12 l10">
|
||||||
{{ wtf.render_field(form.version, material_icon='apps') }}
|
{{ wtf.render_field(form.version, material_icon='apps') }}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col s12 l6">
|
||||||
|
{{ wtf.render_field(form.compatible_service_versions) }}
|
||||||
|
</div>
|
||||||
<div class="col s12 l6 right-align" style="padding-right:20px;">
|
<div class="col s12 l6 right-align" style="padding-right:20px;">
|
||||||
<p></p>
|
<p></p>
|
||||||
<br>
|
<br>
|
||||||
|
@ -38,6 +38,9 @@
|
|||||||
<div class="col s12 l10">
|
<div class="col s12 l10">
|
||||||
{{ wtf.render_field(form.version, material_icon='apps') }}
|
{{ wtf.render_field(form.version, material_icon='apps') }}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col s12 l6">
|
||||||
|
{{ wtf.render_field(form.compatible_service_versions) }}
|
||||||
|
</div>
|
||||||
<div class="col s12 l6 right-align" style="padding-right:20px;">
|
<div class="col s12 l6 right-align" style="padding-right:20px;">
|
||||||
<p></p>
|
<p></p>
|
||||||
<br>
|
<br>
|
||||||
|
Loading…
Reference in New Issue
Block a user