Skip to content

Commit

Permalink
Merge pull request #32 from alexanderkustov/master
Browse files Browse the repository at this point in the history
Allow Rails 5 and current paper_trail version
  • Loading branch information
fusion94 authored Oct 11, 2024
2 parents 7bb97d0 + 6169a6a commit c5c7282
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 30 deletions.
53 changes: 26 additions & 27 deletions app/views/paper_trail_manager/changes/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
<h1>Changes</h1>

<p class='changes_feed'><%= link_to 'Changes feed', changes_path(:format => 'atom') %></p>

<p>
Show:
<%= ([link_to('All', changes_path)] + change_item_types.map { |type| link_to(type.pluralize, changes_path(:type => type)) }).join(' | ').html_safe %>
</p>

<table class='changes_table'>
<tfoot>
<tr>
<td colspan='2'>
<%= paginate @versions %>
</td>
</tr>
</tfoot>
<thead>
<tr class='changes_header'>
<th class='change_time'>Time</th>
<th class='change_details'>Attribute with previous and current values</th>
</tr>
</thead>
<tbody>
<% if @versions.any? %>
<% @versions.each do |version| %>
<% next unless change_show_allowed?(version) %>
<%= render :partial => 'version', :object => version %>
<div class="table-responsive">
<table class='changes_table table table-bordered'>
<tfoot>
<tr>
<td colspan='2'>
<%= paginate @versions %>
</td>
</tr>
</tfoot>
<thead>
<tr class='changes_header'>
<th class='change_time'>Time</th>
<th class='change_details'>Attribute with previous and current values</th>
</tr>
</thead>
<tbody>
<% if @versions.any? %>
<% @versions.each do |version| %>
<% next unless change_show_allowed?(version) %>
<%= render :partial => 'version', :object => version %>
<% end %>
<% else %>
<td rowspan='2'> &mdash; No changes found &mdash; </td>
<% end %>
<% else %>
<td rowspan='2'> &mdash; No changes found &mdash; </td>
<% end %>
</tbody>
</table>
</tbody>
</table>
</div>

3 changes: 0 additions & 3 deletions paper_trail_manager.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@ Gem::Specification.new do |spec|
spec.description = 'Browse, subscribe, view and revert changes to records when using Rails and the `paper_trail` gem.'
spec.homepage = 'https://github.com/fusion94/paper_trail_manager'
spec.license = 'MIT'

spec.files = `git ls-files -z`.split("\x0")
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']

spec.add_dependency 'paper_trail', ['>= 3.0']
spec.add_dependency 'rails', ['>= 3.0', '< 7.0']

spec.add_development_dependency 'appraisal', '~> 1.0'
spec.add_development_dependency 'factory_girl_rails', '~> 4.0'
spec.add_development_dependency 'rake', '~> 10.4'
Expand Down

0 comments on commit c5c7282

Please sign in to comment.