Sha256: 893ed40ea2d75cd446475fecc66fa37a1dc3312fec121f2933375e3b7888c4d6

Contents?: true

Size: 1.39 KB

Versions: 4

Compression:

Stored size: 1.39 KB

Contents

- if false # disable user log due to performance issues
  - unless params[:action] === 'new'
    section#user_log_section.main_content-section
      h2.main_content-section-title User Log

      .main_content-section-area
        table
          thead
            tr
              th Session
              th User
              th Modified
          tbody
            - if item.versions.present?

              - compared_attributes = item.attributes
              - item.versions.reverse.each do |version|
                ruby:
                  changed = []
                  if version.event === 'create'
                    changed << "created"
                  else
                    excluded = ['updated_at']
                    compared_attributes.each do |attribute, value|
                      changed.push(attribute) unless excluded.include?(attribute) || value.to_s == PaperTrail.serializer.load(version.object)[attribute].to_s
                    end
                    compared_attributes = PaperTrail.serializer.load(version.object)
                  end

                - if changed.present?
                  tr
                    td = version.created_at
                    td = version.user.present? ? version.user.full_name : content_tag(:em, "user no longer exists")
                    td = changed.join(', ')

            - else
              tr
                td colspan="3" No logs available.

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fae-rails-1.2.5 app/views/fae/application/_user_log.html.slim
fae-rails-1.2.4 app/views/fae/application/_user_log.html.slim
fae-rails-1.2.3 app/views/fae/application/_user_log.html.slim
fae-rails-1.2.2 app/views/fae/application/_user_log.html.slim