Path: blob/1.0-develop/resources/views/admin/eggs/variables.blade.php
7460 views
@extends('layouts.admin')12@section('title')3Egg → {{ $egg->name }} → Variables4@endsection56@section('content-header')7<h1>{{ $egg->name }}<small>Managing variables for this Egg.</small></h1>8<ol class="breadcrumb">9<li><a href="{{ route('admin.index') }}">Admin</a></li>10<li><a href="{{ route('admin.nests') }}">Nests</a></li>11<li><a href="{{ route('admin.nests.view', $egg->nest->id) }}">{{ $egg->nest->name }}</a></li>12<li><a href="{{ route('admin.nests.egg.view', $egg->id) }}">{{ $egg->name }}</a></li>13<li class="active">Variables</li>14</ol>15@endsection1617@section('content')18<div class="row">19<div class="col-xs-12">20<div class="nav-tabs-custom nav-tabs-floating">21<ul class="nav nav-tabs">22<li><a href="{{ route('admin.nests.egg.view', $egg->id) }}">Configuration</a></li>23<li class="active"><a href="{{ route('admin.nests.egg.variables', $egg->id) }}">Variables</a></li>24<li><a href="{{ route('admin.nests.egg.scripts', $egg->id) }}">Install Script</a></li>25</ul>26</div>27</div>28</div>29<div class="row">30<div class="col-xs-12">31<div class="box no-border">32<div class="box-body">33<a href="#" class="btn btn-sm btn-success pull-right" data-toggle="modal" data-target="#newVariableModal">Create New Variable</a>34</div>35</div>36</div>37</div>38<div class="row">39@foreach($egg->variables as $variable)40<div class="col-sm-6">41<div class="box">42<div class="box-header with-border">43<h3 class="box-title">{{ $variable->name }}</h3>44</div>45<form action="{{ route('admin.nests.egg.variables.edit', ['egg' => $egg->id, 'variable' => $variable->id]) }}" method="POST">46<div class="box-body">47<div class="form-group">48<label class="form-label">Name</label>49<input type="text" name="name" value="{{ $variable->name }}" class="form-control" />50</div>51<div class="form-group">52<label class="form-label">Description</label>53<textarea name="description" class="form-control" rows="3">{{ $variable->description }}</textarea>54</div>55<div class="row">56<div class="form-group col-md-6">57<label class="form-label">Environment Variable</label>58<input type="text" name="env_variable" value="{{ $variable->env_variable }}" class="form-control" />59</div>60<div class="form-group col-md-6">61<label class="form-label">Default Value</label>62<input type="text" name="default_value" value="{{ $variable->default_value }}" class="form-control" />63</div>64<div class="col-xs-12">65<p class="text-muted small">This variable can be accessed in the startup command by using <code>{{ $variable->env_variable }}</code>.</p>66</div>67</div>68<div class="form-group">69<label class="form-label">Permissions</label>70<select name="options[]" class="pOptions form-control" multiple>71<option value="user_viewable" {{ (! $variable->user_viewable) ?: 'selected' }}>Users Can View</option>72<option value="user_editable" {{ (! $variable->user_editable) ?: 'selected' }}>Users Can Edit</option>73</select>74</div>75<div class="form-group">76<label class="form-label">Input Rules</label>77<input type="text" name="rules" class="form-control" value="{{ $variable->rules }}" />78<p class="text-muted small">These rules are defined using standard <a href="https://laravel.com/docs/5.7/validation#available-validation-rules" target="_blank">Laravel Framework validation rules</a>.</p>79</div>80</div>81<div class="box-footer">82{!! csrf_field() !!}83<button class="btn btn-sm btn-primary pull-right" name="_method" value="PATCH" type="submit">Save</button>84<button class="btn btn-sm btn-danger pull-left muted muted-hover" data-action="delete" name="_method" value="DELETE" type="submit"><i class="fa fa-trash-o"></i></button>85</div>86</form>87</div>88</div>89@endforeach90</div>91<div class="modal fade" id="newVariableModal" tabindex="-1" role="dialog">92<div class="modal-dialog" role="document">93<div class="modal-content">94<div class="modal-header">95<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>96<h4 class="modal-title">Create New Egg Variable</h4>97</div>98<form action="{{ route('admin.nests.egg.variables', $egg->id) }}" method="POST">99<div class="modal-body">100<div class="form-group">101<label class="control-label">Name <span class="field-required"></span></label>102<input type="text" name="name" class="form-control" value="{{ old('name') }}"/>103</div>104<div class="form-group">105<label class="control-label">Description</label>106<textarea name="description" class="form-control" rows="3">{{ old('description') }}</textarea>107</div>108<div class="row">109<div class="form-group col-md-6">110<label class="control-label">Environment Variable <span class="field-required"></span></label>111<input type="text" name="env_variable" class="form-control" value="{{ old('env_variable') }}" />112</div>113<div class="form-group col-md-6">114<label class="control-label">Default Value</label>115<input type="text" name="default_value" class="form-control" value="{{ old('default_value') }}" />116</div>117<div class="col-xs-12">118<p class="text-muted small">This variable can be accessed in the startup command by entering <code>@{{environment variable value}}</code>.</p>119</div>120</div>121<div class="form-group">122<label class="control-label">Permissions</label>123<select name="options[]" class="pOptions form-control" multiple>124<option value="user_viewable">Users Can View</option>125<option value="user_editable">Users Can Edit</option>126</select>127</div>128<div class="form-group">129<label class="control-label">Input Rules <span class="field-required"></span></label>130<input type="text" name="rules" class="form-control" value="{{ old('rules', 'required|string|max:20') }}" placeholder="required|string|max:20" />131<p class="text-muted small">These rules are defined using standard <a href="https://laravel.com/docs/5.7/validation#available-validation-rules" target="_blank">Laravel Framework validation rules</a>.</p>132</div>133</div>134<div class="modal-footer">135{!! csrf_field() !!}136<button type="button" class="btn btn-default pull-left" data-dismiss="modal">Close</button>137<button type="submit" class="btn btn-primary">Create Variable</button>138</div>139</form>140</div>141</div>142</div>143@endsection144145@section('footer-scripts')146@parent147<script>148$('.pOptions').select2();149$('[data-action="delete"]').on('mouseenter', function (event) {150$(this).find('i').html(' Delete Variable');151}).on('mouseleave', function (event) {152$(this).find('i').html('');153});154</script>155@endsection156157158