View Ticket
Not logged in
Ticket UUID: f5e414efde8c3ddf71a05d392cf64f245bf946cc
Title: Need a "Preview" button when editing a ticket
Status: Fixed Type: Feature_Request
Severity: Minor Priority:
Subsystem: Resolution: Fixed
Last Modified: 2008-11-26 02:40:03
Version Found In:
Description & Comments:
The preview is especially needed on the Comments section where the user is allowed to enter wiki - which might not be rendered as expected. There already is a Preview on the "New Ticket" page. It should not be that much trouble to add the same to the "Edit Ticket" page.

kkinnell added on 2008-11-25 20:22:28:
Here is a "cut & paste" patch for version dec2c22d9d.

Setup->Tickets->Edit Ticket Page

Copy the default html, and paste it into a file.

Copy the patch text below, and paste it into a different file.

Run "patch -c default file patch file"

Then clear out the html in the text area on the Edit Ticket Page and cut&paste the patched text.

The changes just adding buttons and connecting them to display areas, but it's easier to explain it in diff -c than it is in English. :)

*** distedit.th1        2008-11-25 14:06:08.000000000 -0600
--- prvwedit.th1        2008-11-25 14:03:41.000000000 -0600
***************
*** 60,65 ****
--- 60,66 ----
     wrap="virtual" class="wikiedit">$<comment></textarea><br>
    <input type="hidden" name="eall" value="1">
    <input type="submit" name="aonlybtn" value="Append Remark">
+   <input type="submit" name="prevw1btn" value="Preview">
  <th1>enable_output [expr {!$eall}]</th1>
    Append Remark from
    <input type="text" name="username" value="$<username>" size="30">:<br>
***************
*** 67,73 ****
--- 68,92 ----
     wrap="virtual" class="wikiedit">$<cmappnd></textarea><br>
  <th1>enable_output [expr {[hascap w] && !$eall}]</th1>
    <input type="submit" name="eallbtn" value="Edit All">
+   <input type="submit" name="prevw2btn" value="Preview">
  <th1>enable_output 1</th1>
+
+ <th1>enable_output [info exists prevw1btn]</th1>
+ <tr><td colspan="2">
+ Description Preview:<br><hr>
+ <th1>wiki $comment</th1>
+ <hr>
+ </td></tr>
+ <th1>enable_output 1</th1>
+
+ <th1>enable_output [info exists prevw2btn]</th1>
+ <tr><td colspan="2">
+ Description Preview:<br><hr>
+ <th1>wiki $cmappnd</th1>
+ <hr>
+ </td></tr>
+ <th1>enable_output 1</th1>
+
  </td></tr>
  <tr><td align="right"></td><td>
  <input type="submit" name="submit" value="Submit Changes">

Hrm. I wish I'd had the preview before I submitted this; I would've realized I need to change all of those '<' chars into '&lt;' sequences.


drh added on 2008-11-26 02:40:03:
Preview button similar to what is described above was added to the default ticket configuration by check-in 6bcff72d23. Existing repositories will want to import these changes. The easiest way to do this after upgrading the fossil executable to version 6bcff72d23 or later is to go to

Setup -> Tickets -> Edit_Ticket_Page

And there select "Revert To Default"