Changeset 2947


Ignore:
Timestamp:
03/30/05 19:38:00 (8 years ago)
Author:
moschny
Message:

Imported http://svn.swapoff.org/trachacks/file/trunk/macros/AddComment.py?rev=30&format=raw .

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trac/trunk/wiki-macros/AddComment.py

    r2885 r2947  
    3131    cancel = hdf.getValue("args.canceladdcomment", "") 
    3232    submit = hdf.getValue("args.submitaddcomment", "") 
     33    if not cancel: 
     34        authname = hdf.getValue("args.authoraddcomment", authname) 
    3335 
    3436    # Ensure [[AddComment]] is not present in comment, so that infinite 
     
    7173    out.write("<form action='%s#commentpreview' method='post'>\n" % env.href.wiki(pagename)) 
    7274    out.write("<fieldset>\n<legend>Add comment</legend>\n") 
    73     out.write("<textarea id='addcomment' name='addcomment' cols='80' rows='5'%s>" % disabled) 
     75    out.write("<div class='field'>\n<textarea id='addcomment' name='addcomment' cols='80' rows='5'%s>" % disabled) 
    7476    if wikipreview: 
    7577        out.write("Page preview...") 
     
    7779        out.write(comment) 
    7880    out.write("</textarea>\n") 
    79     out.write("<br/>\n") 
    80     out.write("<input type='submit' name='submitaddcomment' value='Add comment'%s/>\n" % disabled) 
     81    out.write("</div>\n") 
     82    out.write('<div class="field">\n<label for="authoraddcomment">Your email or username:</label>\n<br/><input id="authoraddcomment" type="text" name="authoraddcomment" size="30" value="%s" />\n</div>' % authname) 
     83    out.write("<div class='field'>\n<input size='30' type='submit' name='submitaddcomment' value='Add comment'%s/>\n" % disabled) 
    8184    out.write("<input type='submit' name='previewaddcomment' value='Preview comment'%s/>\n" % disabled) 
    82     out.write("<input type='submit' name='canceladdcomment' value='Cancel'%s/>\n" % disabled) 
     85    out.write("<input type='submit' name='canceladdcomment' value='Cancel'%s/>\n</div>\n" % disabled) 
    8386    out.write("<script type='text/javascript'>\naddWikiFormattingToolbar(document.getElementById('addcomment'));\n</script>\n") 
    8487    out.write("</fieldset>\n</form>\n") 
Note: See TracChangeset for help on using the changeset viewer.