Blame Identity/Webenv/Trac/templates/macros.cs

ef5584
ef5584
 <select size="1" id="<?cs var:name ?>" name="<?cs var:name ?>">
ef5584
  if:optional ?><option></option>
ef5584
  each:option = options ?>
ef5584
   <option<?cs if:option == selected ?> selected="selected">
ef5584
     var:option ?></option>
ef5584
  /each ?>
ef5584
 </select>
ef5584
/def?>
ef5584
ef5584
def:labelled_hdf_select(label, options, name, selected, optional) ?>
ef5584
 if:len(options) > #0 ?>
ef5584
  <label for="<?cs var:name ?>"></label>
ef5584
   call:hdf_select(options, name, selected, optional) ?>
ef5584
  </label>
ef5584
  
ef5584
 /if ?>
ef5584
/def ?>
ef5584
ef5584
def:browser_path_links(path, file) ?>
ef5584
 set:first = #1 ?>
ef5584
  each:part = path ?>
ef5584
   set:last = name(part) == len(path) - #1 ?>
ef5584
   if:first ?> class="first" title="Go to root directory"
ef5584
    set:first = #0 ?>
ef5584
   else ?> title="View "
ef5584
   /if ?> href="">
ef5584
   if:!last ?>/
ef5584
 /each ?>
ef5584
/def ?>
ef5584
ef5584
def:diff_line_class(block, line) ?>
ef5584
 set:first = name(line) == 0 ?>
ef5584
 set:last = name(line) + 1 == len(block.lines) ?>
ef5584
 if:first || last ?> class="
ef5584
  if:first ?>first
ef5584
  if:first && last ?> 
ef5584
  if:last ?>last"
ef5584
 /if ?>
ef5584
/def ?>
ef5584
ef5584
def:diff_display(diff, style) ?>
ef5584
 if:style == 'sidebyside' ?>
ef5584
  each:block = diff ?>
ef5584
   if:block.type == 'unmod' ?>
ef5584
    each:line = block.base.lines ?>
ef5584
     var:#block.base.offset + name(line) + 1 ?>
ef5584
     var:line ?> 
ef5584
     var:#block.changed.offset + name(line) + 1 ?>
ef5584
     var:block.changed.lines[name(line)] ?> 
ef5584
    /each ?>
ef5584
   elif:block.type == 'mod' ?>
ef5584
    if:len(block.base.lines) >= len(block.changed.lines) ?>
ef5584
     each:line = block.base.lines ?>
ef5584
      var:#block.base.offset + name(line) + 1 ?>
ef5584
      var:line ?> 
ef5584
      if:len(block.changed.lines) >= name(line) + 1 ?>
ef5584
       each:changedline = block.changed.lines ?>
ef5584
        if:name(changedline) == name(line) ?>
ef5584
         var:#block.changed.offset + name(changedline) + 1 ?>
ef5584
         var:changedline ?> 
ef5584
        /if ?>
ef5584
       /each ?>
ef5584
      else ?>  
ef5584
      /if ?>
ef5584
     /each ?>
ef5584
    else ?>
ef5584
     each:line = block.changed.lines ?>
ef5584
      if:len(block.base.lines) >= name(line) + 1 ?>
ef5584
       each:baseline = block.base.lines ?>
ef5584
        if:name(baseline) == name(line) ?>
ef5584
         var:#block.base.offset + name(baseline) + 1 ?>
ef5584
         var:baseline ?> 
ef5584
        /if ?>
ef5584
       /each ?>
ef5584
      else ?>  
ef5584
      /if ?>
ef5584
      
ef5584
       
ef5584
     /each ?>
ef5584
    /if ?>
ef5584
   elif:block.type == 'add' ?>
ef5584
    each:line = block.changed.lines ?>  
ef5584
     var:#block.changed.offset + name(line) + 1 ?><ins>
ef5584
     var:line ?></ins> 
ef5584
    /each ?>
ef5584
   elif:block.type == 'rem' ?>
ef5584
    each:line = block.base.lines ?>
ef5584
     var:#block.base.offset + name(line) + 1 ?>
ef5584
     var:line ?>   
ef5584
    /each ?>
ef5584
   /if ?>
ef5584
  /each ?>
ef5584
 else ?>
ef5584
  each:block = diff ?>
