111 lines
5.6 KiB
XML
111 lines
5.6 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
||
<templates xml:space="preserve">
|
||
|
||
<t t-name="fusion_helpdesk.Dialog">
|
||
<Dialog title="dialogTitle" size="'lg'">
|
||
<div class="o_fhd_dialog">
|
||
<!-- Kind selector -->
|
||
<div class="o_fhd_kind_row">
|
||
<button type="button"
|
||
class="o_fhd_kind_chip"
|
||
t-att-class="{ 'o_fhd_kind_active': state.kind === 'bug' }"
|
||
t-on-click="() => this.setKind('bug')">
|
||
<i class="fa fa-bug me-1"/> Report a Bug
|
||
</button>
|
||
<button type="button"
|
||
class="o_fhd_kind_chip"
|
||
t-att-class="{ 'o_fhd_kind_active': state.kind === 'feature' }"
|
||
t-on-click="() => this.setKind('feature')">
|
||
<i class="fa fa-lightbulb-o me-1"/> Request a Feature
|
||
</button>
|
||
</div>
|
||
|
||
<!-- Subject -->
|
||
<div class="o_fhd_field">
|
||
<label>Subject *</label>
|
||
<input type="text" class="form-control"
|
||
t-att-value="state.subject"
|
||
t-on-input="(ev) => state.subject = ev.target.value"
|
||
t-att-placeholder="state.kind === 'bug' ? 'Short summary of what went wrong' : 'Short summary of the feature you want'"/>
|
||
</div>
|
||
|
||
<!-- Description -->
|
||
<div class="o_fhd_field">
|
||
<label t-esc="state.kind === 'bug' ? 'What were you doing? What did you expect?' : 'Describe the desired behaviour and the use case'"/>
|
||
<textarea class="form-control" rows="5"
|
||
t-att-value="state.description"
|
||
t-on-input="(ev) => state.description = ev.target.value"
|
||
placeholder="Steps to reproduce, expected vs. actual, business impact…"/>
|
||
</div>
|
||
|
||
<!-- Error code (bug only) -->
|
||
<div class="o_fhd_field" t-if="state.kind === 'bug'">
|
||
<label>
|
||
Error code / traceback
|
||
<span class="o_fhd_hint">paste any error message or stack trace</span>
|
||
</label>
|
||
<textarea class="form-control o_fhd_mono" rows="3"
|
||
t-att-value="state.errorCode"
|
||
t-on-input="(ev) => state.errorCode = ev.target.value"
|
||
placeholder="e.g. TypeError: Cannot read property 'foo' of undefined …"/>
|
||
</div>
|
||
|
||
<!-- Attachments -->
|
||
<div class="o_fhd_field">
|
||
<label>Attachments</label>
|
||
<div class="o_fhd_actions_row">
|
||
<label class="o_fhd_btn o_fhd_btn_secondary">
|
||
<i class="fa fa-paperclip me-1"/> Attach files
|
||
<input type="file" multiple="multiple" class="d-none"
|
||
t-on-change="onFilesPicked"/>
|
||
</label>
|
||
<button type="button" class="o_fhd_btn o_fhd_btn_secondary"
|
||
t-on-click="onTakeScreenshot"
|
||
t-att-disabled="state.capturing">
|
||
<i class="fa fa-camera me-1"/>
|
||
<t t-if="state.capturing">Capturing…</t>
|
||
<t t-else="">Capture screenshot</t>
|
||
</button>
|
||
</div>
|
||
<div t-if="state.attachments.length" class="o_fhd_attach_list">
|
||
<div t-foreach="state.attachments" t-as="att" t-key="att_index"
|
||
class="o_fhd_attach_item">
|
||
<i t-att-class="att.iconClass"/>
|
||
<span class="o_fhd_attach_name" t-esc="att.name"/>
|
||
<span class="o_fhd_attach_size" t-esc="att.sizeLabel"/>
|
||
<button type="button" class="o_fhd_attach_remove"
|
||
t-on-click="() => this.removeAttachment(att_index)">×</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Result feedback -->
|
||
<div t-if="state.error" class="alert alert-danger mt-2">
|
||
<i class="fa fa-exclamation-triangle me-1"/> <t t-esc="state.error"/>
|
||
</div>
|
||
<div t-if="state.success" class="alert alert-success mt-2">
|
||
<i class="fa fa-check-circle me-1"/>
|
||
Thanks — ticket
|
||
<a t-att-href="state.ticketUrl" target="_blank">
|
||
#<t t-esc="state.ticketId"/>
|
||
</a> created<t t-if="state.attached"> with <t t-esc="state.attached"/> attachment(s)</t>.
|
||
</div>
|
||
</div>
|
||
|
||
<t t-set-slot="footer">
|
||
<button class="btn btn-primary"
|
||
t-on-click="onSubmit"
|
||
t-att-disabled="state.submitting or !state.subject.trim()">
|
||
<t t-if="state.submitting"><i class="fa fa-spinner fa-spin me-1"/></t>
|
||
<t t-else=""><i class="fa fa-paper-plane me-1"/></t>
|
||
Submit
|
||
</button>
|
||
<button class="btn btn-secondary" t-on-click="props.close">
|
||
Close
|
||
</button>
|
||
</t>
|
||
</Dialog>
|
||
</t>
|
||
|
||
</templates>
|