{* * commit.tpl * gitphp: A PHP git repository browser * Component: Commit view template * * Copyright (C) 2009 Christopher Han *} {include file='header.tpl'} {if $commit->GetParent()} {include file='title.tpl' titlecommit=$commit target='commitdiff'} {else} {include file='title.tpl' titlecommit=$commit titletree=$tree target='tree'} {/if}
{* Commit data *} {else} ({$commit->GetAuthorLocalEpoch()|date_format:"%R"} {$commit->GetAuthorTimezone()}) {/if} {foreach from=$commit->GetParents() item=par} {/foreach}
{t}author{/t} {$commit->GetAuthorName()}
{$commit->GetAuthorEpoch()|date_format:"%a, %d %b %Y %H:%M:%S %z"} {assign var=hourlocal value=$commit->GetAuthorLocalEpoch()|date_format:"%H"} {if $hourlocal < 6} ({$commit->GetAuthorLocalEpoch()|date_format:"%R"} {$commit->GetAuthorTimezone()})
{t}committer{/t} {$commit->GetCommitterName()}
{$commit->GetCommitterEpoch()|date_format:"%a, %d %b %Y %H:%M:%S %z"} ({$commit->GetCommitterLocalEpoch()|date_format:"%R"} {$commit->GetCommitterTimezone()})
{t}commit{/t} {$commit->GetHash()}
{t}tree{/t} {$tree->GetHash()}
{t}parent{/t} {$par->GetHash()}
{assign var=bugpattern value=$project->GetBugPattern()} {assign var=bugurl value=$project->GetBugUrl()} {foreach from=$commit->GetComment() item=line} {$line|htmlspecialchars|buglink:$bugpattern:$bugurl}
{/foreach}
{if $treediff->Count() > 10} {t count=$treediff->Count() 1=$treediff->Count() plural="%1 files changed:"}%1 file changed:{/t} {/if}
{* Loop and show files changed *} {foreach from=$treediff item=diffline} {if $diffline->GetStatus() == "A"} {elseif $diffline->GetStatus() == "D"} {assign var=parent value=$commit->GetParent()} {elseif $diffline->GetStatus() == "M" || $diffline->GetStatus() == "T"} {elseif $diffline->GetStatus() == "R"} {/if} {/foreach}
{$diffline->GetFromFile()} {assign var=localtotype value=$diffline->GetToFileType(1)} [ {if $diffline->ToFileIsRegular()} {assign var=tomode value=$diffline->GetToModeShort()} {t 1=$localtotype 2=$tomode}new %1 with mode %2{/t} {else} {t 1=$localtotype}new %1{/t} {/if} ] {$diffline->GetFromFile()} {assign var=localfromtype value=$diffline->GetFromFileType(1)} [ {t 1=$localfromtype}deleted %1{/t} ] {if $diffline->GetToHash() != $diffline->GetFromHash()} {$diffline->GetToFile()} {else} {$diffline->GetToFile()} {/if} {if $diffline->GetFromMode() != $diffline->GetToMode()} [ {if $diffline->FileTypeChanged()} {assign var=localfromtype value=$diffline->GetFromFileType(1)} {assign var=localtotype value=$diffline->GetToFileType(1)} {if $diffline->FileModeChanged()} {if $diffline->FromFileIsRegular() && $diffline->ToFileIsRegular()} {assign var=frommode value=$diffline->GetFromModeShort()} {assign var=tomode value=$diffline->GetToModeShort()} {t 1=$localfromtype 2=$localtotype 3=$frommode 4=$tomode}changed from %1 to %2 mode: %3 -> %4{/t} {elseif $diffline->ToFileIsRegular()} {assign var=tomode value=$diffline->GetToModeShort()} {t 1=$localfromtype 2=$localtotype 3=$tomode}changed from %1 to %2 mode: %3{/t} {else} {t 1=$localfromtype 2=$localtotype}changed from %1 to %2{/t} {/if} {else} {t 1=$localfromtype 2=$localtotype}changed from %1 to %2{/t} {/if} {else} {if $diffline->FileModeChanged()} {if $diffline->FromFileIsRegular() && $diffline->ToFileIsRegular()} {assign var=frommode value=$diffline->GetFromModeShort()} {assign var=tomode value=$diffline->GetToModeShort()} {t 1=$frommode 2=$tomode}changed mode: %1 -> %2{/t} {elseif $diffline->ToFileIsRegular()} {assign var=tomode value=$diffline->GetToModeShort()} {t 1=$tomode}changed mode: %1{/t} {else} {t}changed{/t} {/if} {else} {t}changed{/t} {/if} {/if} ] {/if} {$diffline->GetToFile()} {capture assign=fromfilelink} {$diffline->GetFromFile()} {/capture} [ {assign var=similarity value=$diffline->GetSimilarity()} {if $diffline->GetFromMode() != $diffline->GetToMode()} {assign var=tomode value=$diffline->GetToModeShort()} {t escape=no 1=$fromfilelink 2=$similarity 3=$tomode}moved from %1 with %2%% similarity, mode: %3{/t} {else} {t escape=no 1=$fromfilelink 2=$similarity}moved from %1 with %2%% similarity{/t} {/if} ]
{include file='footer.tpl'}