| 1 | {capture assign='pageTitle'}{$object->getTitle()} - {lang}wcf.edit.versions{/lang}{/capture} |
| 2 | |
| 3 | {capture assign='contentTitle'}{lang}wcf.edit.versions{/lang}: {$object->getTitle()}{/capture} |
| 4 | |
| 5 | {capture assign='contentHeaderNavigation'}<li><a href="{$object->getLink()}" class="button"><span class="icon icon16 fa-arrow-right"></span> <span>{lang}wcf.edit.button.goToContent{/lang}</span></a></li>{/capture} |
| 6 | |
| 7 | {include file='header'} |
| 8 | |
| 9 | {if $diff} |
| 10 | <div class="section editHistoryDiff"> |
| 11 | <div class="sideBySide"> |
| 12 | <div class="containerHeadline"> |
| 13 | <h3>{lang}wcf.edit.headline.old{/lang}</h3> |
| 14 | </div> |
| 15 | <div class="containerHeadline"> |
| 16 | <h3>{lang}wcf.edit.headline.new{/lang}</h3> |
| 17 | </div> |
| 18 | </div> |
| 19 | |
| 20 | <div><div> |
| 21 | {assign var='prevType' value=''} |
| 22 | {foreach from=$diff->getRawDiff() item='line'} |
| 23 | {if $line[0] !== $prevType} |
| 24 | </div> |
| 25 | |
| 26 | {* unmodified, after deletion needs a "fake" insertion *} |
| 27 | {if $line[0] === ' ' && $prevType === '-'}<div></div>{/if} |
| 28 | |
| 29 | {* unmodified and deleted start a new container *} |
| 30 | {if $line[0] === ' ' || $line[0] === '-'}</div>{/if} |
| 31 | |
| 32 | {* adding, without deleting needs a "fake" deletion *} |
| 33 | {if $line[0] === '+' && $prevType !== '-'} |
| 34 | </div> |
| 35 | <div class="sideBySide"> |
| 36 | <div></div> |
| 37 | {/if} |
| 38 | |
| 39 | {if $line[0] === ' '} |
| 40 | <div> |
| 41 | {/if} |
| 42 | {if $line[0] === '-'} |
| 43 | <div class="sideBySide"> |
| 44 | {/if} |
| 45 | <div{if $line[0] === '+'} style="color: green;"{elseif $line[0] === '-'} style="color: red;"{/if}> |
| 46 | {/if} |
| 47 | {if $line[0] === ' '}{$line[1]}<br />{/if} |
| 48 | {if $line[0] === '-'}{$line[1]}<br />{/if} |
| 49 | {if $line[0] === '+'}{$line[1]}<br />{/if} |
| 50 | {assign var='prevType' value=$line[0]} |
| 51 | {/foreach} |
| 52 | </div></div> |
| 53 | </div> |
| 54 | {/if} |
| 55 | |
| 56 | <form action="{link controller='EditHistory'}{/link}" method="post"> |
| 57 | <section class="section tabularBox editHistoryVersionList"> |
| 58 | {assign var='versionCount' value=$objects|count} |
| 59 | <h2 class="sectionTitle"> |
| 60 | {lang}wcf.edit.versions{/lang} <span class="badge">{#$versionCount+1}</span> |
| 61 | </h2> |
| 62 | |
| 63 | <table class="table"> |
| 64 | <thead> |
| 65 | <tr> |
| 66 | <th class="columnID columnEditID" colspan="2">{lang}wcf.edit.version{/lang}</th> |
| 67 | <th class="columnText columnUser">{lang}wcf.user.username{/lang}</th> |
| 68 | <th class="columnText columnEditReason">{lang}wcf.edit.reason{/lang}</th> |
| 69 | <th class="columnDate columnTime">{lang}wcf.edit.time{/lang}</th> |
| 70 | |
| 71 | {event name='columnHeads'} |
| 72 | </tr> |
| 73 | </thead> |
| 74 | |
| 75 | <tbody> |
| 76 | <tr> |
| 77 | <td class="columnIcon"> |
| 78 | <span class="icon icon16 fa-undo disabled"></span> |
| 79 | <input type="radio" name="oldID" value="current"{if $oldID === 'current'} checked="checked"{/if} /> <input type="radio" name="newID" value="current"{if $newID === 'current'} checked="checked"{/if} /> |
| 80 | {event name='rowButtons'} |
| 81 | </td> |
| 82 | <td class="columnID"><strong>{lang}wcf.edit.currentVersion{/lang}</strong></td> |
| 83 | <td class="columnText columnUser"><a href="{link controller='User' id=$object->getUserID() title=$object->getUsername()}{/link}">{$object->getUsername()}</a></td> |
| 84 | <td class="columnText columnEditReason">{$object->getEditReason()}</td> |
| 85 | <td class="columnDate columnTime">{@$object->getTime()|time}</td> |
| 86 | |
| 87 | {event name='columns'} |
| 88 | </tr> |
| 89 | {foreach from=$objects item=edit name=edit} |
| 90 | <tr class="jsEditRow"> |
| 91 | <td class="columnIcon"> |
| 92 | <span class="icon icon16 fa-undo pointer jsRevertButton jsTooltip" title="{lang}wcf.edit.revert{/lang}" data-object-id="{@$edit->entryID}" data-confirm-message="{lang}wcf.edit.revert.sure{/lang}"></span> |
| 93 | <input type="radio" name="oldID" value="{@$edit->entryID}"{if $oldID == $edit->entryID} checked="checked"{/if} /> <input type="radio" name="newID" value="{@$edit->entryID}"{if $newID == $edit->entryID} checked="checked"{/if} /> |
| 94 | {event name='rowButtons'} |
| 95 | </td> |
| 96 | <td class="columnID">{#($tpl[foreach][edit][total] - $tpl[foreach][edit][iteration] + 1)}</td> |
| 97 | <td class="columnText columnUser"><a href="{link controller='User' id=$edit->userID title=$edit->username}{/link}">{$edit->username}</a></td> |
| 98 | <td class="columnText columnEditReason">{$edit->editReason}</td> |
| 99 | <td class="columnDate columnTime">{@$edit->time|time}</td> |
| 100 | |
| 101 | {event name='columns'} |
| 102 | </tr> |
| 103 | {/foreach} |
| 104 | </tbody> |
| 105 | <script data-relocate="true"> |
| 106 | //<![CDATA[ |
| 107 | $(function () { |
| 108 | new WCF.Message.EditHistory($('input[name=oldID]'), $('input[name=newID]'), '.jsEditRow'); |
| 109 | }); |
| 110 | //]]> |
| 111 | </script> |
| 112 | </table> |
| 113 | </section> |
| 114 | |
| 115 | <div class="formSubmit"> |
| 116 | {@SID_INPUT_TAG} |
| 117 | <input type="hidden" name="objectID" value="{$objectID}" /> |
| 118 | <input type="hidden" name="objectType" value="{$objectType->objectType}" /> |
| 119 | <button class="button buttonPrimary" data-type="submit">{lang}wcf.edit.button.compare{/lang}</button> |
| 120 | </div> |
| 121 | </form> |
| 122 | |
| 123 | {include file='footer'} |