Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

Commit

Permalink
Fix rendering tabella alerts e form per alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxelweb committed May 10, 2020
1 parent dd6a71e commit 7de3fe2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions resources/views/alerts/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
<label for="inputSensore" class="col-sm-3 col-form-label"><span class="fas fa-temperature-high"></span> Sensore</label>
<div class="col-sm-9">
<div class="input-group mb-3">
<select class="form-control @error('sensor') is-invalid @enderror" name="sensor" id="inputSensor">
<select required class="form-control @error('sensor') is-invalid @enderror" name="sensor" id="inputSensor">
@foreach($devices as $d)
@foreach($sensors[$d->deviceId] as $s)
<option value="{{$s->sensorId}}">{{$d->name . ' - @' . $s->realSensorId}}</option>
<option value="{{$s->sensorId}}">{{$s->type.' S@' . $s->realSensorId.' // '.$d->name . ' D#'.$s->device }}</option>
@endforeach
@endforeach
</select>
Expand All @@ -53,7 +53,7 @@
<label for="inputSoglia" class="col-sm-3 col-form-label"><span class="fas fa-radiation"></span> Soglia</label>
<div class="col-sm-9">
<div class="input-group mb-3">
<select class="form-control @error('type') is-invalid @enderror" name="type" id="inputSoglia">
<select required class="form-control @error('type') is-invalid @enderror" name="type" id="inputSoglia">
<option value="0" selected>maggiore di</option>
<option value="1">minore di</option>
<option value="2">uguale a</option>
Expand All @@ -71,7 +71,7 @@
<label for="inputValue" class="col-sm-3 col-form-label"><span class="fas fa-radiation-alt"></span> Valore di soglia</label>
<div class="col-sm-9">
<div class="input-group mb-3">
<input type="number" step="0.1" class="form-control @error('threshold') is-invalid @enderror" name="threshold" id="inputValue"
<input type="number" step="0.1" required class="form-control @error('threshold') is-invalid @enderror" name="threshold" id="inputValue"
placeholder="Inserisci un valore di soglia" value="valorenumerico">
@error('threshold')
<span class="invalid-feedback" role="alert">
Expand All @@ -81,7 +81,7 @@
</div>
</div>
</div>
<button type="submit" class="btn btn-primary btn-icon-split">
<button type="submit" class="btn btn-success btn-icon-split">
<span class="icon text-white-50">
<span class="fas fa-plus-circle"></span>
</span>
Expand Down
14 changes: 7 additions & 7 deletions resources/views/alerts/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
<label for="inputSensore" class="col-sm-3 col-form-label"><span class="fas fa-temperature-high"></span> Sensore</label>
<div class="col-sm-9">
<div class="input-group mb-3">
<select class="form-control @error('sensor') is-invalid @enderror" name="sensor" id="inputSensor">
<select required class="form-control @error('sensor') is-invalid @enderror" name="sensor" id="inputSensor">
@foreach($devices as $d)
@foreach($sensors[$d->deviceId] as $s)
<option value="{{$s->sensorId}}">{{$d->name . ' - @' . $s->realSensorId}}</option>
<option value="{{$s->sensorId}}">{{$s->type.' S@' . $s->realSensorId.' // '.$d->name . ' D#'.$s->device }}</option>
@endforeach
@endforeach
</select>
Expand All @@ -62,7 +62,7 @@
<label for="inputSoglia" class="col-sm-3 col-form-label"><span class="fas fa-radiation"></span> Soglia</label>
<div class="col-sm-9">
<div class="input-group mb-3">
<select class="form-control @error('type') is-invalid @enderror" name="type" id="inputSoglia">
<select required class="form-control @error('type') is-invalid @enderror" name="type" id="inputSoglia">
<option value="0" @if($alert->type == 0) selected @endif>maggiore di</option>
<option value="1" @if($alert->type == 1) selected @endif>minore di</option>
<option value="2" @if($alert->type == 2) selected @endif>uguale a</option>
Expand All @@ -80,7 +80,7 @@
<label for="inputValue" class="col-sm-3 col-form-label"><span class="fas fa-radiation-alt"></span> Valore di soglia</label>
<div class="col-sm-9">
<div class="input-group mb-3">
<input type="number" step="0.1" class="form-control @error('threshold') is-invalid @enderror" name="threshold" id="inputValue"
<input required type="number" step="0.1" class="form-control @error('threshold') is-invalid @enderror" name="threshold" id="inputValue"
placeholder="Inserisci un valore di soglia" value="{{$alert->threshold}}">
@error('threshold')
<span class="invalid-feedback" role="alert">
Expand All @@ -90,11 +90,11 @@
</div>
</div>
</div>
<button type="submit" class="btn btn-primary btn-icon-split">
<button type="submit" class="btn btn-success btn-icon-split">
<span class="icon text-white-50">
<span class="fas fa-check-circle"></span>
<span class="fas fa-save"></span>
</span>
<span class="text">Modifica</span>
<span class="text">Salva modifiche</span>
</button>
</form>
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/alerts/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
@endcan
@can(['isAdmin'])
<td>
<a class="btn btn-sm btn-danger btn-icon-split mb-3" href="{{ route('alerts.destroy', ['alertId'=>$list['alert']->alertId]) }}"
<a class="btn btn-sm btn-danger btn-icon-split" href="{{ route('alerts.destroy', ['alertId'=>$list['alert']->alertId]) }}"
onclick="event.preventDefault(); return confirm('Sei sicuro di voler rimuovere alert #{{ $list['alert']->alertId }}?') ?
document.getElementById('destroy-alert-{{ $list['alert']->alertId }}').submit() : false;">
<span class="icon text-white-50">
Expand Down

0 comments on commit 7de3fe2

Please sign in to comment.