<li>
  <p>
    {% if change.method == "remove_one" %}

      {{ _('Removed tag {tag_link} from {pkg_link}').format(
        tag_link = '<a href="{tag_url}">{tag}</a>'.format(
          tag_url = h.url_for(controller='dataset', action='search') +
          "?tags=" + change.tag,
          tag = change.tag
        )|safe,
        pkg_link = h.nav_link(change.title, named_route='dataset.read', id=change.pkg_id),
        ) }}

    {% elif change.method == "remove_multiple" %}

      {{ _('Removed the following tags from {pkg_link}').format(
        pkg_link = h.nav_link(change.title, named_route='dataset.read', id=change.pkg_id),
        )|safe }}

      <ul>
        {% for item in change.tags %}
          <li>
            {{ _('{tag_link}').format(
              tag_link = h.nav_link(item, named_route='dataset.search', tags=item),
              )}}
          </li>
        {% endfor %}
      </ul>

    {% elif change.method == "add_one" %}

      {{ _('Added tag {tag_link} to {pkg_link}').format(
        tag_link = h.nav_link(change.tag, named_route='dataset.search', tags=change.tag),
        pkg_link = h.nav_link(change.title, named_route='dataset.read', id=change.pkg_id),
        ) }}

    {% elif change.method == "add_multiple" %}

      {{ _('Added the following tags to {pkg_link}').format(
        pkg_link = h.nav_link(change.title, named_route='dataset.read', id=change.pkg_id),
        ) }}
      <ul>
        {% for item in change.tags %}
          <li>
            {# TODO: figure out which controller to actually use here #}
            {{ _('{tag_link}').format(
              tag_link = h.nav_link(item, named_route='dataset.search', tags=item),
              )}}
          </li>
        {% endfor %}
      </ul>

    {% else %}

      {{ _('No fields were updated. See the metadata diff for more details.') }}

    {% endif %}
  </p>
</li>
