From cf613ab34a1f644ae6776608b39e3acca0899f48 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 6 Sep 2020 14:47:14 -0500 Subject: [PATCH] Split "new project" forms into multiple sections --- tailbone/templates/generate_project.mako | 246 +++++++++++++++-------- tailbone/views/projects.py | 29 --- 2 files changed, 164 insertions(+), 111 deletions(-) diff --git a/tailbone/templates/generate_project.mako b/tailbone/templates/generate_project.mako index 93da4df6..419f12c7 100644 --- a/tailbone/templates/generate_project.mako +++ b/tailbone/templates/generate_project.mako @@ -13,102 +13,184 @@ -
-
-

New 'rattail' Project

-
-
-
- ${h.form(request.current_route_url(), ref='rattailForm')} - ${h.csrf_token(request)} - ${h.hidden('project_type', value='rattail')} +
+ ${h.form(request.current_route_url(), ref='rattailForm')} + ${h.csrf_token(request)} + ${h.hidden('project_type', value='rattail')} +
+
+
+

Naming

+
+
+
- - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${h.end_form()} +
+
+
+
+

Database

+
+
+
+ + + + + + + + + + + + + + + + +
+
+
+
+
+
+

Web App

+
+
+
+ + + + + + + + + + + +
+
+
+
+
+
+

Integrations

+
+
+
+ + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+

Deployment

+
+
+
+ + + + + + +
+
+
+ ${h.end_form()}
-
-
-

New 'byjove' Project

-
-
-
- ${h.form(request.current_route_url(), ref='byjoveForm')} - ${h.csrf_token(request)} - ${h.hidden('project_type', value='byjove')} +
+ ${h.form(request.current_route_url(), ref='byjoveForm')} + ${h.csrf_token(request)} + ${h.hidden('project_type', value='byjove')} - - - +
+
+
+

Naming

+
+
+
- - - + + + - ${h.end_form()} + + + + +
+ + ${h.end_form()}

@@ -134,7 +216,7 @@ python_project_name: "Acme-Okay-Then", python_package_name: "okay_then", has_rattail_db: true, - extends_rattail_db_schema: false, + extends_rattail_db_schema: true, uses_rattail_batch_schema: false, has_tailbone_web_app: true, has_tailbone_web_api: false, diff --git a/tailbone/views/projects.py b/tailbone/views/projects.py index df6d072c..8060de4d 100644 --- a/tailbone/views/projects.py +++ b/tailbone/views/projects.py @@ -120,45 +120,16 @@ class GenerateProjectView(View): schema = GenerateByjoveProject if project_type == 'byjove' else GenerateProject form = forms.Form(schema=schema(), request=self.request, use_buefy=use_buefy) - form.submit_label = "Generate Project" - form.auto_disable = False - form.auto_disable_save = False if form.validate(newstyle=True): zipped = self.generate_project(project_type, form) return self.file_response(zipped) # self.request.session.flash("New project was generated: {}".format(form.validated['name'])) # return self.redirect(self.request.current_route_url()) - form.set_label('python_name', "Python Package Name") - form.set_label('has_db', "Has Rattail DB") - form.set_label('extends_db', "Extends Rattail DB Schema") - form.set_label('has_batch_schema', "Uses Rattail Batch Schema") - form.set_label('has_web', "Has Tailbone Web App") - form.set_label('has_web_api', "Has Tailbone Web API") - form.set_label('has_datasync', "Has DataSync Service") - # form.set_label('has_filemon', "Has FileMon Service") - # form.set_label('has_tempmon', "Has TempMon Service") - # form.set_label('has_bouncer', "Has Bouncer Service") - form.set_label('integrates_catapult', "Integrates w/ Catapult") - form.set_label('integrates_corepos', "Integrates w/ CORE-POS") - # form.set_label('integrates_instacart', "Integrates w/ Instacart") - form.set_label('integrates_locsms', "Integrates w/ LOC SMS") - # form.set_label('integrates_mailchimp', "Integrates w/ Mailchimp") - - # TODO! - form.set_default('name', 'Okay-Then') - form.set_default('slug', 'okay-then') - form.set_default('organization', 'Acme') - form.set_default('python_project_name', 'Acme-Okay-Then') - form.set_default('python_name', 'okay_then') - form.set_default('has_db', True) - form.set_default('has_web', True) - return { 'index_title': "Generate Project", 'handler': self.handler, # 'choices': choices, - 'form': form, 'use_buefy': use_buefy, }