From 18de74e45b1e10a14104c17a95b4becb870ae6ca Mon Sep 17 00:00:00 2001 From: Sandra Kuipers Date: Sun, 3 Nov 2024 13:13:00 +0800 Subject: [PATCH] System: remove the unsaved changes indicator from the installer --- index_tt_ajax.php | 2 +- resources/templates/components/form.twig.html | 7 +++++-- resources/templates/installer/install.twig.html | 6 ++++-- src/Install/Http/InstallController.php | 10 +++++----- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/index_tt_ajax.php b/index_tt_ajax.php index 0d846b60e0..62c869012e 100644 --- a/index_tt_ajax.php +++ b/index_tt_ajax.php @@ -62,7 +62,7 @@ if ($tt != false) { $output .= $tt; } else { - echo Format::alert(__('There is no information for the date specified.'), 'error'); + echo Format::alert(__('There is no information for the date specified.'), 'empty'); } } diff --git a/resources/templates/components/form.twig.html b/resources/templates/components/form.twig.html index 6fe1fe2cc4..951206e144 100644 --- a/resources/templates/components/form.twig.html +++ b/resources/templates/components/form.twig.html @@ -11,6 +11,7 @@ {% set standardLayout = "noIntBorder" not in form.getClass and "form-small" not in form.getClass and "blank" not in form.getClass %} {% set smallLayout = "form-small" in form.getClass %} {% set useSections = "noIntBorder" not in form.getClass and "blank" not in form.getClass %} +{% set useSaveWarning = "noIntBorder" not in form.getClass and "disable-warnings" not in form.getClass %} {% if quickSave and form.getAction %}
@@ -70,7 +71,7 @@

{{ form.getTitle }}

{% if form.getRows|length > 0 %}
- {% if standardLayout and element.getAttribute('id') == 'Submit' %} + {% if useSaveWarning and element.getAttribute('id') == 'Submit' %} {{ __('Unsaved Changes') }} + {% endif %} + {% if standardLayout and element.getAttribute('id') == 'Submit' %} {{ __('Please Check Form') }} {% endif %} diff --git a/resources/templates/installer/install.twig.html b/resources/templates/installer/install.twig.html index ac451d198d..8817ff2323 100644 --- a/resources/templates/installer/install.twig.html +++ b/resources/templates/installer/install.twig.html @@ -19,10 +19,12 @@ - - + + + + {% endblock head %} {% block beforePage %} diff --git a/src/Install/Http/InstallController.php b/src/Install/Http/InstallController.php index 2ee545e9ed..8e6ccac826 100644 --- a/src/Install/Http/InstallController.php +++ b/src/Install/Http/InstallController.php @@ -232,7 +232,7 @@ public function viewStepOne( $form = MultiPartForm::create('installer', $submitUrl); $form->setTitle(__('Installation - Step {count}', ['count' => 1])); - $form->setClass('smallIntBorder w-full'); + $form->setClass('smallIntBorder w-full disable-warnings'); if (!empty($directoryError)) { $form->setDescription(Format::alert($directoryError, 'error')); @@ -363,7 +363,7 @@ public function viewStepTwo( $form = MultiPartForm::create('installer', $submitUrl); $form->setTitle(__('Installation - Step {count}', ['count' => 2])); - $form->setClass('smallIntBorder w-full'); + $form->setClass('smallIntBorder w-full disable-warnings'); $form->addPages(static::getSteps()); $form->setCurrentPage(2); @@ -489,7 +489,7 @@ public function viewStepThree( $form = MultiPartForm::create('installer', $submitUrl); $form->setTitle(__('Installation - Step {count}', ['count' => 3])); $form->setFactory(DatabaseFormFactory::create($installer->getConnection())); - $form->setClass('smallIntBorder w-full'); + $form->setClass('smallIntBorder w-full disable-warnings'); $form->addPages(static::getSteps()); $form->setCurrentPage(3); @@ -544,7 +544,7 @@ public function viewStepThree( $setting = $installer->getSetting('absoluteURL', 'System', true); $row = $form->addRow(); $row->addLabel($setting['name'], __($setting['nameDisplay']))->description(__($setting['description'])); - $row->addURL($setting['name'])->setValue($absoluteURL)->maxLength(100)->required(); + $row->addTextField($setting['name'])->setValue($absoluteURL)->maxLength(100)->required(); $setting = $installer->getSetting('absolutePath', 'System', true); $row = $form->addRow(); @@ -832,7 +832,7 @@ public function viewStepFour( $form = MultiPartForm::create('installer', "./install.php?step=4"); $form->setTitle(__('Installation - Step {count}', ['count' => $step + 1])); - $form->setClass('smallIntBorder w-full'); + $form->setClass('smallIntBorder w-full disable-warnings'); $form->addPages(static::getSteps()); $form->setCurrentPage(4);