<% if page_module.entity_id.blank? -%>
  <%= render partial: 'easy_page_modules/page_module_cannot_be_displayed', locals: { page_module: page_module } %>
<% else -%>
  <% project = @easy_page_modules_data[block_name][:project] %>

  <%= easy_journal_render_history(@easy_page_modules_data[block_name][:journals], {collapsible: false, entity: project}) -%>
  <% if User.current.allowed_to?(:edit_project_custom_fields, project) %>
    <p>
      <%= link_to(l(:button_update), edit_custom_fields_form_project_path(project), remote: true, class: 'button-positive') -%>
      <% if User.current.allowed_to?(:edit_project, project) && !(@easy_page_modules_data[block_name][:all_journals_shown]) %>
        <%= link_to(l(:label_my_page_journal_view_all_journals), settings_project_path(project, tab: 'history'), class: 'button-positive') -%>
      <% end %>
    </p>
  <% end %>

  <script type="text/javascript">
    $(document).ready(function() {
      EASY.journals.collapseUnnecessary();
    });
  </script>

<% end %>
