diff --git a/ogcp/forms/action_forms.py b/ogcp/forms/action_forms.py index e72e37c..82958fb 100644 --- a/ogcp/forms/action_forms.py +++ b/ogcp/forms/action_forms.py @@ -7,7 +7,8 @@ from wtforms import ( Form, SubmitField, HiddenField, SelectField, BooleanField, IntegerField, - StringField, RadioField, FormField, FieldList, DecimalField, TextAreaField + StringField, RadioField, FormField, FieldList, DecimalField, TextAreaField, + SelectMultipleField ) from wtforms.validators import InputRequired from flask_wtf import FlaskForm @@ -236,6 +237,20 @@ class ImageDetailsForm(FlaskForm): permissions = StringField(label=_l('Permissions')) software_id = StringField(label=_l('Software id')) checksum = StringField(label=_l('Checksum')) + scopes = SelectMultipleField( + label=_l('Allowed scopes'), + description=_l('No scope selection gives full access'), + ) + +class ImageConfigForm(FlaskForm): + image_id = HiddenField() + server = HiddenField() + name = HiddenField() + scopes = SelectMultipleField( + label=_l('Allowed scopes'), + description=_l('No scope selection gives full access'), + ) + submit = SubmitField(label=_l('Submit')) class ServerForm(FlaskForm): name = StringField(label=_l('Name'), diff --git a/ogcp/templates/actions/image_config.html b/ogcp/templates/actions/image_config.html new file mode 100644 index 0000000..c286683 --- /dev/null +++ b/ogcp/templates/actions/image_config.html @@ -0,0 +1,24 @@ +{% extends 'images.html' %} +{% import "bootstrap/wtf.html" as wtf %} + +{% set btn_back = true %} + +{% block content %} + +