Hey guys,

This is a simple modification to the "tktnew" page (alpha code).  I'd
appreciate any feedback.

God only knows if the embedded query is correct, but I think it works as a
proof of concept.


To try it out:
    Make a copy of your repository (it just safer that way)
    Serve it out (fossil serve --port 8080 reponame)
    Log in as an admin
    Click on the "Admin" menu item
    Click on the "Tickets" item
    Click on the "New Ticket Page"
    Copy the following code into the code textarea
    Click on the "Apply Changes" button
    Create a new ticket and enjoy the new look




<!-- START CODE -->
<th1>
  if {![info exists mutype]} {set mutype {[links only]}}
  if {[info exists submit]} {
     set status Open
     if {$mutype eq "HTML"} {
       set mimetype "text/html"
     } elseif {$mutype eq "Wiki"} {
       set mimetype "text/x-fossil-wiki"
     } elseif {$mutype eq {[links only]}} {
       set mimetype "text/x-fossil-plain"
     } else {
       set mimetype "text/plain"
     }
     submit_ticket
     set preview 1
  }
</th1>


<h1 style="text-align: center;">Enter A New Ticket</h1>

<style>
#ticket_entry{
    line-height:40px;
}

.col1 {
    display: inline-block;
    width: 150px;
    vertical-align: top;
    font-weight:bold;

    //background-color:wheat;

}
</style>

<div id='ticket_entry'>

<span class="col1">Title:</span>
<input type="text" name="title" title="Single line summary of the ticket"
size="60" value="$<title>" />
<br>

<span class="col1">Type:</span>
<!--
<th1>combobox type $type_choices 1</th1>
-->

<th1>
for {set i 0} {$i < [llength $type_choices]} {set i [expr {$i+1}]} {
    if {$i == 0} { set ch "checked" } else { set ch "" }
    set c [lindex $type_choices $i]
    html "<input type='radio' name='type' value='$c'
$ch>$c</input>&nbsp;&nbsp;"
}
</th1>
<br>


<span class="col1">Severity:</span>
<!--
<th1>combobox severity $severity_choices 1</th1>
-->
<th1>
for {set i 0} {$i < [llength $severity_choices]} {set i [expr {$i+1}]} {
    if {$i == 0} { set ch "checked" } else { set ch "" }
    set c [lindex $severity_choices $i]
    html "<input type='radio' name='severity' value='$c' $ch>$c </input> "
}
</th1>
<br>


<!--       SLIDER

<span class="col1">Severity:</span>
<th1>
set len [llength $severity_choices]
html "<input type='range' name='format' min=1 max=$len step=1 value='1'
style='width:400px;' oninput='showValue(event)'/><span
id='sev_val'>$len</span>"

</th1>
<br>

-->

<span class="col1">Found In:</span>
<input id='foundin_id' type="text" name="foundin" size="20"
value="$<foundin>" />&nbsp;&nbsp;
<th1>

    query {
        select distinct substr(tag.tagname,5) as xxx from event,tagxref, tag
        where event.objid=tagxref.rid and
        tag.tagid == tagxref.tagid and
        event.type="ci" and
        tag.tagname like "sym-%"
        order by event.mtime asc
        limit 6
     } {
          html  "<a
href='javascript:(function(){document.getElementById(\"foundin_id\").value=\"$xxx\";})()'>$xxx</a>&nbsp;&nbsp;"
    }
</th1>
<br>

<span class="col1">Email:</span>
<input type="text" name="private_contact" title="Contact information"
size="60" value="$<private_contact>" />
<br>
<span class="col1">Description:</span>


<th1>set nline [linecount $comment 50 10]</th1>
<textarea name="icomment" cols="80" rows="$nline" wrap="virtual"
class="wikiedit">$<icomment></textarea><br />

<span class="col1">Description format:</span>
<input type='radio' name='mutype' value='Plain Text' checked>Plain
Text</input>
<input type='radio' name='mutype' value='links only'>Links Only</input>
<input type='radio' name='mutype' value='HTML'>HTML</input>
<input type='radio' name='mutype' value='Wiki'>Wiki</input>
<br>
<br>
<br>
<th1>enable_output [info exists preview]</th1>

Description Preview:<br /><hr />
<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 {[links only]}} {
  set r [randhex]
  wiki "<verbatim-$r links>[string trimright $icomment]\n</verbatim-$r>"
} else {
  wiki "<nowiki>$icomment\n</nowiki>"
}
</th1>

<th1>enable_output 1</th1>

<input type="submit" name="preview" value="Preview" />

<th1>enable_output [info exists preview]</th1>

<input type="submit" name="submit" value="Submit" />

<th1>enable_output 1</th1>

<input type="submit" name="cancel" value="Cancel" />

</div>

<!-- END CODE -->
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to