<li>
  <p>
    {% set format_search_base_url = (
      h.url_for(controller="organization", action="read", id=change.org_id)
      if change.org_id else
      h.url_for(controller="dataset", action="search")) %}

    {% if change.method == "add" %}

      {{ _('Set format of resource {resource_link} to {format_link} in {pkg_link}').format(
        pkg_link = h.nav_link(change.title, named_route='dataset.read', id=change.pkg_id),
        resource_link = h.nav_link(
          change.resource_name, named_route='resource.read', id=change.pkg_id,
          resource_id=change.resource_id, qualified=True),
        format_link = h.link_to(change.format, format_search_base_url + "?res_format=" + change.format)
        ) }}

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

      {{ _('Set format of resource {resource_link} to {new_format_link} (previously {old_format_link}) in {pkg_link}').format(
        pkg_link = h.nav_link(change.title, named_route='dataset.read', id=change.pkg_id),
        resource_link = h.nav_link(
          change.resource_name, named_route='resource.read', id=change.pkg_id,
          resource_id=change.resource_id, qualified=True),
        old_format_link = h.link_to(change.old_format, format_search_base_url + "?res_format=" + change.old_format),
        new_format_link = h.link_to(change.new_format, format_search_base_url + "?res_format=" + change.new_format)
        ) }}

    {% else %}

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

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