Added assignment history and unassignment feature (not yet tested).
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
import {Assets} from "/imports/api/assets";
|
||||
import {Students} from "/imports/api/students";
|
||||
import {AssetTypes} from "/imports/api/asset-types";
|
||||
import Button, { Label } from '@smui/button';
|
||||
import Dialog, { Title, Content, Actions } from '@smui/dialog';
|
||||
|
||||
onMount(async () => {
|
||||
Meteor.subscribe('assets');
|
||||
@@ -53,6 +55,11 @@
|
||||
const formatDate = (date) => {
|
||||
return date.toLocaleDateString('en-us', {weekday: 'long', year: 'numeric', month: 'short', day: 'numeric'});
|
||||
}
|
||||
const unassign = () => {
|
||||
if(confirm("Unassign Asset?")) {
|
||||
Meteor.call("assets.unassign", foundAsset.assetId);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="container">
|
||||
@@ -75,8 +82,26 @@
|
||||
<div>Assigned on: {formatDate(foundAsset.assignmentDate)}</div>
|
||||
<div>Assigned to: {foundAssignee.firstName} {foundAssignee.lastName}
|
||||
{#if foundAssignee.grade} ~ {foundAssignee.grade} {/if}({foundAssignee.email})</div>
|
||||
|
||||
<Button variant="raised" touch on:click={unassign}>
|
||||
<Label style="color: white">Unassign</Label>
|
||||
</Button>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
<!-- <Dialog bind:open={showDialog} aria-labelledby="Confirm" aria-describedby="Unassign Confirmation">-->
|
||||
<!-- <!– Title cannot contain leading whitespace due to mdc-typography-baseline-top() –>-->
|
||||
<!-- <Title id="simple-title">Unassign Asset?</Title>-->
|
||||
<!-- <Content id="simple-content"></Content>-->
|
||||
<!-- <Actions>-->
|
||||
<!-- <Button on:click={() => (clicked = 'No')}>-->
|
||||
<!-- <Label>No</Label>-->
|
||||
<!-- </Button>-->
|
||||
<!-- <Button on:click={() => (clicked = 'Yes')}>-->
|
||||
<!-- <Label>Yes</Label>-->
|
||||
<!-- </Button>-->
|
||||
<!-- </Actions>-->
|
||||
<!-- </Dialog>-->
|
||||
</div>
|
||||
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user