Sha256: 53f6ca654bc4819b70ee3eaa323fe91580dbcd68b7807ec85bde1ca60e10f182

Contents?: true

Size: 1.28 KB

Versions: 3

Compression:

Stored size: 1.28 KB

Contents

- if false # disable user log due to performance issues
  - unless params[:action] === 'new'
    main.content#user_log_section
      h2 User Log
      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, t('fae.application.user_absent'))
                  td = changed.join(', ')

          - else
            tr
              td colspan="3" = t('fae.application.no_logs')

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fae-rails-3.0.0 app/views/fae/application/_user_log.html.slim
fae-rails-2.2.0 app/views/fae/application/_user_log.html.slim
fae-rails-2.1.0 app/views/fae/application/_user_log.html.slim