Changeset 2416 for package_branches


Ignore:
Timestamp:
Aug 9, 2009, 8:08:33 PM (15 years ago)
Author:
broder
Message:

Translate newlines to break tags in the machine description.

Location:
package_branches/invirt-web/cherrypy/code/templates
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • package_branches/invirt-web/cherrypy/code/templates/functions.mako

    r2406 r2416  
    4444def jquote(string):
    4545    return "'" + string.replace('\\', '\\\\').replace("'", "\\'").replace('\n', '\\n') + "'"
     46
     47def nl2br(string):
     48    return string.replace('\n', '<br/>')
    4649%>
    4750
  • package_branches/invirt-web/cherrypy/code/templates/info.mako

    r2413 r2416  
    6161  <input type="hidden" name="machine_id" value="${defaults.machine_id}"/>
    6262  <table>
    63     <tr><td>Description:</td><td colspan="2"><textarea name="description" rows="4" cols="60">${defaults.description}</textarea></td></tr>
     63    <tr><td>Description:</td><td colspan="2"><textarea name="description" rows="4" cols="60">${defaults.description|self.fn.module.nl2br}</textarea></td></tr>
    6464    <tr><td>Owner${self.fn.helppopup("Owner")}:</td><td><input type="text" name="owner", value="${defaults.owner}"/></td></tr>
    6565${self.fn.errorRow('owner', err)}
  • package_branches/invirt-web/cherrypy/code/templates/list.mako

    r2413 r2416  
    121121      </tr>
    122122      <tr>
    123         <td colspan="7" style="padding-left: 1em; color: #666">${machine.description}</td>
     123        <td colspan="7" style="padding-left: 1em; color: #666">${machine.description|self.fn.module.nl2br}</td>
    124124      </tr>
    125125</%def>
Note: See TracChangeset for help on using the changeset viewer.