diff options
Diffstat (limited to 'app/views/node_actions')
| -rw-r--r-- | app/views/node_actions/_change_details.html.erb | 30 | ||||
| -rw-r--r-- | app/views/node_actions/index.html.erb | 25 |
2 files changed, 30 insertions, 25 deletions
diff --git a/app/views/node_actions/_change_details.html.erb b/app/views/node_actions/_change_details.html.erb index 383f53a..2583e8b 100644 --- a/app/views/node_actions/_change_details.html.erb +++ b/app/views/node_actions/_change_details.html.erb | |||
| @@ -1,27 +1,27 @@ | |||
| 1 | <details class="node_action_details"> | 1 | <details class="node_action_details"> |
| 2 | <summary><%= t("node_actions.show_changes") %></summary> | 2 | <summary><%= t("node_actions.show_changes") %></summary> |
| 3 | <table> | 3 | <table> |
| 4 | <% action_entry.metadata["translation_diff"].each do |locale, diff| %> | 4 | <% if (default_items = default_locale_changes(action_entry)).any? %> |
| 5 | <tr> | ||
| 6 | <th><%= I18n.default_locale.to_s.upcase %></th> | ||
| 7 | <td> | ||
| 8 | <%= safe_join(default_items, ", ") %> | ||
| 9 | <% if action_entry.page && action_entry.node %> | ||
| 10 | <%= link_to t("node_actions.view_revision"), node_revision_path(action_entry.node, action_entry.page) %> | ||
| 11 | <% end %> | ||
| 12 | </td> | ||
| 13 | </tr> | ||
| 14 | <% end %> | ||
| 15 | <% (action_entry.metadata["translation_diff"] || {}).each do |locale, diff| %> | ||
| 5 | <tr> | 16 | <tr> |
| 6 | <th><%= locale.upcase %></th> | 17 | <th><%= locale.upcase %></th> |
| 7 | <td> | 18 | <td> |
| 8 | <% case diff["status"] %> | 19 | <%= safe_join(translation_changes(diff), ", ") %> |
| 9 | <% when "added" %> | 20 | <% if action_entry.page && action_entry.node %> |
| 10 | <%= t("node_actions.locale_added", :title => diff.dig("title", "to")) %> | 21 | <%= link_to t("node_actions.view_revision"), node_revision_path(action_entry.node, action_entry.page, :locale => locale) %> |
| 11 | <% when "removed" %> | ||
| 12 | <%= t("node_actions.locale_removed", :title => diff.dig("title", "from")) %> | ||
| 13 | <% else %> | ||
| 14 | <% if diff["title"] %> | ||
| 15 | <%= diff.dig("title", "from") %> → <%= diff.dig("title", "to") %> | ||
| 16 | <% end %> | ||
| 17 | <%= t("node_actions.abstract_changed") if diff["abstract_changed"] %> | ||
| 18 | <%= t("node_actions.body_changed") if diff["body_changed"] %> | ||
| 19 | <% end %> | 22 | <% end %> |
| 20 | </td> | 23 | </td> |
| 21 | </tr> | 24 | </tr> |
| 22 | <% end %> | 25 | <% end %> |
| 23 | </table> | 26 | </table> |
| 24 | <% if action_entry.page && action_entry.node %> | ||
| 25 | <%= link_to t("node_actions.view_revision"), node_revision_path(action_entry.node, action_entry.page) %> | ||
| 26 | <% end %> | ||
| 27 | </details> | 27 | </details> |
diff --git a/app/views/node_actions/index.html.erb b/app/views/node_actions/index.html.erb index 92740cd..ee06213 100644 --- a/app/views/node_actions/index.html.erb +++ b/app/views/node_actions/index.html.erb | |||
| @@ -6,17 +6,22 @@ | |||
| 6 | 6 | ||
| 7 | <%= will_paginate @actions %> | 7 | <%= will_paginate @actions %> |
| 8 | 8 | ||
| 9 | <ul id="node_action_list"> | 9 | <table id="node_action_list"> |
| 10 | <% @actions.each do |action| %> | 10 | <% @actions.each do |action| %> |
| 11 | <li class="node_action node_action--<%= action.action %>"> | 11 | <tr class="node_action node_action--<%= action.action %>"> |
| 12 | <span class="node_action_time"><%= l(action.occurred_at, :format => :ccc) %></span> | 12 | <td class="node_action_time"><%= action.occurred_at.strftime("%Y-%m-%d %H:%M") %></td> |
| 13 | <% if action.inferred_from %> | 13 | <td class="node_action_body"> |
| 14 | <span class="node_action_inferred" title="<%= action.inferred_from %>"><%= t("node_actions.backfilled") %></span> | 14 | <%= action_summary(action) %> |
| 15 | <% end %> | 15 | <% if action.node_id && params[:node_id].blank? %> |
| 16 | <span class="node_action_summary"><%= action_summary(action) %></span> | 16 | <%= link_to t("node_actions.node_history"), admin_log_path(:node_id => action.node_id), :class => "node_action_zoom" %> |
| 17 | <%= render "change_details", :action_entry => action if action.metadata["translation_diff"].present? %> | 17 | <% end %> |
| 18 | </li> | 18 | <% if action.inferred_from %> |
| 19 | <span class="node_action_inferred" title="<%= action.inferred_from %>"><%= t("node_actions.backfilled") %></span> | ||
| 20 | <% end %> | ||
| 21 | <%= render "change_details", :action_entry => action if action_details?(action) %> | ||
| 22 | </td> | ||
| 23 | </tr> | ||
| 19 | <% end %> | 24 | <% end %> |
| 20 | </ul> | 25 | </table> |
| 21 | 26 | ||
| 22 | <%= will_paginate @actions %> | 27 | <%= will_paginate @actions %> |
