summaryrefslogtreecommitdiff
path: root/app/views/node_actions/_change_details.html.erb
blob: 98e70d8f085603abbf5ee879f0922cb0486d5030 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<details class="node_action_details">
  <summary><%= t("node_actions.show_changes") %></summary>
  <table>
    <% if (default_items = default_locale_changes(action_entry)).any? %>
      <tr>
        <th><%= I18n.default_locale.to_s.upcase %></th>
        <td>
          <%= safe_join(default_items, tag.br) %>
          <br/>
          <% if action_entry.page && action_entry.node %>
            <% if (diff_params = action_entry.diff_link_params) %>
              <%= link_to t("node_actions.view_diff"), diff_node_revisions_path(action_entry.node, diff_params) %>
            <% else %>
              <%= link_to t("node_actions.view_revision"), node_revision_path(action_entry.node, action_entry.page) %>
            <% end %>
          <% end %>
        </td>
      </tr>
    <% end %>
    <% if (event_items = event_changes_list(action_entry)).any? %>
      <tr>
        <th></th>
        <td><%= safe_join(event_items, tag.br) %></td>
      </tr>
    <% end %>
    <% (action_entry.metadata["translation_diff"] || {}).each do |locale, diff| %>
      <tr>
        <th><%= locale.upcase %></th>
        <td>
          <%= safe_join(translation_changes(diff), tag.br) %>
          <br/>
          <% if action_entry.page && action_entry.node %>
            <% if (diff_params = action_entry.diff_link_params) %>
              <%= link_to t("node_actions.view_diff"), diff_node_revisions_path(action_entry.node, diff_params.merge(:translation_locale => locale)) %>
            <% else %>
              <%= link_to t("node_actions.view_revision"), node_revision_path(action_entry.node, action_entry.page, :translation_locale => locale) %>
            <% end %>
          <% end %>
        </td>
      </tr>
    <% end %>
  </table>
</details>