From df9f245c57f4d03c7bcb8fd02caa1a36c0cc3058 Mon Sep 17 00:00:00 2001 From: Nguyen HP Laptop Date: Sat, 25 Apr 2026 11:21:27 -0400 Subject: [PATCH] 04/25 modified the UI, projects -> contracts, button names --- app/routes/customers.py | 8 ++++---- app/routes/projects.py | 14 +++++++------- app/templates/auth/notification_matrix.html | 2 +- app/templates/base.html | 2 +- app/templates/customers/import.html | 10 +++++----- app/templates/customers/index.html | 2 +- app/templates/customers/manage.html | 14 +++++++------- app/templates/dashboard.html | 2 +- app/templates/facilities/form.html | 2 +- app/templates/inspections/list.html | 4 ++-- app/templates/projects/assignment_form.html | 6 +++--- app/templates/projects/form.html | 2 +- app/templates/projects/list.html | 10 +++++----- app/templates/projects/view.html | 10 +++++----- app/utils/forms.py | 4 ++-- 15 files changed, 46 insertions(+), 46 deletions(-) diff --git a/app/routes/customers.py b/app/routes/customers.py index 291fe7c..7081079 100644 --- a/app/routes/customers.py +++ b/app/routes/customers.py @@ -347,7 +347,7 @@ def manage(customer_id): aform = CustomerAssignmentForm() projects = Project.query.filter_by(active=True).order_by(Project.name).all() aform.user_id.choices = [(customer.id, customer.username)] - aform.facility_id.choices = [(0, '— All facilities in project —')] + aform.facility_id.choices = [(0, '— All facilities in contract —')] return render_template( 'customers/manage.html', @@ -374,7 +374,7 @@ def add_assignment(customer_id): facility_id = request.form.get('facility_id', type=int) or None if not project_id: - flash('Please select a project.', 'warning') + flash('Please select a contract.', 'warning') return redirect(url_for('customers.manage', customer_id=customer_id)) project = Project.query.get_or_404(project_id) @@ -691,7 +691,7 @@ def bulk_import(): if pname: project = proj_by_name.get(pname.lower()) if project is None: - row_errors.append(f'project "{pname}" not found or inactive') + row_errors.append(f'contract "{pname}" not found or inactive') else: proj_id = project.id if fname: @@ -703,7 +703,7 @@ def bulk_import(): ).first() if facility is None: row_errors.append( - f'facility "{fname}" not found in project "{pname}"' + f'facility "{fname}" not found in contract "{pname}"' ) else: fac_id = facility.id diff --git a/app/routes/projects.py b/app/routes/projects.py index f66ec61..2255a30 100644 --- a/app/routes/projects.py +++ b/app/routes/projects.py @@ -60,10 +60,10 @@ def create(): current_user.username, project.id, project.name) log_action(ACTION_CREATE, 'Project', project.id, project.name, f'pm_id={pm_id}; active={project.active}') - flash(f'Project "{project.name}" created successfully.', 'success') + flash(f'Contract "{project.name}" created successfully.', 'success') return redirect(url_for('projects.view', project_id=project.id)) - return render_template('projects/form.html', form=form, title='Create Project') + return render_template('projects/form.html', form=form, title='Create Contract') # ── View ────────────────────────────────────────────────────────────────────── @@ -111,10 +111,10 @@ def edit(project_id): current_user.username, project.id, project.name) log_action(ACTION_UPDATE, 'Project', project.id, project.name, f'pm_id={project.project_manager_id}; active={project.active}') - flash(f'Project "{project.name}" updated successfully.', 'success') + flash(f'Contract "{project.name}" updated successfully.', 'success') return redirect(url_for('projects.view', project_id=project.id)) - return render_template('projects/form.html', form=form, project=project, title='Edit Project') + return render_template('projects/form.html', form=form, project=project, title='Edit Contract') # ── Delete ──────────────────────────────────────────────────────────────────── @@ -137,7 +137,7 @@ def delete(project_id): logger.info('PROJECTS | delete | user=%s project_id=%s name=%s', current_user.username, project_id_snap, project_name) log_action(ACTION_DELETE, 'Project', project_id_snap, project_name) - flash(f'Project "{project_name}" deleted successfully.', 'success') + flash(f'Contract "{project_name}" deleted successfully.', 'success') return redirect(url_for('projects.index')) @@ -156,7 +156,7 @@ def add_assignment(project_id): # Facilities belonging to this project project_facilities = project.facilities.order_by(Facility.name).all() - form.facility_id.choices = [(0, '— All facilities in project —')] + \ + form.facility_id.choices = [(0, '— All facilities in contract —')] + \ [(f.id, f.name) for f in project_facilities] if form.validate_on_submit(): @@ -188,7 +188,7 @@ def add_assignment(project_id): log_action(ACTION_CREATE, 'CustomerAssignment', assignment.id, f'{user.username} → {project.name}', f'scope={scope_label}') - flash(f'Customer "{user.username}" assigned to project "{project.name}".', 'success') + flash(f'Customer "{user.username}" assigned to contract "{project.name}".', 'success') return redirect(url_for('projects.view', project_id=project_id)) return render_template( diff --git a/app/templates/auth/notification_matrix.html b/app/templates/auth/notification_matrix.html index d78d2ec..3c59725 100644 --- a/app/templates/auth/notification_matrix.html +++ b/app/templates/auth/notification_matrix.html @@ -204,7 +204,7 @@

Customer: Customer-portal users are notified only for facilities - they are assigned to via their project/facility assignments. + they are assigned to via their contract/facility assignments.

Custom Recipients: Additional email addresses (e.g. external managers) diff --git a/app/templates/base.html b/app/templates/base.html index c5d6886..916dc52 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -103,7 +103,7 @@ {% if current_user.role in ['admin', 'director', 'project_manager'] %}

{% endif %}