trac-ticketlinks / templates / milestone.cs

Full commit
<?cs set:html.stylesheet = 'css/roadmap.css' ?>
<?cs include:"header.cs"?>
<?cs include:"macros.cs"?>

<div id="ctxtnav" class="nav">
  <?cs if:milestone.href.edit ?><li class="first"><a href="<?cs
    var:milestone.href.edit ?>">Edit Milestone Info</a></li><?cs /if ?>
  <?cs if:milestone.href.delete ?><li class="last"><a href="<?cs
    var:milestone.href.delete ?>">Delete Milestone</a></li><?cs /if ?>

<div id="content" class="milestone">
 <?cs if:milestone.mode == "new" ?>
 <h1>New Milestone</h1>
 <?cs elif:milestone.mode == "edit" ?>
 <h1>Edit Milestone <?cs ?></h1>
 <?cs elif:milestone.mode == "delete" ?>
 <h1>Delete Milestone <?cs ?></h1>
 <?cs else ?>
 <h1>Milestone <?cs ?></h1>
 <form action="#stats" id="prefs" method="get">
   <label for="by">View status by</label>
   <select id="by" name="by"><?cs each:group = milestone.stats.available_groups ?>
      if:milestone.stats.grouped_by == group?> selected="selected"<?cs
      /if ?>><?cs var:group ?></option>
   <?cs /each ?></select>
    <input name="showempty" id="showempty" type="checkbox"<?cs
       if:milestone.stats.show_empty ?> checked="checked"<?cs /if ?>>
    <label for="showempty">Show groups with no assigned tickets</label>
   <div class="buttons">
    <input type="submit" value="Update" />
 <?cs /if ?>

 <?cs if:milestone.mode == "edit" || milestone.mode == "new" ?>
  <script type="text/javascript">
    addEvent(window, 'load', function() {
      document.getElementById('name').focus() }
  <form id="edit" action="<?cs var:cgi_location ?>" method="post">
   <input type="hidden" name="mode" value="milestone" />
   <input type="hidden" name="id" value="<?cs ?>" />
   <input type="hidden" name="action" value="commit_changes" />
   <div class="field">
    <label for="name">Name of the milestone:</label><br />
    <input type="text" id="name" name="name" size="32" value="<?cs ?>" />
   <div class="field">
    <label for="datemode">Completion date:</label><br />
    <select name="datemode" id="datemode"
                  if (this.value=='manual') document.getElementById('date').focus();">
     <option value="manual">Set manually</option>
     <option value="now">Mark as completed now</option>
    <input type="text" id="date" name="date" size="8" value="<?cs ?>" title="Format: MM/DD/YY" />
    <label for="date"><em>Format: MM/DD/YY</em></label>
   <div class="field">
    <fieldset class="iefix">
     <label for="descr">Description (you may use <a tabindex="42" href="<?cs ?>/WikiFormatting">WikiFormatting</a> here):</label>
     <p><textarea id="descr" name="descr" rows="12" cols="80"><?cs
       var:milestone.descr_source ?></textarea></p>
     <?cs call:wiki_toolbar('descr') ?>
   <div class="buttons">
    <?cs if:milestone.mode == "new"
     ?><input type="submit" name="save" value="Add Milestone" /><?cs
     ?><input type="submit" name="save" value="Save Changes" /><?cs
    /if ?>
    <input type="submit" name="cancel" value="Cancel" />
 <?cs elif:milestone.mode == "delete" ?>
  <form action="<?cs var:cgi_location ?>" method="post">
   <input type="hidden" name="mode" value="milestone" />
   <input type="hidden" name="id" value="<?cs ?>" />
   <input type="hidden" name="action" value="confirm_delete" />
   <p><strong>Are you sure you want to delete this milestone?</strong></p>
   <input type="checkbox" id="retarget" name="retarget" checked="checked"
       onclick="enableControl('target', this.checked)"/>
   <label for="target">Retarget associated tickets to milestone</label>
   <select name="target" id="target">
    <option value="">None</option><?cs
     each:other = milestones ?><?cs if:other != ?>
      <option><?cs var:other ?></option><?cs 
     /if ?><?cs /each ?>
   <div class="buttons">
    <input type="submit" name="cancel" value="Cancel" />
    <input type="submit" name="delete" value="Delete Milestone" />
 <?cs else ?>
  <em class="date"><?cs ?>
   <?cs ?><?cs else ?>No date set<?cs /if ?>
  <div class="descr"><?cs var:milestone.descr ?></div>
 <?cs /if ?>

 <?cs if:milestone.mode == "view" ?>
 <h2 class="stats">Status by <?cs var:milestone.stats.grouped_by ?></h2>
 <table class="listing" id="stats"
   summary="Shows the milestone completion status grouped by <?cs
     var:milestone.stats.grouped_by ?>">
   <th class="name" rowspan="2"><?cs var:milestone.stats.grouped_by ?></th>
   <th class="tickets" scope="col" colspan="2">Tickets</th>
   <th class="progress" rowspan="2">Percent Resolved</th>
   <th class="open" scope="col">Active</th>
   <th class="closed" scope="col">Closed</th>
  <?cs if:len(milestone.stats.groups) ?><tbody>
   <?cs each:group = milestone.stats.groups ?>
    <tr class="<?cs if:name(group) % 2 ?>odd<?cs else ?>even<?cs /if ?>">
     <th class="name" scope="row"><a href="<?cs
       var:group.queries.all_tickets ?>"><?cs ?></a></th>
     <td class="open tickets"><a href="<?cs
       var:group.queries.active_tickets ?>"><?cs
       var:group.active_tickets ?></a></td>
     <td class="closed tickets"><a href="<?cs
       var:group.queries.closed_tickets ?>"><?cs
       var:group.closed_tickets ?></a></td>
     <td class="progress">
      <?cs if:#group.total_tickets ?>
       <div class="progress" style="width: <?cs
         var:#group.percent_total * #80 / #100 ?>%"><div style="width: <?cs
         var:#group.percent_complete ?>%"></div>
       <p class="percent"><?cs var:#group.percent_complete ?>%</p>
      <?cs /if ?>
   <?cs /each ?>
  </tbody><?cs /if ?>
  <tbody class="totals"><tr>
   <th class="name" scope="row"><a href="<?cs
     var:milestone.queries.all_tickets ?>">Total</a></th>
   <td class="open tickets"><a href="<?cs
     var:milestone.queries.active_tickets ?>"><?cs
     var:milestone.stats.active_tickets ?></a></td>
   <td class="closed tickets"><a href="<?cs
     var:milestone.queries.closed_tickets ?>"><?cs
     var:milestone.stats.closed_tickets ?></a></td>
   <td class="progress">
    <?cs if:#milestone.stats.total_tickets ?>
     <div class="progress" style="width: 80%">
      <div style="width: <?cs var:#milestone.stats.percent_complete ?>%"></div>
     <p class="percent"><?cs var:#milestone.stats.percent_complete ?>%</p>
    <?cs /if ?>
 </table><?cs /if ?>

 <div id="help">
  <strong>Note:</strong> See <a href="<?cs ?>/TracRoadmap">TracRoadmap</a> for help on using the roadmap.

<?cs include:"footer.cs"?>