<% my_module ||= report_element.my_module %>
<% activities = ActivitiesService.my_module_activities(my_module).order(created_at: :desc) %>
<% if activities.present? %>
  <div class="report-element report-module-activity-element">
    <div class="report-element-header">
      <div class="activity-name">
        <%= t('projects.reports.elements.module_activity.name') %>
      </div>
    </div>
    <div class="report-element-body">
      <div class="activity-container">
        <ul class="no-style activity-list">
          <% activities.each do |activity| %>
            <li class="activity">
              <span class="activity-prefix">
                <%= l(activity.created_at, format: :full) %>
              </span>
              <span class="activity-message">
                &nbsp;
                <% if activity.old_activity?  %>
                  <%= activity.message %>
                <% else %>
                  <%= generate_activity_content(activity, no_links: true) %>
                <% end %>
              </span>
            </li>
          <% end %>
        </ul>
      </div>
    </div>
    <% if defined?(children) %>
      <div class="report-element-children">
        <%= children %>
      </div>
    <% end %>
  </div>
<% end %>
