[%# The contents of this file are subject to the Mozilla Public
  # License Version 1.1 (the "License"); you may not use this file
  # except in compliance with the License. You may obtain a copy of
  # the License at http://www.mozilla.org/MPL/
  #
  # Software distributed under the License is distributed on an "AS
  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  # implied. See the License for the specific language governing
  # rights and limitations under the License.
  #
  # The Original Code is the Bugzilla Bug Tracking System.
  #
  # The Initial Developer of the Original Code is Netscape Communications
  # Corporation. Portions created by Netscape are
  # Copyright (C) 1998 Netscape Communications Corporation. All
  # Rights Reserved.
  #
  # Contributor(s): Walter Hoehn <wassa@columbia.edu>
  #                 John Belmonte <john@neggie.net>
  #                 Jason Remillard <jremillardshop@letterboxes.org>
  #                 Phil Ringnalda <bugzilla@philringnalda.com>
  #
  # This is a template for generating an Atom representation of a buglist. 
  #%]

[% DEFAULT title = "$terms.Bugzilla $terms.Bugs" %]

<?xml version="1.0"[% IF Param('utf8') %] encoding="UTF-8"[% END %]?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>[% title FILTER xml %]</title>
  <link rel="alternate" type="text/html"
        href="[% urlbase FILTER html %]buglist.cgi?
        [%- urlquerypart.replace('ctype=atom[&]?','') FILTER xml %]"/>
  <link rel="self" type="application/atom+xml"
        href="[% urlbase FILTER html %]buglist.cgi?
        [%- urlquerypart FILTER xml %]"/>
  <updated>[% bugs.sort('changedtime').last.changedtime FILTER time("%Y-%m-%dT%H:%M:%SZ", "UTC")
    FILTER xml %]</updated>
  <id>[% urlbase FILTER html %]buglist.cgi?[% urlquerypart FILTER xml %]</id>

  [% FOREACH bug = bugs %]
  <entry>
    <title>[% "@" IF bug.secure_mode %][[% terms.Bug %] [%+ bug.bug_id FILTER xml %]] [% bug.short_desc FILTER xml %]</title>
    <link rel="alternate" type="text/html"
          href="[% urlbase FILTER html %]show_bug.cgi?id=
          [%- bug.bug_id FILTER xml %]"/>
    <id>[% urlbase FILTER xml %]show_bug.cgi?id=[% bug.bug_id FILTER xml %]</id>
    <author>
      <name>[% bug.reporter_realname ? bug.reporter_realname : bug.reporter FILTER xml %]</name>
    </author>
    <updated>[% bug.changedtime FILTER time("%Y-%m-%dT%H:%M:%SZ", "UTC") FILTER xml %]</updated>
    <summary type="html">
      [%# Filter out the entire block, so that we don't need to escape the html code out %]
      [% FILTER xml %]
      <table>
      <tr>
        <th>Field</th><th>Value</th>
      </tr><tr class="bz_feed_product">
        <td>[% COLUMNS.product.title FILTER html %]</td>
        <td>[% bug.product FILTER html %]</td>
      </tr><tr class="bz_feed_component">
        <td>[% COLUMNS.component.title FILTER html %]</td>
        <td>[% bug.component FILTER html %]</td>
      </tr><tr class="bz_feed_assignee">
        <td>[% COLUMNS.assigned_to_realname.title FILTER html %]</td>
        <td>[% bug.assigned_to_realname ? bug.assigned_to_realname : bug.assigned_to FILTER html %]</td>
      </tr><tr class="bz_feed_reporter">
        <td>[% COLUMNS.reporter_realname.title FILTER html %]</td>
        <td>[% bug.reporter_realname ? bug.reporter_realname : bug.reporter FILTER html %]</td>
      </tr><tr class="bz_feed_bug_status">
        <td>[% COLUMNS.bug_status.title FILTER html %]</td>
        <td>[% bug.bug_status FILTER html %]</td>
      </tr><tr class="bz_feed_resolution">
        <td>[% COLUMNS.resolution.title FILTER html %] </td>
        <td>[% bug.resolution FILTER html %]</td>
      </tr><tr class="bz_feed_priority">
        <td>[% COLUMNS.priority.title FILTER html %]</td>
        <td>[% bug.priority FILTER html %]</td>
      </tr><tr class="bz_feed_severity">
        <td>[% COLUMNS.bug_severity.title FILTER html %] </td>
        <td>[% bug.bug_severity FILTER html %]</td>
      [% IF Bugzilla.get_field('target_milestone').enabled %]
      </tr><tr class="bz_feed_target_milestone">
        <td>[% COLUMNS.target_milestone.title FILTER html %]</td>
        <td>[% bug.target_milestone FILTER html %]</td>
      [% END %]
      </tr><tr class="bz_feed_creation_date">
        <td>[% COLUMNS.creation_ts.title FILTER html %]</td>
        <td>[% bug.creation_ts FILTER html %]</td>
      </tr><tr class="bz_feed_changed_date">
        <td>[% COLUMNS.delta_ts.title FILTER html %]</td>
        <td>[% bug.delta_ts FILTER html -%]</td>
      </tr>
      </table>
      [% END %]
    </summary>
  </entry>
  [% END %]
</feed>
