# encoding: utf-8 #-- # Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) # Copyright (C) 2008 Johan Sørensen # Copyright (C) 2008 Tor Arne Vestbø # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . #++ module Gitorious module Diff class SidebysideTableCallback < BaseCallback # Before blocks def before_addblock(block) %q{} end def before_remblock(block) %Q{} end def before_modblock(block) %Q{} end def before_unmodblock(block) %Q{} end def before_sepblock(block) %Q{} end # After blocks def after_addblock(block) "" end def after_remblock(block) "" end def after_modblock(block) "" end def after_unmodblock(block) "" end def after_sepblock(block) "" end # Before lines def addline(line) # adds go on the right %Q{#{line.old_number}} + %Q{} + %Q{#{line.new_number}} + %Q{#{render_line(line)}} end def remline(line) # rems go on the left (hide the right side) %Q{#{line.old_number}} + %Q{#{render_line(line)}} + %Q{#{line.new_number}} + %Q{#{render_line(line)}} end def modline(line) # TODO: figure how we best display these # %Q{#{line.old_number}} + # %Q{#{render_line(line)}} + # %Q{#{line.new_number}} + # %Q{#{render_line(line)}} end def unmodline(line) # unmods goes on both sides %Q{#{line.old_number}} + %Q{#{render_line(line)}} + %Q{#{line.new_number}} + %Q{#{render_line(line)}} end def sepline(line) %Q{…} + %Q{} + %Q{…} + %Q{} end def nonewlineline(line) %Q{…} + %Q{} + %Q{…} + %Q{#{line}} end end end end