Indefero

Indefero Commit Details


Date:2008-07-28 15:09:17 (16 years 4 months ago)
Author:Loic d'Anterroches
Branch:dev, develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, newdiff, release-1.1, release-1.2, release-1.3, svn
Commit:a6716c77160c9bbb4829eff5c6e11c7b9a4f6d50
Parents: 3fb47562ce0453af4481b1b470581f5bcbbc6b3b
Message:Added the visualisation of a commit.

Changes:

File differences

src/IDF/Git.php
228228
229229
230230
231
231
232232
233233
234234
}
}
$out = self::parseLog($log, 4);
$out[0]->changes = $change;
$out[0]->changes = implode("\n", $change);
return $out[0];
}
src/IDF/Template/IssueComment.php
8888
8989
9090
91
91
9292
9393
9494
return $m[0];
}
$co = $this->git->getCommit($m[2]);
return '<a href="'.Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase', array($this->project->shortname, $co->commit)).'">'.$m[1].$m[2].'</a>';
return '<a href="'.Pluf_HTTP_URL_urlForView('IDF_Views_Source::commit', array($this->project->shortname, $co->commit)).'">'.$m[1].$m[2].'</a>';
}
/**
src/IDF/Views/Source.php
145145
146146
147147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
148182
149183
150184
}
return '<span class="breadcrumb">'.implode('<span class="sep">'.$sep.'</span>', $out).'</span>';
}
public function commit($request, $match)
{
$git = new IDF_Git(Pluf::f('git_repository'));
$commit = $match[2];
$branches = $git->getBranches();
if ('commit' != $git->testHash($commit)) {
// Redirect to the first branch
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase',
array($request->project->shortname,
$branches[0]));
return new Pluf_HTTP_Response_Redirect($url);
}
$title = sprintf('%s Commit Details', (string) $request->project);
$page_title = sprintf('%s Commit Details - %s', (string) $request->project, $commit);
$cobject = $git->getCommit($commit);
require_once 'Text/Highlighter.php';
$th = new Text_Highlighter();
$h = $th->factory('DIFF');
$changes = $h->highlight($cobject->changes);
return Pluf_Shortcuts_RenderToResponse('source/commit.html',
array(
'page_title' => $page_title,
'title' => $title,
'changes' => $changes,
'cobject' => $cobject,
'commit' => $commit,
'branches' => $branches,
),
$request);
}
}
function IDF_Views_Source_PrettySize($size)
src/IDF/conf/views.php
116116
117117
118118
119
120
121
122
123
124
119125
120126
121127
'model' => 'IDF_Views_Source',
'method' => 'changeLog');
$ctl[] = array('regex' => '#^/p/(\w+)/source/commit/(\w+)/$#',
'base' => $base,
'priority' => 4,
'model' => 'IDF_Views_Source',
'method' => 'commit');
// ---------- ADMIN --------------------------------------
src/IDF/templates/source/base.html
44
55
66
7
78
89
910
<div id="sub-tabs">
<a {if $inSourceTree}class="active" {/if}href="{url 'IDF_Views_Source::treeBase', array($project.shortname, 'master')}">{trans 'Source Tree'}</a> |
<a {if $inChangeLog}class="active" {/if}href="{url 'IDF_Views_Source::changeLog', array($project.shortname, 'master')}">{trans 'Change Log'}</a>
{if $inCommit}| {trans 'Commit'}{/if}
</div>
{/block}
{block title}{$title}{/block}
src/IDF/templates/source/changelog.html
1111
1212
1313
14
14
1515
1616
1717
......
2323
2424
2525
26
27
28
2926
3027
3128
</thead>
<tbody>
{foreach $changes as $change}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $change.commit)}
{aurl 'url', 'IDF_Views_Source::commit', array($project.shortname, $change.commit)}
<tr class="log">
<td><a href="{$url}">{$change.date|dateago:"wihtout"}</a></td>
<td>{$change.title}{if $change.full_message}<br /><br />{$change.full_message}{/if}</td>
</div>
</td>
{* <td><span class="smaller">{trans 'Tree:'}&nbsp;<a href="{$url}">{$change.commit}</a><br />
{trans 'By:'} {$change.author|strip_tags}
</span></td> *}
</tr>
{/foreach}
</tbody>
src/IDF/templates/source/commit.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{extends "source/base.html"}
{block docclass}yui-t1{assign $inCommit=true}{/block}
{block body}
<table class="commit" summary="">
<tr>
<th><strong>{trans 'Date:'}</strong></th><td>{$cobject.date|date:"%Y-%m-%d %H:%M:%S"} ({$cobject.date|dateago})</td>
</tr>
<tr>
<th><strong>{trans 'Author:'}</strong></th><td>{$cobject.author|strip_tags}</td>
</tr>
<tr>
<th><strong>{trans 'Commit:'}</strong></th><td class="mono">{$cobject.commit}</td>
</tr>
<tr>
<th><strong>{trans 'Tree:'}</strong></th><td class="mono"><a href="{url 'IDF_Views_Source::treeBase', array($project.shortname, $commit)}">{$cobject.tree}</a><br /><br /></td>
</tr>
<tr>
<th><strong>{trans 'Message:'}</strong></th><td>{issuetext $cobject.title, $project}{if isset($cobject.full_message)}<br /><br />{issuetext $cobject.full_message, $project}{/if}</td>
</tr>
</table>
<h2>{trans 'Change Details'}</h2>
{$changes|safe}
{/block}
{block context}
<p><strong>{trans 'Branches:'}</strong><br />
{foreach $branches as $branch}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $branch)}
<span class="label{if $commit == $branch} active{/if}"><a href="{$url}" class="label">{$branch}</a></span><br />
{/foreach}
</p>
{/block}
src/IDF/templates/source/tree.html
1111
1212
1313
14
14
1515
16
16
1717
1818
1919
<th>{trans 'Size'}</th>
</tr>
</thead>{if !$tree_in}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $commit)}
{aurl 'url', 'IDF_Views_Source::commit', array($project.shortname, $commit)}
<tfoot>
<tr><th colspan="5">{blocktrans}In commit <a class="mono" href="{$url}">{$commit}</a> created {$cobject.date|dateago}.{/blocktrans}<br />
<tr><th colspan="5">{blocktrans}Source at commit <a class="mono" href="{$url}">{$commit}</a> created {$cobject.date|dateago}.{/blocktrans}<br />
<span class="smaller">{blocktrans}By {$cobject.author|strip_tags|trim}, {$cobject.title}{/blocktrans}</span>
</th></tr>
</tfoot>
www/media/idf/css/style.css
363363
364364
365365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
background-color: #4e9a06;
color: white;
}
/**
* Commit
*/
table.commit th, table.commit td {
border: none;
vertical-align: top;
}
table.commit th {
text-align: right;
font-weight: normal;
}
table.commit td, table.commit th {
padding: 3px;
}
/**
* syntax highlighting of diffs
*/
div.hl-main {
font-family: monospace;
white-space: pre;
border: 1px solid #d3d7cf;
padding: 1em;
}
span.hl-string {
background-color: #dfd;
}
span.hl-quotes {
background-color: #fdd;
}
span.hl-reserved, span.hl-var {
font-weight: bold;
}
span.hl-default {
color: #888a85;
}
div.hl-main span {
line-height: 1.3;
}

Archive Download the corresponding diff file

Page rendered in 0.10158s using 13 queries.