ef5584
   if:block.type == 'unmod' ?>
ef5584
    each:line = block.base.lines ?>
ef5584
     var:#block.base.offset + name(line) + #1 ?>
ef5584
     var:#block.changed.offset + name(line) + #1 ?>
ef5584
     var:line ?> 
ef5584
    /each ?>
ef5584
   elif:block.type == 'mod' ?>
ef5584
    each:line = block.base.lines ?>
ef5584
     if:name(line) == 0 ?> class="first">
ef5584
     var:#block.base.offset + name(line) + #1 ?> 
ef5584
     var:line ?> 
ef5584
    /each ?>
ef5584
    each:line = block.changed.lines ?>
ef5584
     if:name(line) + 1 == len(block.changed.lines) ?> class="last"> 
ef5584
     var:#block.changed.offset + name(line) + #1 ?>
ef5584
     var:line ?> 
ef5584
    /each ?>
ef5584
   elif:block.type == 'add' ?>
ef5584
    each:line = block.changed.lines ?>
ef5584
     call:diff_line_class(block.changed, line) ?>> 
ef5584
     var:#block.changed.offset + name(line) + #1 ?><ins>
ef5584
     var:line ?></ins> 
ef5584
    /each ?>
ef5584
   elif:block.type == 'rem' ?>
ef5584
    each:line = block.base.lines ?>
ef5584
     call:diff_line_class(block.base, line) ?>>
ef5584
     var:#block.base.offset + name(line) + 1 ?> 
ef5584
     var:line ?> 
ef5584
    /each ?>
ef5584
   /if ?>
ef5584
  /each ?>
ef5584
 /if ?>
ef5584
/def ?>
ef5584
ef5584
def:ticket_custom_props(ticket) ?>
ef5584
 each c=ticket.custom ?>
ef5584
  
ef5584
   if c.type == 'text' ?>
ef5584
    <label>
ef5584
     :
ef5584
     <input type="text" name="custom_<?cs var c.name ?>" value="<?cs var c.value ?>" />
ef5584
    </label>
ef5584
   elif c.type == 'textarea' ?>
ef5584
    <label>
ef5584
     :
ef5584
     
ef5584
       alt c.height ?>12" name="custom_">
ef5584
       var c.value ?></textarea>
ef5584
    </label>
ef5584
   elif c.type == 'checkbox' ?>
ef5584
    <input type="hidden" name="checkbox_<?cs var c.name ?>" />
ef5584
    <label>
ef5584
     
ef5584
       if c.selected ?> checked="checked" />
ef5584
     
ef5584
    </label>
ef5584
   elif c.type == 'select' ?>
ef5584
    <label>
ef5584
     :
ef5584
     <select name="custom_<?cs var c.name ?>">
ef5584
      <option<?cs if v.selected ?> selected="selected">
ef5584
        var v ?></option>
ef5584
     </select>
ef5584
    </label>
ef5584
   elif c.type == 'radio' ?>
ef5584
    <fieldset class="radio">
ef5584
     <legend>:</legend>
ef5584
     each v = c.option ?>
ef5584
      <label>
ef5584
         var v ?>" checked="checked" /> 
ef5584
         var v ?></label>
ef5584
     /each ?>
ef5584
    </fieldset>
ef5584
   /if ?>
ef5584
  
ef5584
 /each ?>
ef5584
/def ?>
ef5584
ef5584
def:list_of_attachments(attachments, attach_href) ?>
ef5584

Attachments

ef5584
 if:len(attachments) ?>
ef5584
  
ef5584
   
ef5584
   var:attachment.filename ?> () - added by 
ef5584
   var:attachment.author ?> on 
ef5584
   var:attachment.time ?>.
ef5584
   if:attachment.description ?>
ef5584
    
ef5584
   /if ?>
ef5584
  /each ?>
ef5584
 /if ?>
ef5584
 if:attach_href ?>
ef5584
  <form method="get" action="<?cs var:attach_href ?>">
ef5584
   <input type="hidden" name="action" value="new" />
ef5584
   <input type="submit" value="Attach File" />
ef5584
  </form>
ef5584
 /if ?>
ef5584
/def ?>
ef5584
ef5584
def:plural(base, count) ?>
ef5584
 var:base ?>s
ef5584
/def ?>