generated from MinBZK/python-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2684ac2
commit d153bd1
Showing
31 changed files
with
2,263 additions
and
1,001 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
from gettext import NullTranslations | ||
|
||
from amt.schema.webform import WebForm, WebFormField, WebFormFieldType, WebFormOption, WebFormTextCloneableField | ||
|
||
|
||
async def get_measure_form( | ||
id: str, current_values: dict[str, str | list[str] | list[tuple[str, str]]], translations: NullTranslations | ||
) -> WebForm: | ||
_ = translations.gettext | ||
|
||
measure_form: WebForm = WebForm(id="", post_url="") | ||
|
||
measure_form.fields = [ | ||
WebFormField( | ||
type=WebFormFieldType.SELECT, | ||
name="measure_state", | ||
label=_("Status"), | ||
options=[ | ||
WebFormOption(value="to do", display_value="to do"), | ||
WebFormOption(value="in progress", display_value="in progress"), | ||
WebFormOption(value="in review", display_value="in review"), | ||
WebFormOption(value="done", display_value="done"), | ||
WebFormOption(value="not implemented", display_value="not implemented"), | ||
], | ||
default_value=current_values.get("measure_state"), | ||
group="1", | ||
), | ||
WebFormField( | ||
type=WebFormFieldType.TEXTAREA, | ||
name="measure_value", | ||
default_value=current_values.get("measure_value"), | ||
label=_("Information on how this measure is implemented"), | ||
placeholder=_("Describe how the measure has been implemented, including challenges and solutions."), | ||
group="1", | ||
), | ||
WebFormField( | ||
type=WebFormFieldType.FILE, | ||
name="measure_files", | ||
default_value=current_values.get("measure_files"), | ||
label=_("Add files"), | ||
placeholder=_(""), | ||
group="1", | ||
), | ||
WebFormTextCloneableField( | ||
clone_button_name=_("Add URI"), | ||
name="measure_links", | ||
default_value=current_values.get("measure_links"), | ||
label=_("Add links to documents"), | ||
placeholder=_("URI"), | ||
group="1", | ||
), | ||
] | ||
|
||
return measure_form |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.