You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

92 lines
3.1 KiB

<?xml version="1.0" encoding="UTF-8" ?>
<template xml:space="preserve">
<!-- Template of timesheet add view template from systray -->
<t t-name="TimesheetSystray" owl="1">
<Dropdown menuClass="`p-3 b-3`" t-if="this.state.Access">
<button class="btn btn-secondary">
<img src="./easy_timesheet_add/static/src/img/stopwatch.svg"
width="30px" height="18px"/>
</button>
<t t-set-slot="content">
<div t-ref="Timesheet"
style="width: 300px;min-height: 50px;max-height: 630px">
<div t-esc="state.time" class="time"/>
<t t-if="!this.state.WorkTime">
<div class="row">
<div class="col-3">Project</div>
<div class="col-8">
<select class="form-select Project"
t-on-change="(ev) => this.ChangeProject(ev.target.value)">
<option class="bg-secondary" value="">Select a
Project</option>
<t t-if="this.state.project">
<t t-foreach="this.state.project"
t-as="project"
t-key="project_index">
<option t-att-value="project.id"
t-att-data="project.name"
t-esc="project.name"/>
</t>
</t>
</select>
</div>
</div>
<div class="row mt-2">
<div class="col-3">Task</div>
<div class="col-8">
<select class="form-select Task"
t-on-change="(ev) => this.ChangeTask(ev.target.value)">
<option class="bg-secondary" value="">Select a
Task</option>
<t t-if="this.state.Task">
<t t-foreach="this.state.Task"
t-as="task" t-key="task_index">
<option t-att-value="task.id"
t-att-data="task.name"
t-esc="task.name"/>
</t>
</t>
</select>
</div>
</div>
</t>
<t t-if="this.state.WorkTime">
<div class="row d-flex">
<div>
<small class="">Description</small>
</div>
<div class="fs-3 text-info text-end">
<textarea class="form-control Description"
rows="3"/>
</div>
</div>
</t>
</div>
<div class="mt-2">
<button t-if="!this.state.WorkTime"
class="btn btn-success start"
t-on-click="StartTime">
<span>Start</span>
</button>
<button t-if="this.state.WorkTime"
class="btn btn-danger stop"
t-on-click="AddTimesheet">
<span>Stop</span>
</button>
<button t-if="this.state.WorkTime and !this.state.paused"
class="btn btn-primary pause"
style="margin-left: 6px"
t-on-click="PauseTime">
<span>Pause</span>
</button>
<button t-if="this.state.WorkTime and this.state.paused"
class="btn btn-primary pause"
style="margin-left: 6px"
t-on-click="PlayTime">
<span>Restart</span>
</button>
</div>
</t>
</Dropdown>
</t>
</template>