Skip to content
fossil-skin Artifact [cdcd852ac3]
Login

Artifact [cdcd852ac3]

Artifact cdcd852ac38f457cb51f5a79b514cfc60aa3369472283cc625b4081050a4eaca:


<th1>
if {[capexpr {n}]} {
  submenu link "Copy Ticket" $baseurl/tktnew/$tkt_uuid
}
if {[capexpr {nk}]} {
  submenu link "Edit Wiki" $baseurl/wikiedit?name=ticket/$tkt_uuid
}
</th1>
<div class="tkt-shell">
  <div class="tkt-head">
    <div class="tkt-head-top">
      <h2 class="tkt-title">$<title></h2>
      <th1>
      if {[capexpr {w}] && [info exists tkt_uuid]} {
        html "<a class='tkt-btn' href='$baseurl/tktedit/[httpize $tkt_uuid]'>Edit ticket</a>"
      }
      </th1>
    </div>
    <div class="tkt-head-sub">
      <th1>
      set stcls "tkt-tag tkt-tag-ok"
      if {$status eq "Review"} { set stcls "tkt-tag tkt-tag-warn" }
      if {$status eq "Closed" || $status eq "Deferred"} { set stcls "tkt-tag" }
      html "<span class='$stcls'>[htmlize $status]</span>"
      if {[info exists tkt_uuid]} {
        copybtn hash-tk 0 $tkt_uuid 2
        if {[hascap s]} { puts " (#$tkt_id)" }
      } else {
        html "<span class='tkt-tag tkt-tag-crit'>Deleted</span>"
      }
      if {[info exists tkt_cage]} {
        html "<span>Created [htmlize $tkt_cage] ago</span>"
      }
      if {[info exists tkt_mage]} {
        html "<span>Updated [htmlize $tkt_mage] ago</span>"
      }
      </th1>
    </div>
  </div>

  <th1>wiki_assoc "ticket" $tkt_uuid</th1>

  <div class="tkt-layout">
    <div class="tkt-main">
      <th1>
      set hasAny 0
      if {[info exists comment]} {
        if {[string length [string trim $comment]] > 0} {
          set hasAny 1
          html "<div class='tkt-card'>"
          html "<div class='tkt-card-hdr'><strong>Description</strong>"
          if {[info exists tkt_datetime_creation]} {
            html "<span>[htmlize $tkt_datetime_creation]</span>"
          }
          html "</div><div class='tkt-card-body'>"
          if {[info exists plaintext]} {
            set r [randhex]
            wiki "<verbatim-$r links>\n$comment\n</verbatim-$r>"
          } else {
            wiki $comment
          }
          html "</div></div>\n"
        }
      }
      set alwaysPlaintext [info exists plaintext]
      query {SELECT datetime(tkt_mtime,toLocal()) AS xdate, login AS xlogin,
                    mimetype AS xmimetype, icomment AS xcomment,
                    username AS xusername
               FROM ticketchng
              WHERE tkt_id=$tkt_id AND length(icomment)>0
              ORDER BY tkt_mtime ASC} {
        set hasAny 1
        html "<div class='tkt-card tktCommentEntry'>"
        html "<div class='tkt-card-hdr'><span class='tktDspCommenter'><strong>[htmlize $xlogin]</strong>"
        if {$xlogin ne $xusername && [string length $xusername] > 0} {
          html " (claiming to be [htmlize $xusername])"
        }
        html "</span><span>[htmlize $xdate]</span></div>"
        html "<div class='tkt-card-body'>"
        if {$alwaysPlaintext || $xmimetype eq "text/plain"} {
          set r [randhex]
          if {$xmimetype ne "text/plain"} { puts "($xmimetype)\n" }
          wiki "<verbatim-$r>[string trimright $xcomment]</verbatim-$r>\n"
        } elseif {$xmimetype eq "text/x-fossil-wiki"} {
          wiki "<p>\n[string trimright $xcomment]\n</p>\n"
        } elseif {$xmimetype eq "text/x-markdown"} {
          html [lindex [markdown $xcomment] 1]
        } elseif {$xmimetype eq "text/html"} {
          wiki "<p><nowiki>\n[string trimright $xcomment]\n</nowiki>\n"
        } else {
          set r [randhex]
          wiki "<verbatim-$r links>[string trimright $xcomment]</verbatim-$r>\n"
        }
        html "</div></div>\n"
      }
      if {!$hasAny} {
        html "<div class='tkt-card'><div class='tkt-empty'>No description or comments yet.</div></div>\n"
      }
      if {[capexpr {w}] && [info exists tkt_uuid]} {
        html "<form class='tkt-card' method='post' action='$baseurl/tktedit/[httpize $tkt_uuid]'>\n"
        insertCsrf
        html "<div class='tkt-card-hdr'><strong>Add comment</strong><span>Markdown</span></div>\n"
        html "<div class='tkt-form-stack'>\n"
        html "<input type='hidden' name='mutype' value='Markdown'>\n"
        html "<textarea name='icomment' rows='5' class='wikiedit' aria-label='Add comment' placeholder='Write a Markdown comment...'></textarea>\n"
        html "<div class='tkt-form-actions'>\n"
        html "<span class='tkt-help'>Posts directly without mandatory preview.</span>\n"
        html "<div class='tkt-form-btns'>\n"
        html "<button type='submit' name='preview' value='1' class='tkt-btn'>Preview</button>\n"
        html "<button type='submit' name='submit' value='1' class='tkt-btn tkt-btn-primary'>Comment</button>\n"
        html "</div></div></div></form>\n"
      }
      </th1>
    </div>

    <aside class="tkt-sidebar" aria-label="Ticket properties">
      <div class="tkt-field"><span class="tkt-field-label">Status</span><span class="tkt-field-val">$<status></span></div>
      <div class="tkt-field"><span class="tkt-field-label">Type</span><span class="tkt-field-val">$<type></span></div>
      <div class="tkt-field"><span class="tkt-field-label">Priority</span><span class="tkt-field-val">$<priority></span></div>
      <div class="tkt-field"><span class="tkt-field-label">Severity</span><span class="tkt-field-val">$<severity></span></div>
      <div class="tkt-field"><span class="tkt-field-label">Subsystem</span><span class="tkt-field-val">$<subsystem></span></div>
      <div class="tkt-field"><span class="tkt-field-label">Resolution</span><span class="tkt-field-val">$<resolution></span></div>
      <div class="tkt-field">
        <span class="tkt-field-label">Version found in</span>
        <span class="tkt-field-val">
        <th1>
        set versionlink ""
        set urlfoundin [httpize $foundin]
        set tagpattern {^[-0-9A-Za-z_\\.]+$}
        if {[regexp $tagpattern $foundin]} {
          query {SELECT count(*) AS match FROM tag
                 WHERE tagname=concat('sym-',$foundin)} {
            if {$match} { set versionlink "timeline?t=$urlfoundin" }
          }
        }
        set hashpattern {^[0-9a-f]+$}
        if {[regexp $hashpattern $foundin]} {
          set pattern $foundin*
          query {SELECT count(*) AS match FROM blob WHERE uuid GLOB $pattern} {
            if {$match} { set versionlink "info/$urlfoundin" }
          }
        }
        if {$versionlink eq ""} {
          puts $foundin
        } else {
          html "<a href='[htmlize $versionlink]'>[htmlize $foundin]</a>"
        }
        </th1>
        </span>
      </div>
      <div class="tkt-field">
        <span class="tkt-field-label">Created</span>
        <span class="tkt-field-val"><th1>if {[info exists tkt_datetime_creation]} { puts $tkt_datetime_creation }</th1></span>
      </div>
      <div class="tkt-field">
        <span class="tkt-field-label">Last modified</span>
        <span class="tkt-field-val"><th1>if {[info exists tkt_datetime]} { puts $tkt_datetime }</th1></span>
      </div>
      <th1>
      if {[hascap e]} {
        html "<div class='tkt-field'><span class='tkt-field-label'>Contact</span><span class='tkt-field-val'>[htmlize $private_contact]</span></div>"
      }
      </th1>
    </aside>
  </div>
</div>