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

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

Attachments

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