From: Tim Düsterhus Date: Mon, 7 Jul 2014 17:52:05 +0000 (+0200) Subject: Show nice diff instead of unix diff in editHistory.tpl X-Git-Tag: 2.1.0_Alpha_1~590^2~5 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6dcf3602c0c04eb63ee4cf46d3482b9b5993d2f8;p=GitHub%2FWoltLab%2FWCF.git Show nice diff instead of unix diff in editHistory.tpl --- diff --git a/com.woltlab.wcf/templates/editHistory.tpl b/com.woltlab.wcf/templates/editHistory.tpl index d3c40fe44c..d14134a54d 100644 --- a/com.woltlab.wcf/templates/editHistory.tpl +++ b/com.woltlab.wcf/templates/editHistory.tpl @@ -16,7 +16,42 @@ {include file='userNotice'} -
{$diff}
+{if $diff} +
+{assign var='prevType' value=''} +{foreach from=$diff->getRawDiff() item='line'} +{if $line[0] !== $prevType} +
+ + {* unmodified, after deletion needs a "fake" insertion *} + {if $line[0] === ' ' && $prevType === '-'}
{/if} + + {* unmodified and deleted start a new container *} + {if $line[0] === ' ' || $line[0] === '-'}
{/if} + + {* adding, without deleting needs a "fake" deletion *} + {if $line[0] === '+' && $prevType !== '-'} + +
+
+
+ {/if} + + {if $line[0] === ' '} +
+ {/if} + {if $line[0] === '-'} +
+ {/if} +
+{/if} +{if $line[0] === ' '}{$line[1]}
{/if} +{if $line[0] === '-'}{$line[1]}
{/if} +{if $line[0] === '+'}{$line[1]}
{/if} +{assign var='prevType' value=$line[0]} +{/foreach} +
+{/if}
@@ -40,7 +75,7 @@ - + {event name='rowButtons'} {lang}wcf.edit.currentVersion{/lang}