edit.blade.php 3.46 KB
Newer Older
Maik Messerschmidt's avatar
Maik Messerschmidt committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
@extends('layouts.app')
@section('content')

<h1>Upload new experiment input</h1>

{{ Form::model($input, [
    'route' => ['inputs.update', $input],
    'method' => 'patch'
]) }}

<div class="form-group">
    {{ Form::label('id', 'Unique id', ['class' => 'control-label' ]) }}
    {{ Form::text('id', old('id'), ['class' => 'form-control']) }}
    <small id="id-help" class="form-text text-muted">
        Unique id for this input data.
    </small>
    @error('id')
        <div class="text-danger">{{ $message }}</div>
    @enderror
</div>

<div class="form-group">
    {{ Form::label('max_uses', 'Maximum use count', ['class' => 'control-label' ]) }}
    {{ Form::number('max_uses', old('max_uses', 1), ['min' => 0, 'class' => 'form-control']) }}
    <small id="max_uses-help" class="form-text text-muted">
        How often this input data can be used in total.
        (Leave empty, for inifinite uses.)
    </small>
    @error('max_uses')
        <div class="text-danger">{{ $message }}</div>
    @enderror
</div>

<div class="form-group">
    {{ Form::label('group', 'Optional group name', ['class' => 'control-label' ]) }}
    {{ Form::text('group', old('group'), ['class' => 'form-control']) }}
    <small id="group-help" class="form-text text-muted">
        This makes this input available by the given group name.
        Useful, if you want to make multiple different inputs available via
        the same URL.
    </small>
    @error('group')
        <div class="text-danger">{{ $message }}</div>
    @enderror
</div>

<div class="form-group">
    {{ Form::label('increments', 'Increment mode for the use count.', ['class' => 'control-label' ]) }}
    {{ Form::select('increments', ['auto' => 'auto', 'manual' => 'manual', 'never' => 'never'], old('increments', 'auto'), ['class' => 'form-control']) }}
    <small id="increments-help" class="form-text text-muted">
        When to increment the use count:
        <ul>
          <li>auto - whenever the input data is requested</li>
          <li>manual - when the experiment client requests the increment</li>
          <li>never - never increment the use count</li>
        </ul>
        If you're unsure about this, you'll likely want 'auto'.
    </small>
    @error('increments')
        <div class="text-danger">{{ $message }}</div>
    @enderror
</div>

<div class="form-group">
    {{ Form::label('data', 'Input data payload', ['class' => 'control-label' ]) }}
    {{ Form::textarea('data', old('data'), [
        'placeholder' => 'Enter your data here',
        'class' => 'form-control' ,
        'cols' => 20,
        'rows' =>10,
        'required'
    ]) }}
    @error('data')
        <div class="text-danger">{{ $message }}</div>
    @enderror
</div>

<div class="form-group">
    {{ Form::label('format', 'Input data format', ['class' => 'control-label' ]) }}
    {{ Form::select('format', ['json' => 'json', 'text' => 'text'], old('format'), ['class' => 'form-control']) }}
    <small id="format-help" class="form-text text-muted">
        This will run a quick check, whether the provided data is valid,
        but otherwise have no effect on the saved input data.
    </small>
    @error('format')
        <div class="text-danger">{{ $message }}</div>
    @enderror
</div>

<div class="row">
    <div class="m-1">
        {{ Form::submit('Update', ['class' => 'btn btn-primary']) }}
        {{ Form::close() }}
    </div>
    <div class="m-1">
        <a href="{{ route('inputs.index') }}" class="btn btn-secondary">Cancel</a>
    </div>
</div>
@endsection