-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEPENDENCY: Switch template format from haml to erb for increased com…
…patibility with non-erb apps.
- Loading branch information
Showing
10 changed files
with
90 additions
and
77 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<tr class='change_row <%= "#{version.event}, #{version.item_type.downcase}" %>'> | ||
<td class='change_time'> | ||
<span class='change_id'>Change #<%= version.id %></span> | ||
<div class='date'> <%= version.created_at.strftime('%Y-%m-%d') %> </div> | ||
<div class='time'> <%= version.created_at.strftime('%H:%M:%S') %> </div> | ||
</td> | ||
<td class='change_details'> | ||
<p class='change_details_description'> | ||
<strong class='event'><%= version.event %></strong> | ||
<span class='item_type'><%= version.item_type %></span> | ||
<span class='item_id'><%= version.item_id %></span> | ||
<%= change_item_link(version) %> | ||
<% if PaperTrailManager.whodunnit_class && version.whodunnit %> | ||
<% if user = PaperTrailManager.whodunnit_class.find(version.whodunnit) rescue nil %> | ||
by <%= link_to(h(user.send(PaperTrailManager.whodunnit_name_method)), user_path(user)) %> | ||
<% end %> | ||
<% end %> | ||
<% if change_revert_allowed?(version) %> | ||
<%= link_to 'Roll back', change_path(version), :method => 'put', :confirm => 'Are you sure?', :class => 'rollback' %> | ||
<% end %> | ||
</p> | ||
<% if version.event == 'update' or version.event == 'create' %> | ||
<% changes = changes_for(version) %> | ||
<table class='change_details_table'> | ||
<% changes.keys.sort.each_with_index do |key, i| %> | ||
<tr class='<%= i%2==0 ? 'even' : 'odd' %>'> | ||
<td class='change_detail_key previous'><%= key %></td> | ||
<td class='change_detail_value previous'><%= text_or_nil(changes[key][:previous]) %></td> | ||
<td class='change_detail_spacer'> → </td> | ||
<td class='change_detail_value current'><%= text_or_nil(changes[key][:current]) %></td> | ||
</tr> | ||
<% end %> | ||
</table> | ||
<% end %> | ||
</td> | ||
</tr> |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<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'> | ||
<%= will_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'> — No changes found — </td> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
|
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<h1>Change <%= @version.id %></h1> | ||
|
||
<table class='changes_table'> | ||
<tr class='changes_header'> | ||
<th class='change_time'>Time</th> | ||
<th class='change_details'>Attribute with previous and current values</th> | ||
<%= render :partial => 'version', :object => @version %> | ||
</tr> | ||
</table> | ||
|
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ Gem::Specification.new do |s| | |
|
||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= | ||
s.authors = ["Igal Koshevoy"] | ||
s.date = %q{2011-07-13} | ||
s.date = %q{2011-07-18} | ||
s.description = %q{A user interface for `paper_trail` versioning data in Ruby on Rails 3 applications.} | ||
s.email = %q{[email protected]} | ||
s.extra_rdoc_files = [ | ||
|
@@ -25,10 +25,10 @@ Gem::Specification.new do |s| | |
"VERSION", | ||
"app/controllers/paper_trail_manager/changes_controller.rb", | ||
"app/helpers/paper_trail_manager/changes_helper.rb", | ||
"app/views/paper_trail_manager/changes/_version.html.haml", | ||
"app/views/paper_trail_manager/changes/_version.html.erb", | ||
"app/views/paper_trail_manager/changes/index.atom.builder", | ||
"app/views/paper_trail_manager/changes/index.html.haml", | ||
"app/views/paper_trail_manager/changes/show.html.haml", | ||
"app/views/paper_trail_manager/changes/index.html.erb", | ||
"app/views/paper_trail_manager/changes/show.html.erb", | ||
"lib/paper_trail_manager.rb", | ||
"paper_trail_manager.gemspec", | ||
"spec/controllers/paper_trail_manager/changes_controller_spec.rb", | ||
|
@@ -108,7 +108,7 @@ Gem::Specification.new do |s| | |
] | ||
s.homepage = %q{http://github.com/igal/paper_trail_manager} | ||
s.require_paths = ["lib"] | ||
s.rubygems_version = %q{1.6.2} | ||
s.rubygems_version = %q{1.3.7} | ||
s.summary = %q{A user interface for `paper_trail` versioning data in Ruby on Rails 3 applications.} | ||
s.test_files = [ | ||
"spec/controllers/paper_trail_manager/changes_controller_spec.rb", | ||
|
@@ -162,11 +162,11 @@ Gem::Specification.new do |s| | |
] | ||
|
||
if s.respond_to? :specification_version then | ||
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION | ||
s.specification_version = 3 | ||
|
||
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then | ||
s.add_runtime_dependency(%q<rails>, ["~> 3.0"]) | ||
s.add_runtime_dependency(%q<haml>, ["~> 3.0"]) | ||
s.add_runtime_dependency(%q<paper_trail>, ["~> 2.0"]) | ||
s.add_runtime_dependency(%q<will_paginate>, ["~> 3.0.pre2"]) | ||
s.add_development_dependency(%q<capybara>, [">= 0.4.0"]) | ||
|
@@ -179,7 +179,6 @@ Gem::Specification.new do |s| | |
s.add_development_dependency(%q<sqlite3-ruby>, [">= 0"]) | ||
else | ||
s.add_dependency(%q<rails>, ["~> 3.0"]) | ||
s.add_dependency(%q<haml>, ["~> 3.0"]) | ||
s.add_dependency(%q<paper_trail>, ["~> 2.0"]) | ||
s.add_dependency(%q<will_paginate>, ["~> 3.0.pre2"]) | ||
s.add_dependency(%q<capybara>, [">= 0.4.0"]) | ||
|
@@ -193,7 +192,6 @@ Gem::Specification.new do |s| | |
end | ||
else | ||
s.add_dependency(%q<rails>, ["~> 3.0"]) | ||
s.add_dependency(%q<haml>, ["~> 3.0"]) | ||
s.add_dependency(%q<paper_trail>, ["~> 2.0"]) | ||
s.add_dependency(%q<will_paginate>, ["~> 3.0.pre2"]) | ||
s.add_dependency(%q<capybara>, [">= 0.4.0"]) | ||
|