Skip to content
fossil-skin Artifact [6487e42a84]
Login

Artifact [6487e42a84]

Artifact 6487e42a84f0b9b4a1b3d24de37dd98d1c4163a16392e79a34d165d7041de965:


<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">
  <div class="tkt-new-grid">
    <div class="tkt-main">
      <div class="tkt-card">
        <div class="tkt-card-hdr">
          <strong>New ticket</strong>
          <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" placeholder="Describe the problem, reproduction steps, or proposal... (type / for blocks)">$<icomment></textarea>
          </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">
              <span>Severity <kbd>V</kbd></span>
              <th1>combobox severity $severity_choices 1</th1>
            </label>
            <th1>
            if {[capexpr {w}]} {
              html "<label class='tkt-chip-field' data-tkt-key='p'><span>Priority <kbd>P</kbd></span>"
              combobox priority $priority_choices 1
              html "</label>\n"
              html "<label class='tkt-chip-field' data-tkt-key='u'><span>Subsystem <kbd>U</kbd></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='any'>"
                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">
              <span>Found in</span>
              <input id="tkt-new-foundin" type="text" name="foundin" value="$<foundin>" placeholder="version or hash">
            </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 &middot; </span>
              Preview is optional. Press Cmd/Ctrl+Enter to submit.
            </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">
              <input type="submit" name="submitandnew" value="Create &amp; New" class="tkt-btn">
              <input type="submit" name="submit" value="Create ticket" class="tkt-btn tkt-btn-primary">
            </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>file ticket (Ctrl on Linux/Win)</dd>
        <dt><kbd>Shift</kbd>+<kbd>Cmd</kbd>+<kbd>Enter</kbd></dt><dd>file &amp; start another</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>