From 52c5555f659db69995296c6b3bad68244ceeb2f4 Mon Sep 17 00:00:00 2001 From: Javier Hernandez Date: Thu, 21 Dec 2023 11:42:37 +0100 Subject: templates: rename 'create' button to 'submit' In client_details template, rename 'create' button to 'submit'. This template is used by both client-add and client-edit commands; it would not make sense to have a 'Create' button in client-edit. --- ogcp/forms/action_forms.py | 2 +- ogcp/templates/actions/client_details.html | 2 +- ogcp/views.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ogcp/forms/action_forms.py b/ogcp/forms/action_forms.py index 3d02f8a..64b292a 100644 --- a/ogcp/forms/action_forms.py +++ b/ogcp/forms/action_forms.py @@ -122,7 +122,7 @@ class ClientDetailsForm(FlaskForm): repo = SelectField(label=_l('Repository')) room = SelectField(label=_l('Room')) boot = SelectField(label=_l('Boot Mode')) - create = SubmitField(label=_l('Create')) + submit = SubmitField(label=_l('Submit')) class ImportClientsForm(FlaskForm): server = HiddenField() diff --git a/ogcp/templates/actions/client_details.html b/ogcp/templates/actions/client_details.html index 4b83c21..620d8eb 100644 --- a/ogcp/templates/actions/client_details.html +++ b/ogcp/templates/actions/client_details.html @@ -13,7 +13,7 @@ {{ wtf.quick_form(form, method='post', - button_map={'create': 'primary'}, + button_map={'submit': 'primary'}, extra_classes="mx-5") }} diff --git a/ogcp/views.py b/ogcp/views.py index b59f0f0..e745d7d 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -876,7 +876,7 @@ def action_client_info(): rooms = [(room['id'], room['name']) for room in rooms] form.room.choices = list(rooms) - form.create.render_kw = {"style": "visibility:hidden;"} + form.submit.render_kw = {"style": "visibility:hidden;"} r = server.get('/images') images = r.json()['images'] @@ -965,7 +965,7 @@ def action_client_update(): form.repo.choices.extend([(repo["id"], repo["name"]) for repo in repositories if db_client['repo_id'] != repo["id"]]) - form.create.render_kw = {"formaction": url_for('action_client_update')} + form.submit.render_kw = {"formaction": url_for('action_client_update')} return render_template('actions/client_details.html', form=form, parent="scopes.html", scopes=scopes) @@ -1019,7 +1019,7 @@ def action_client_add(): repositories = get_repositories(server) form.repo.choices = [(repo["id"], repo["name"]) for repo in repositories] - form.create.render_kw = {"formaction": url_for('action_client_add')} + form.submit.render_kw = {"formaction": url_for('action_client_add')} scopes, clients = get_scopes() return render_template('actions/client_details.html', form=form, parent="scopes.html", scopes=scopes) -- cgit v1.2.3-18-g5258