Fossil SCM
show previous ticket comments for [/tktview/3bcacd36ff|ticket: Show ticket history on ticket edit page]
Commit
ff009a8f0e482a861ceb279ead1a97f97850370fe8b12d029c62d69b2869e291
Parent
f5619ef3e0bfa16…
1 file changed
+41
+41
| --- src/tktsetup.c | ||
| +++ src/tktsetup.c | ||
| @@ -712,10 +712,51 @@ | ||
| 712 | 712 | @ <input type="submit" name="cancel" value="Cancel"> |
| 713 | 713 | @ </td> |
| 714 | 714 | @ <td>Abandon this edit</td> |
| 715 | 715 | @ </tr> |
| 716 | 716 | @ |
| 717 | +@ <th1> | |
| 718 | +@ set seenRow 0 | |
| 719 | +@ set alwaysPlaintext [info exists plaintext] | |
| 720 | +@ query {SELECT datetime(tkt_mtime) AS xdate, login AS xlogin, | |
| 721 | +@ mimetype as xmimetype, icomment AS xcomment, | |
| 722 | +@ username AS xusername | |
| 723 | +@ FROM ticketchng | |
| 724 | +@ WHERE tkt_id=$tkt_id AND length(icomment)>0} { | |
| 725 | +@ if {$seenRow} { | |
| 726 | +@ html "<hr>\n" | |
| 727 | +@ } else { | |
| 728 | +@ html "<tr><td colspan='2'><hr></td></tr>" | |
| 729 | +@ html "<tr><td colspan='2' class='tktDspLabel' style='text-align:left'>Previous User Comments:</td></tr>\n" | |
| 730 | +@ html "<tr><td colspan='2' class='tktDspValue'>\n" | |
| 731 | +@ set seenRow 1 | |
| 732 | +@ } | |
| 733 | +@ html "<span class='tktDspCommenter'>" | |
| 734 | +@ html "[htmlize $xlogin]" | |
| 735 | +@ if {$xlogin ne $xusername && [string length $xusername]>0} { | |
| 736 | +@ html " (claiming to be [htmlize $xusername])" | |
| 737 | +@ } | |
| 738 | +@ html " added on $xdate:" | |
| 739 | +@ html "</span>\n" | |
| 740 | +@ if {$alwaysPlaintext || $xmimetype eq "text/plain"} { | |
| 741 | +@ set r [randhex] | |
| 742 | +@ if {$xmimetype ne "text/plain"} {html "([htmlize $xmimetype])\n"} | |
| 743 | +@ wiki "<verbatim-$r>[string trimright $xcomment]</verbatim-$r>\n" | |
| 744 | +@ } elseif {$xmimetype eq "text/x-fossil-wiki"} { | |
| 745 | +@ wiki "<p>\n[string trimright $xcomment]\n</p>\n" | |
| 746 | +@ } elseif {$xmimetype eq "text/x-markdown"} { | |
| 747 | +@ html [lindex [markdown $xcomment] 1] | |
| 748 | +@ } elseif {$xmimetype eq "text/html"} { | |
| 749 | +@ wiki "<p><nowiki>\n[string trimright $xcomment]\n</nowiki>\n" | |
| 750 | +@ } else { | |
| 751 | +@ set r [randhex] | |
| 752 | +@ wiki "<verbatim-$r links>[string trimright $xcomment]</verbatim-$r>\n" | |
| 753 | +@ } | |
| 754 | +@ } | |
| 755 | +@ if {$seenRow} {html "</td></tr>\n"} | |
| 756 | +@ </th1> | |
| 757 | +@ | |
| 717 | 758 | @ </table> |
| 718 | 759 | ; |
| 719 | 760 | |
| 720 | 761 | /* |
| 721 | 762 | ** Return the code used to generate the edit ticket page |
| 722 | 763 |
| --- src/tktsetup.c | |
| +++ src/tktsetup.c | |
| @@ -712,10 +712,51 @@ | |
| 712 | @ <input type="submit" name="cancel" value="Cancel"> |
| 713 | @ </td> |
| 714 | @ <td>Abandon this edit</td> |
| 715 | @ </tr> |
| 716 | @ |
| 717 | @ </table> |
| 718 | ; |
| 719 | |
| 720 | /* |
| 721 | ** Return the code used to generate the edit ticket page |
| 722 |
| --- src/tktsetup.c | |
| +++ src/tktsetup.c | |
| @@ -712,10 +712,51 @@ | |
| 712 | @ <input type="submit" name="cancel" value="Cancel"> |
| 713 | @ </td> |
| 714 | @ <td>Abandon this edit</td> |
| 715 | @ </tr> |
| 716 | @ |
| 717 | @ <th1> |
| 718 | @ set seenRow 0 |
| 719 | @ set alwaysPlaintext [info exists plaintext] |
| 720 | @ query {SELECT datetime(tkt_mtime) AS xdate, login AS xlogin, |
| 721 | @ mimetype as xmimetype, icomment AS xcomment, |
| 722 | @ username AS xusername |
| 723 | @ FROM ticketchng |
| 724 | @ WHERE tkt_id=$tkt_id AND length(icomment)>0} { |
| 725 | @ if {$seenRow} { |
| 726 | @ html "<hr>\n" |
| 727 | @ } else { |
| 728 | @ html "<tr><td colspan='2'><hr></td></tr>" |
| 729 | @ html "<tr><td colspan='2' class='tktDspLabel' style='text-align:left'>Previous User Comments:</td></tr>\n" |
| 730 | @ html "<tr><td colspan='2' class='tktDspValue'>\n" |
| 731 | @ set seenRow 1 |
| 732 | @ } |
| 733 | @ html "<span class='tktDspCommenter'>" |
| 734 | @ html "[htmlize $xlogin]" |
| 735 | @ if {$xlogin ne $xusername && [string length $xusername]>0} { |
| 736 | @ html " (claiming to be [htmlize $xusername])" |
| 737 | @ } |
| 738 | @ html " added on $xdate:" |
| 739 | @ html "</span>\n" |
| 740 | @ if {$alwaysPlaintext || $xmimetype eq "text/plain"} { |
| 741 | @ set r [randhex] |
| 742 | @ if {$xmimetype ne "text/plain"} {html "([htmlize $xmimetype])\n"} |
| 743 | @ wiki "<verbatim-$r>[string trimright $xcomment]</verbatim-$r>\n" |
| 744 | @ } elseif {$xmimetype eq "text/x-fossil-wiki"} { |
| 745 | @ wiki "<p>\n[string trimright $xcomment]\n</p>\n" |
| 746 | @ } elseif {$xmimetype eq "text/x-markdown"} { |
| 747 | @ html [lindex [markdown $xcomment] 1] |
| 748 | @ } elseif {$xmimetype eq "text/html"} { |
| 749 | @ wiki "<p><nowiki>\n[string trimright $xcomment]\n</nowiki>\n" |
| 750 | @ } else { |
| 751 | @ set r [randhex] |
| 752 | @ wiki "<verbatim-$r links>[string trimright $xcomment]</verbatim-$r>\n" |
| 753 | @ } |
| 754 | @ } |
| 755 | @ if {$seenRow} {html "</td></tr>\n"} |
| 756 | @ </th1> |
| 757 | @ |
| 758 | @ </table> |
| 759 | ; |
| 760 | |
| 761 | /* |
| 762 | ** Return the code used to generate the edit ticket page |
| 763 |