Fix form configurazione

This commit is contained in:
pek5892 2024-05-23 17:03:30 +02:00
parent 8039010d89
commit 3037a19d5a
1 changed files with 23 additions and 29 deletions

View File

@ -147,18 +147,18 @@ if (!$has_user) {
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label for="admin_username">'.tr('Username').'</label> <label for="admin_username">'.tr('Username').'</label>
<input type="text" class="form-control" id="admin_username" name="admin_username" placeholder="'.tr("Imposta l'username dell'amministratore").'" required> <input type="text" class="form-control" id="admin_username" name="admin_username" placeholder="'.tr("Imposta l'username dell'amministratore").'" required>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-4">
{[ "type": "password", "label": "'.tr('Password').'", "id": "password", "name": "admin_password", "value": "", "placeholder": "'.tr("Imposta la password dell'amministratore").'", "required": 1, "strength": "#config" ]} {[ "type": "password", "label": "'.tr('Password').'", "id": "password", "name": "admin_password", "value": "", "placeholder": "'.tr("Imposta la password dell'amministratore").'", "required": 1, "strength": "#config" ]}
</div> </div>
<div class="col-md-6"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
<label for="admin_email">'.tr('Email').'</label> <label for="admin_email">'.tr('Email').'</label>
<input type="email" class="form-control" id="admin_email" name="admin_email" placeholder="'.tr("Imposta l'indirizzo email dell'amministratore").'" required> <input type="email" class="form-control" id="admin_email" name="admin_email" placeholder="'.tr("Imposta l'indirizzo email dell'amministratore").'" required>
@ -207,8 +207,8 @@ if (!$has_azienda) {
</div> </div>
<p>&nbsp;</p> <p>&nbsp;</p>
<div class="col-md-12 alert alert-info text-center">'.tr('Per impostare il logo delle stampe, caricare un file ".jpg". Risoluzione consigliata 302x111 pixel').'.</div> <div class="col-md-12 alert alert-info text-center">'.tr('Per impostare il logo delle stampe, caricare un file ".jpg". Risoluzione consigliata 302x111 pixel').'.
</div>
</div> </div>
</div>'; </div>';
@ -224,46 +224,40 @@ if (!$has_settings) {
<h3 class="card-title">'.tr('Impostazioni di base').'</h3> <h3 class="card-title">'.tr('Impostazioni di base').'</h3>
</div> </div>
<div class="card-body">'; <div class="card-body">
$i = 0; <div class="row">';
foreach ($settings as $setting => $required) { foreach ($settings as $setting => $required) {
if (empty(setting($setting))) { if (empty(setting($setting))) {
if ($i % 2 == 0 or $i == 0) {
echo ' <div class="row">';
}
echo ' echo '
<div class="col-md-6"> <div class="col-md-4">
'.Settings::input($setting, $required).' '.Settings::input($setting, $required).'
</div>'; </div>';
++$i;
if ($i % 2 == 0 or $i == sizeof($settings)) {
echo ' </div>';
}
} }
} }
echo ' </div> echo ' </div>
</div>
</div>'; </div>';
} }
echo ' echo '
<!-- PULSANTI --> <!-- PULSANTI -->
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<span>*<small><small>'.tr('Campi obbligatori').'</small></small></span> <span>*<small><small>'.tr('Campi obbligatori').'</small></small></span>
</div>
<div class="col-md-4 text-right">
<button type="submit" id="config" class="btn btn-success btn-block">
<i class="fa fa-cog"></i> '.tr('Configura').'
</button>
</div>
</div> </div>
<div class="col-md-4 text-right">
<button type="submit" id="config" class="btn btn-success btn-block">
<i class="fa fa-cog"></i> '.tr('Configura').'
</button>
</div>
</div>
</form> </form>
</div> </div>
</div>'; </div>
echo '
<script> <script>
$(document).ready(function(){ $(document).ready(function(){
$("button[type=submit]").not("#config").remove(); $("button[type=submit]").not("#config").remove();