<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:i18n="http://genshi.edgewall.org/i18n"
      i18n:domain="tractags">
  <xi:include href="admin.html" />
  <?python
    from tractags.api import _ ?>
  <head>
    <title>Tags</title>
  </head>
  <body>
    <h2>Manage Tags</h2>
    <form id="tagchange" class="mod" method="post" action="">
      <fieldset>
        <div class="system-message" py:if="error">
          <p>${error}</p>
        </div>
        <legend>Replace</legend>
        <p>Select an existing tag to replace with another one; two or more
          to consolidate into one. The <em>required</em> new tag may actually
          be an existing tag or a new one. A change comment will be added
          if supported by the tag storage for the resource's realm.
        </p>
        <div class="field">
          <label>Current Tag:<br />
            <select name="tag_name" size="7" multiple="true" >
              <option py:for="tag in tags"
                      value="${tag}" class="textwidget" 
                      selected="${tag == selected and 'selected' or None}">
                ${tag}
              </option>
            </select>
          </label>
        </div>
        <div class="field">
          <label i18n:msg="">New Tag:<br />
            <input type="text" name="tag_new_name" /><br />or
            <input type="checkbox" name="allow_delete" value="True" />
            allow tag deletion
          </label>
        </div>
        <div class="field">
          <label>Comment (optional):<br />
            <textarea name="comment" class="trac-resizable"
                      cols="50" rows="3"></textarea>
          </label>
          <p class="help"><b>Beware:</b> Attempting to replace one or more
            tags will always add the new tag, but <b>removal could fail</b>
            for some tags, because tags might be immutable depending
            on internals of the tag provider they've been derived from.
          </p>
          <p class="hint">You'll need to investigate further on how to
            change/remove these remaining tags closer to the tagged resource,
            i.e. in your <code>trac.ini</code> see <code>ticket_fields</code>
            option that lists fields to expose as tags for tag realm:ticket.
          </p>
        </div>
      </fieldset>
      <div class="buttons">
        <input type="submit" value="${_('Change')}" />
      </div>
    </form>
  </body>
</html>
