<th1>
if {![info exists mutype]} { set mutype Markdown }
if {[info exists submit] || [info exists submitandnew]} {
set status Open
if {$mutype eq "HTML"} {
set mimetype "text/html"
} elseif {$mutype eq "Wiki"} {
set mimetype "text/x-fossil-wiki"
} elseif {$mutype eq "Markdown"} {
set mimetype "text/x-markdown"
} elseif {$mutype eq {[links only]}} {
set mimetype "text/x-fossil-plain"
} else {
set mimetype "text/plain"
}
submit_ticket
set preview 1
}
</th1>
<div class="tkt-shell" data-tkt-page="tktnew" data-tkt-preview-url="$baseurl/ajax/preview-text">
<div class="tkt-new-grid">
<div class="tkt-main">
<div class="tkt-card" data-pv-scope="new">
<div class="tkt-card-hdr">
<span class="tkt-card-hdr-l">
<strong>New ticket</strong>
<span class="tkt-tabs" role="tablist" aria-label="Description mode">
<button type="button" class="tkt-tab" role="tab" aria-selected="true" data-pv-tab="write" data-pv-for="new">Write</button>
<button type="button" class="tkt-tab" role="tab" aria-selected="false" data-pv-tab="preview" data-pv-for="new">Preview <span class="tkt-tab-dot" data-pv-dot="new" hidden></span></button>
</span>
</span>
<span>Format: <th1>combobox mutype {Markdown Wiki {Plain Text} {[links only]} HTML} 1</th1></span>
</div>
<div class="tkt-form-stack">
<fieldset class="tkt-types-strip" aria-label="Ticket type" data-tkt-types="1">
<th1>
set curType ""
if {[info exists type]} { set curType $type }
set tidx 0
foreach opt $type_choices {
set tidx [expr {$tidx + 1}]
set chk ""
if {$opt eq $curType || ($curType eq "" && $tidx == 1)} { set chk " checked" }
html "<label class='tkt-type-pill'><input type='radio' name='type' value='[htmlize $opt]'$chk>[htmlize $opt]</label>\n"
}
</th1>
</fieldset>
<div class="tkt-field">
<label class="tkt-field-label" for="tkt-new-title">Title</label>
<input id="tkt-new-title" class="tkt-new-title" type="text" name="title" value="$<title>" placeholder="What is wrong, in one line" autocomplete="off">
</div>
<div class="tkt-similar" id="tkt-similar" hidden aria-live="polite">
<div class="tkt-similar-h">Might already be filed. Open one to add to it instead.</div>
<ul id="tkt-similar-list"></ul>
</div>
<div class="tkt-field tkt-composer-wrap">
<label class="tkt-field-label" for="tkt-new-desc">Description</label>
<th1>set nline [linecount $icomment 40 12]</th1>
<textarea id="tkt-new-desc" name="icomment" rows="$nline" class="wikiedit" data-tkt-slash="1" data-tkt-draft="tkt-new" data-pv-input="new" placeholder="Describe the problem, reproduction steps, or proposal... (type / for blocks)">$<icomment></textarea>
<div class="tkt-preview-pane markdown" data-pv-pane="new" hidden></div>
</div>
<template data-tkt-tmpl="Code_Defect">## Steps to reproduce
1.
## Expected
## Actual
</template>
<template data-tkt-tmpl="Feature_Request">## Problem
## Proposed behavior
## Acceptance criteria
- [ ] </template>
<template data-tkt-tmpl="Documentation">## Page or command
## What is unclear or missing
</template>
<template data-tkt-tmpl="Build_Problem">## Platform and compiler
## Configure flags
## Error output
```
```</template>
<div class="tkt-chips-row" role="group" aria-label="Triage fields">
<label class="tkt-chip-field" data-tkt-key="v" title="Severity (shortcut: V)">
<span class="tkt-chip-k">Severity</span>
<th1>combobox severity $severity_choices 1</th1>
</label>
<th1>
if {[capexpr {w}]} {
html "<label class='tkt-chip-field' data-tkt-key='p' title='Priority (shortcut: P)'><span class='tkt-chip-k'>Priority</span>"
combobox priority $priority_choices 1
html "</label>\n"
html "<label class='tkt-chip-field' data-tkt-key='u' title='Subsystem (shortcut: U)'><span class='tkt-chip-k'>Subsystem</span>"
if {[llength $subsystem_choices] > 0} {
combobox subsystem $subsystem_choices 1
} else {
set curSub ""
if {[info exists subsystem]} { set curSub $subsystem }
html "<input id='subsystem' type='text' name='subsystem' value='[htmlize $curSub]' list='tkt-new-sublist' placeholder='+ Subsystem'>"
html "<datalist id='tkt-new-sublist'>"
query {SELECT DISTINCT subsystem AS sv FROM ticket WHERE length(subsystem)>0 ORDER BY subsystem} {
html "<option value='[htmlize $sv]'>"
}
html "</datalist>"
}
html "</label>\n"
}
</th1>
<label class="tkt-chip-field" title="Version found in">
<span class="tkt-chip-k">Found in</span>
<input id="tkt-new-foundin" type="text" name="foundin" value="$<foundin>" placeholder="version">
</label>
</div>
<details class="tkt-drawer">
<summary>Optional private contact</summary>
<div class="tkt-field" style="margin-top:0.55rem;">
<label class="tkt-field-label" for="tkt-new-contact">Contact email (private; not publicly visible)</label>
<input id="tkt-new-contact" type="text" name="private_contact" value="$<private_contact>" placeholder="Optional">
</div>
</details>
<div class="tkt-form-actions">
<span class="tkt-help">
<span class="tkt-draft-pill" data-tkt-draft-badge="tkt-new" hidden>Draft saved in tab · </span>
<span class="tkt-gate-note" data-pv-gate="new">Preview Markdown before creating ticket (artifacts are permanent).</span>
</span>
<div class="tkt-form-btns">
<input type="submit" name="cancel" value="Cancel" class="tkt-btn">
<input type="submit" name="preview" value="Preview" class="tkt-btn" data-pv-btn="new">
<th1>
set disAttr ""
if {![info exists preview]} { set disAttr " disabled" }
html "<input type='submit' name='submitandnew' value='Create & New' class='tkt-btn' data-pv-submit-optional='new'$disAttr>\n"
html "<input type='submit' name='submit' value='Create ticket' class='tkt-btn tkt-btn-primary' data-pv-submit-optional='new'$disAttr>\n"
</th1>
</div>
</div>
</div>
</div>
<th1>enable_output [info exists preview]</th1>
<div class="tkt-preview-box">
<h3>Description preview</h3>
<th1>
if {$mutype eq "Wiki"} {
wiki $icomment
} elseif {$mutype eq "Plain Text"} {
set r [randhex]
wiki "<verbatim-$r>[string trimright $icomment]\n</verbatim-$r>"
} elseif {$mutype eq "Markdown"} {
html [lindex [markdown "$icomment\n"] 1]
} elseif {$mutype eq {[links only]}} {
set r [randhex]
wiki "<verbatim-$r links>[string trimright $icomment]\n</verbatim-$r>"
} else {
wiki "<nowiki>$icomment\n</nowiki>"
}
</th1>
</div>
<th1>enable_output 1</th1>
</div>
<aside class="tkt-kbd-card" aria-label="Keyboard shortcuts">
<h3>Keyboard</h3>
<dl class="tkt-kbd-dl">
<dt><kbd>Cmd</kbd>+<kbd>Enter</kbd></dt><dd>1st press previews, 2nd files ticket</dd>
<dt><kbd>Shift</kbd>+<kbd>Cmd</kbd>+<kbd>Enter</kbd></dt><dd>file & start another (after preview)</dd>
<dt><kbd>V</kbd> <kbd>P</kbd> <kbd>U</kbd></dt><dd>focus severity, priority, subsystem</dd>
<dt><kbd>1</kbd>-<kbd>9</kbd></dt><dd>pick option in focused select</dd>
<dt><kbd>/</kbd></dt><dd>Markdown block menu at line start</dd>
</dl>
</aside>
</div>
<th1>
if {[capexpr {r}]} {
html "<ul id='tkt-similar-data' hidden>\n"
query {
SELECT substr(tkt_uuid,1,10) AS xid,
coalesce(status,'Open') AS xst,
coalesce(title,'') AS xtitle
FROM ticket
WHERE length(title)>0
ORDER BY tkt_mtime DESC
LIMIT 250
} {
html "<li data-id='[htmlize $xid]' data-st='[htmlize $xst]'>[htmlize $xtitle]</li>\n"
}
html "</ul>\n"
}
</th1>
</div>