Merge pull request #1019 from mrbase/form-and-js-fix

Fix problems with the incident add/edit form
This commit is contained in:
Graham Campbell 2015-10-07 22:52:58 +01:00
commit 22204811c2
5 changed files with 16 additions and 35 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"dist/css/all.css": "dist/css/all-72c862531a.css",
"dist/js/all.js": "dist/js/all-1c16482be2.js"
}
"dist/css/all.css": "dist/css/all-1fd79ec356.css",
"dist/js/all.js": "dist/js/all-234abbfa32.js"
}

View File

@ -115,7 +115,7 @@ $(function() {
$(this).parents('div.alert').addClass('hide');
});
$('form[name=IncidentForm] select[name=incident\\[component_id\\]]').on('change', function() {
$('form[name=IncidentForm] select[name=component_id]').on('change', function() {
var $option = $(this).find('option:selected');
var $componentStatus = $('#component-status');

View File

@ -19,34 +19,34 @@
<fieldset>
<div class="form-group">
<label for="incident-name">{{ trans('forms.incidents.name') }}</label>
<input type="text" class="form-control" name="incident[name]" id="incident-name" required value="{{$incident->name}}">
<input type="text" class="form-control" name="name" id="incident-name" required value="{{$incident->name}}">
</div>
<div class="form-group">
<label for="incident-name">{{ trans('forms.incidents.status') }}</label><br>
<label class="radio-inline">
<input type="radio" name="incident[status]" value="1" {{ ($incident->status == 1) ? "checked=checked" : "" }}>
<input type="radio" name="status" value="1" {{ ($incident->status == 1) ? "checked=checked" : "" }}>
<i class="icon ion-flag"></i>
{{ trans('cachet.incidents.status')[1] }}
</label>
<label class="radio-inline">
<input type="radio" name="incident[status]" value="2" {{ ($incident->status == 2) ? "checked=checked" : "" }}>
<input type="radio" name="status" value="2" {{ ($incident->status == 2) ? "checked=checked" : "" }}>
<i class="icon ion-alert-circled"></i>
{{ trans('cachet.incidents.status')[2] }}
</label>
<label class="radio-inline">
<input type="radio" name="incident[status]" value="3" {{ ($incident->status == 3) ? "checked=checked" : "" }}>
<input type="radio" name="status" value="3" {{ ($incident->status == 3) ? "checked=checked" : "" }}>
<i class="icon ion-eye"></i>
{{ trans('cachet.incidents.status')[3] }}
</label>
<label class="radio-inline">
<input type="radio" name="incident[status]" value="4" {{ ($incident->status == 4) ? "checked=checked" : "" }}>
<input type="radio" name="status" value="4" {{ ($incident->status == 4) ? "checked=checked" : "" }}>
<i class="icon ion-checkmark"></i>
{{ trans('cachet.incidents.status')[4] }}
</label>
</div>
<div class="form-group">
<label for="incident-visibility">{{ trans('forms.incidents.visibility') }}</label>
<select name='incident[visible]' id="incident-visibility" class="form-control">
<select name="visible" id="incident-visibility" class="form-control">
<option value='1' {{ $incident->visible === 1 ? 'selected' : null }}>{{ trans('forms.incidents.public') }}</option>
<option value='0' {{ $incident->visible === 0 ? 'selected' : null }}>{{ trans('forms.incidents.logged_in_only') }}</option>
</select>
@ -60,7 +60,7 @@
@foreach(trans('cachet.components.status') as $statusID => $status)
<div class="radio-inline">
<label>
<input type="radio" name="incident[component_status]" value="{{ $statusID }}" {{ $incident->component->status == $statusID ? "checked='checked'" : "" }}>
<input type="radio" name="component_status" value="{{ $statusID }}" {{ $incident->component->status == $statusID ? "checked='checked'" : "" }}>
{{ $status }}
</label>
</div>
@ -72,18 +72,18 @@
@endif
<div class="form-group">
<label>{{ trans('forms.incidents.message') }}</label>
<div class='markdown-control'>
<textarea name="incident[message]" class="form-control autosize" rows="5" required>{{ $incident->message }}</textarea>
<div class="markdown-control">
<textarea name="message" class="form-control autosize" rows="5" required>{{ $incident->message }}</textarea>
</div>
</div>
<div class="form-group">
<label>{{ trans('forms.incidents.incident_time') }}</label>
<input type="text" name="incident[created_at]" class="form-control" rel="datepicker-any" value="{{ $incident->created_at_datetimepicker }}">
<input type="text" name="created_at" class="form-control" rel="datepicker-any" value="{{ $incident->created_at_datetimepicker }}">
<span class="help-block">{{ trans('forms.optional') }}</span>
</div>
</fieldset>
<input type="hidden" name="incident[id]" value={{$incident->id}}>
<input type="hidden" name="id" value={{$incident->id}}>
<div class="form-group">
<div class="btn-group">