1
0
mirror of https://koodu.h-i.works/projects/thebadspace synced 2025-05-06 14:41:02 -05:00
thebadspace/resources/views/forms/source-edit.blade.php
ro 3e937c5083 Source creation and editing
A UI has been added for entering new sources and editing pre-existing
ones. No more having to edit the DB directly when wanting to add or
remove a source.
2025-04-18 15:16:32 -06:00

66 lines
2.3 KiB
PHP

<form action="{{$action_url}}" method="post" enctype="multipart/form-data">
<div>
@php
isset($source->url) ? $url = $source->url : $url = '';
@endphp
<label>URL</label><br />
<input type="text" name="url" value="{{$url}}" />
<br />
@php
isset($source->type) ? $type = $source->type : $type = '';
@endphp
<label>Type</label><br />
<select name="type">
@if($type == 'mastodon')
<option value="mastodon" selected>Mastodon</option>
<option value="gotosocial">GoToSocial</option>
@else
<option value="mastodon">Mastodon</option>
<option value="gotosocial" selected>GoToSocial</option>
@endif
</select>
<br />
@php
isset($source->format) ? $format = $source->format : $format = '';
@endphp
<label>Format</label><br />
<select name="format">
@if($format == 'json')
<option value="json" selected>JSON</option>
<option value="csv">CSV</option>
@else
<option value="json">JSON</option>
<option value="csv" selected>CSV</option>
@endif
</select>
<br />
@php
isset($source->active) ? $status = $source->active : $status = false;
@endphp
<label>Active?</label><br />
<select name="status">
@if($status)
<option value="true" selected>Active</option>
<option value="false">Not Active</option>
@else
<option value="true">Active</option>
<option value="false" selected>Not Active</option>
@endif
</select>
<br />
@php
isset($source->token) ? $token = $source->token : $token = '';
@endphp
<label>Access Token (enter 'none' to clear)</label><br />
<input type="text" name="token" value="{{$token}}" />
<br />
</div>
@csrf
@php
isset($source->id) ? $id = $source->id : $id = 0;
@endphp
<input type="hidden" name="id" value="{{$id}}" />
<input type="submit" value="Edit Source" name="submit_button">
</form>