edit.edge

76 lines | 2.452 kB Blame History Raw Download
@layout('layouts.main')

@section('content')

<form method="POST" action="{{ APP_URL() + route('/stewards.update', {id: steward.id}) + '?_method=PUT' }}">
  {{ csrfField() }}
  <div class="field">
    <label class="label">Contact</label>
    <div class="select">
      <select name="contact_id">
        <option>Select dropdown</option>
        @each(contact in contacts)
        <option value="{{contact.id}}" {{contact.id == steward.contact_id ? 'selected' : ''}}>{{contact.first_name}} {{contact.last_name}}</option>
        @endeach
      </select>
    </div>
  </div>

  <div class="field">
    <label class="label">Element</label>
    <div class="select">
      <select name="element_id">
        <option>Select dropdown</option>
        @each(element in elements)
        <option value="{{element.id}}" {{element.id == steward.elements[0].id ? 'selected' : ''}}>{{element.name}}</option>
        @endeach
      </select>
    </div>
  </div>

  <div class="field">
    <label class="label">Start Date</label>
    <input class="input start-datepicker" type="text" name="start_date" value="{{ TO_LOCALE(steward.start_date) }}" />
    {{ elIf('<span class="has-text-danger">$self</span>', getErrorFor('start_date'), hasErrorFor('start_date')) }}
  </div>

  <div class="field">
    <label class="label">End Date</label>
    <input class="input end-datepicker" type="text" name="end_date" value="{{ TO_LOCALE(steward.end_date) }}" />
    {{ elIf('<span class="has-text-danger">$self</span>', getErrorFor('end_date'), hasErrorFor('end_date')) }}
  </div>

  <div class="field is-grouped">
    <div class="control">
      <button class="button is-link ss-submit" type="submit">Modify</button>
    </div>
    <div class="control">
    <button class="button is-text"><a href="{{ APP_URL() + route('/stewards.index') }}">Cancel</a></button>
    </div>
  </div>
    <!--
    <div class="notification is-warning">
      <button class="delete"></button>
      Building Snapshots for some items may take a couple minutes.  Please be patient!
    </div>
    -->
</form>

@section('scripts')
<script>
  const start = datepicker('.start-datepicker', {
    formatter: (input, date, instance) => {
      const value = date.toLocaleDateString()
      input.value = value // => '1/1/2099'
    }
  })
  const end = datepicker('.end-datepicker', {
    formatter: (input, date, instance) => {
      const value = date.toLocaleDateString()
      input.value = value // => '1/1/2099'
    }
  })
</script>
@endsection

@endsection