<li>
  <p>
    {% set format_search_base_url = (
      h.url_for("organization.read", id=change.org_id)
      if change.org_id else
      h.url_for("dataset.search")) %}
    {% set resource_url = (h.url_for(
     "resource.read", 
      id=change.pkg_id, 
      resource_id=change.resource_id, 
      qualified=True)) %}

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

      {{ _('Set format of resource') }}
      <a href="{{resource_url}}">
        {{change.resource_name}}
      </a>
      
      {{ _('to') }}
      <a href="{{format_search_base_url + '?res_format=' + change.format}}">
       {{change.format}}
      </a>

      {{ _('in') }}
      <a href="{{ h.url_for('dataset.read', id=change.pkg_id) }}">
        {{change.title}}
      </a>

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

      {{ _('Set format of resource') }}
      <a href="{{resource_url}}">
        {{change.resource_name}}
      </a>

      {{ _('to') }}
      <a href="{{format_search_base_url + '?res_format=' + change.new_format}}">
        {{change.new_format}}
      </a>

      {{ _('(previously') }}
      <a href="{{format_search_base_url + '?res_format=' + change.old_format}}">
        {{change.old_format}}
      </a>
      {{ _(')') }}

    {% else %}

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

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