stuff
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
<div class="record-status-bar">
|
||||
<div
|
||||
class="d-flex mt-3 mb-3 align-items-center justify-content-center"
|
||||
class="d-flex mt-3 mb-3 align-items-center justify-content-between"
|
||||
>
|
||||
|
||||
<StatusSelect bind:status={status}/>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script>
|
||||
import {getStatus, getStatusList} from "../StatusText.js";
|
||||
import SwitchButton from "../../common/SwitchButton.svelte";
|
||||
|
||||
export let status = "draft";
|
||||
let dropdown;
|
||||
@@ -11,37 +12,53 @@
|
||||
status = statusValue;
|
||||
dropdown.click();
|
||||
}
|
||||
|
||||
function switchStatus(e){
|
||||
console.log("Asf")
|
||||
if(currentStatus.value === "draft"){
|
||||
status = "published"
|
||||
}
|
||||
|
||||
if(currentStatus.value === "published"){
|
||||
status = "draft"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{#if status}
|
||||
<!-- Example split danger button -->
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="btn-group dropup">
|
||||
<button type="button" class="btn btn-{currentStatus.bg}"
|
||||
>{currentStatus.text}</button
|
||||
>
|
||||
<button
|
||||
bind:this={dropdown}
|
||||
type="button"
|
||||
class="btn btn-{currentStatus.bg} dropdown-toggle dropdown-toggle-split"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-expanded="false"
|
||||
>
|
||||
<span class="visually-hidden">Toggle Dropdown</span>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<div class="dropdown-header">Change status to</div>
|
||||
{#each statusList as astatus}
|
||||
{#if astatus.value !== status}
|
||||
<button
|
||||
type="button"
|
||||
class="dropdown-item my-2 rounded w-100 bg-{astatus.bg} text-{astatus.color}"
|
||||
on:click={(e) => updateStatus(e, astatus.value)}
|
||||
>
|
||||
{astatus.text}
|
||||
</button>
|
||||
{/if}
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-check form-switch" >
|
||||
<input on:click={switchStatus} class="form-check-input" type="checkbox" role="switch" id="record-status-switch" checked={status === "published"}>
|
||||
<label class="form-check-label" for=record-status-switch>{currentStatus.text}</label>
|
||||
</div>
|
||||
|
||||
<!-- <div class="d-flex justify-content-between">-->
|
||||
<!-- <div class="btn-group dropup">-->
|
||||
<!-- <button type="button" class="btn btn-{currentStatus.bg}"-->
|
||||
<!-- >{currentStatus.text}</button-->
|
||||
<!-- >-->
|
||||
<!-- <button-->
|
||||
<!-- bind:this={dropdown}-->
|
||||
<!-- type="button"-->
|
||||
<!-- class="btn btn-{currentStatus.bg} dropdown-toggle dropdown-toggle-split"-->
|
||||
<!-- data-bs-toggle="dropdown"-->
|
||||
<!-- aria-expanded="false"-->
|
||||
<!-- >-->
|
||||
<!-- <span class="visually-hidden">Toggle Dropdown</span>-->
|
||||
<!-- </button>-->
|
||||
<!-- <div class="dropdown-menu">-->
|
||||
<!-- <div class="dropdown-header">Change status to</div>-->
|
||||
<!-- {#each statusList as astatus}-->
|
||||
<!-- {#if astatus.value !== status}-->
|
||||
<!-- <button-->
|
||||
<!-- type="button"-->
|
||||
<!-- class="dropdown-item my-2 rounded w-100 bg-{astatus.bg} text-{astatus.color}"-->
|
||||
<!-- on:click={(e) => updateStatus(e, astatus.value)}-->
|
||||
<!-- >-->
|
||||
<!-- {astatus.text}-->
|
||||
<!-- </button>-->
|
||||
<!-- {/if}-->
|
||||
<!-- {/each}-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
{/if}
|
||||
Reference in New Issue
Block a user