-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add alternate comparison types to versions
- The types are: -- Previous: The default and the previously used type -- Subsequent: Compares against the next version -- Current: Compares against the current version - Allow switching between comparison types in index and diff views -- Have links vary depending upon current comparison type
- Loading branch information
1 parent
a95e57d
commit e23ee17
Showing
41 changed files
with
487 additions
and
220 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
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
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 @@ | ||
module ArtistCommentaryVersionsHelper | ||
def commentary_version_field_diff(commentary_version, type, field) | ||
other = commentary_version.send(params[:type]) | ||
if type == "previous" | ||
diff_body_html(commentary_version, other, field) | ||
else | ||
diff_body_html(other, commentary_version, field) | ||
end | ||
end | ||
end |
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 |
---|---|---|
@@ -1,23 +1,36 @@ | ||
module NoteVersionsHelper | ||
def note_version_position_diff(note_version) | ||
previous = note_version.previous | ||
def note_version_position_diff(note_version, type) | ||
other = note_version.send(type) | ||
|
||
html = "#{note_version.x},#{note_version.y}" | ||
if previous.nil? || (note_version.x == previous.x && note_version.y == previous.y) | ||
if other.nil? || (note_version.x == other.x && note_version.y == other.y) | ||
html | ||
elsif type == "previous" | ||
"#{other.x},#{other.y} -> " + html | ||
else | ||
"#{previous.x},#{previous.y} -> " + html | ||
html + " -> #{other.x},#{other.y}" | ||
end | ||
end | ||
|
||
def note_version_size_diff(note_version) | ||
previous = note_version.previous | ||
def note_version_size_diff(note_version, type) | ||
other = note_version.send(type) | ||
|
||
html = "#{note_version.width}x#{note_version.height}" | ||
if previous.nil? || (note_version.width == previous.width && note_version.height == previous.height) | ||
if other.nil? || (note_version.width == other.width && note_version.height == other.height) | ||
html | ||
elsif type == "previous" | ||
"#{other.width}x#{other.height} -> " + html | ||
else | ||
"#{previous.width}x#{previous.height} -> " + html | ||
html + " -> #{other.width}x#{other.height}" | ||
end | ||
end | ||
|
||
def note_version_body_diff(note_version, type) | ||
other = note_version.send(params[:type]) | ||
if type == "previous" | ||
diff_body_html(note_version, other, :body) | ||
else | ||
diff_body_html(other, note_version, :body) | ||
end | ||
end | ||
end |
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
Oops, something went wrong.