Last active
August 29, 2015 14:04
-
-
Save leompeters/10afbd987bd712cd14db to your computer and use it in GitHub Desktop.
List widget versions provided by Paper Trail.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
-- Licensed under the MIT license [http://www.opensource.org/licenses/mit-license.php] | |
-- Copyright (c) 2013 by Belanton, Inc. All Rights Reserved. | |
--> | |
<html> | |
<head> | |
<title>Belanton | Codes | Scripts | Paper Trail Versions</title> | |
<meta name="description" content="https://gist.github.com/leonardomarques/10afbd987bd712cd14db"> | |
<meta name="keywords" content="Belanton,team,web,development,Ruby,Rails,ERB,HTML,paper,trail,versions"> | |
<meta name="author" content="Leonardo Marques - Belanton Team [http://www.belanton.com]"> | |
</head> | |
<body> | |
<ul> | |
<% @versions.each do |version| %> | |
<li> | |
<%= l version.created_at, format: "%-d.%m.%Y %H:%M:%S %Z" %><br/> | |
Event ID: <%= version.id %><br/> | |
<b>Target:</b> <%= version.item_type %> | |
<small>(id: <%= version.item_id %>)</small>; <b>action</b> <%= version.event %>;<br/> | |
<div> | |
More info: | |
<pre><%= version.object %></pre> | |
</div> | |
<div> | |
Changeset: | |
<pre><%= version.changeset %></pre> | |
</div> | |
<b>User:</b> | |
<% if version.whodunnit && version.whodunnit != 'Guest' %> | |
<% user = Profiles::User.find_by_id(version.whodunnit) %> | |
<% if user %> | |
<%= user.email_address %> | |
<% end %> | |
<% else %> | |
Guest | |
<% end %> | |
<b>Remote address:</b> <%= version.ip %><br/> | |
</li> | |
<% end %> | |
</ul> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment