[%- PROCESS 'edit/details/macros.tt' -%]

<table class="details edit-work">
  <tr>
    <th>[% l('Work:') %]</th>
    <td colspan="2">
      [% descriptive_link(edit.display_data.work) %]
    </td>
  </tr>

  [%- display_word_diff(l('Name:'),
                        html_escape(edit.display_data.name.old),
                        html_escape(edit.display_data.name.new)) -%]

  [%- display_word_diff(l('Disambiguation:'),
                        html_escape(edit.display_data.comment.old),
                        html_escape(edit.display_data.comment.new)) -%]

  [%- display_diff(l('ISWC:'),
                   html_escape(edit.display_data.iswc.old),
                   html_escape(edit.display_data.iswc.new)) -%]

  [%- display_full_change(l('Work type:'),
                          html_escape(edit.display_data.type.old.name),
                          html_escape(edit.display_data.type.new.name)) -%]

  [%- display_full_change(l('Language:'),
                          html_escape(edit.display_data.language.old.name),
                          html_escape(edit.display_data.language.new.name)) -%]

  [% IF edit.data.new.attributes ~%]
  [% FOR type=edit.display_data.attributes ~%]
  <tr>
    <th>[% add_colon(type.key) %]</th>
    <td class="old">
    [%- IF type.value.old.size %]
      <ul>
      [%- FOR value=type.value.old %]
        <li>
          [%~ Diff.diff_side(value, type.value.new.${loop.index} || '', '-', '\s+') ~%]
        </li>
      [%- END %]
      </ul>
    [%- END %]
    </td>
    <td class="new">
    [%- IF type.value.new.size %]
      <ul>
      [%- FOR value=type.value.new %]
        <li>
          [%~ Diff.diff_side(type.value.old.${loop.index} || '', value, '+', '\s+') ~%]
        </li>
      [%- END %]
      </ul>
    [%- END %]
    </td>
  </tr>
  [%~ END %]
  [%~ END %]
</table>
