Indefero

Indefero Commit Details


Date:2008-11-23 04:12:16 (16 years 29 days 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, release-1.1, release-1.2, release-1.3
Commit:d9ffac099f77baed06bc1afc2e99969c062f89eb
Parents: 8eb5715656cfc94c312ee54e65b6c919c840489f
Message:Added the visualisation of the old revisions of a page.

Changes:

File differences

src/IDF/Views/Wiki.php
134134
135135
136136
137
138
139
140
141
142
143
144
145
137146
138147
148
149
150
151
139152
140153
141154
142155
156
143157
158
144159
145160
146161
throw new Pluf_HTTP_Error404($request);
}
$page = $pages[0];
$oldrev = false;
// We grab the old revision if requested.
if (isset($request->GET['rev']) and preg_match('/^[0-9]+$/', $request->GET['rev'])) {
$oldrev = Pluf_Shortcuts_GetObjectOr404('IDF_WikiRevision',
$request->GET['rev']);
if ($oldrev->wikipage != $page->id) {
throw new Pluf_HTTP_Error404($request);
}
}
$title = $page->title;
$revision = $page->get_current_revision();
$db = $page->getDbConnection();
$false = Pluf_DB_BooleanToDb(false, $db);
$revs = $page->get_revisions_list(array('order' => 'creation_dtime DESC',
'filter' => 'is_head='.$false));
return Pluf_Shortcuts_RenderToResponse('idf/wiki/view.html',
array(
'page_title' => $title,
'page' => $page,
'oldrev' => $oldrev,
'rev' => $revision,
'revs' => $revs,
'tags' => $page->get_tags_list(),
),
$request);
src/IDF/templates/idf/wiki/update.html
5656
5757
5858
59
59
6060
6161
6262
</tr>{/if}
<tr>
<td>&nbsp;</td>
<td><input type="submit" value="{trans 'Preview'}" name="preview" /> &nbsp; <input type="submit" value="{trans 'Update Page'}" name="submit" /> | <a href="{url 'IDF_Views_Wiki::index', array($project.shortname)}">{trans 'Cancel'}</a>
<td><input type="submit" value="{trans 'Preview'}" name="preview" /> &nbsp; <input type="submit" value="{trans 'Update Page'}" name="submit" /> | <a href="{url 'IDF_Views_Wiki::view', array($project.shortname, $page.title)}">{trans 'Cancel'}</a>
</td>
</tr>
</table>
src/IDF/templates/idf/wiki/view.html
11
2
23
34
45
6
7
8
9
10
11
12
13
14
515
616
17
718
19
20
21
822
923
1024
......
1933
2034
2135
36
37
38
39
40
41
2242
{extends "idf/wiki/base.html"}
{block extraheader}{if $oldrev}<meta name="ROBOTS" content="NOINDEX" />{/if}{/block}
{block docclass}yui-t3{assign $inView=true}{/block}
{block body}
{if $oldrev}
{assign $submitter = $oldrev.get_submitter()}{aurl 'url', 'IDF_Views_Wiki::view', array($project.shortname, $page.title)}
<div class="old-rev">
<p>{blocktrans}You are looking at an old revision of the page
<a href="{$url}">{$page.title}</a>. This revision was created
by {$submitter}.{/blocktrans}</p>
</div>
{/if}
<p class="desc">{$page.summary}</p>
{if !$oldrev}
{markdown $rev.content, $request}
{else}
{markdown $oldrev.content, $request}
{/if}
{/block}
{block context}
<span class="label"><strong>{$tag.class}:</strong>{$tag.name}</span><br />
{/foreach}
</p>{/if}
{if $revs.count() > 0}
<p><strong>{trans 'Old Revisions'}</strong></p>
<ul>{foreach $revs as $old}
<li><a href="{url 'IDF_Views_Wiki::view', array($project.shortname, $page.title), array('rev'=>$old.id)}">{$old.summary}</a></li>
{/foreach}</ul>
{/if}
{/block}
www/media/idf/css/style.css
589589
590590
591591
592
593
594
595
596
597
598
599
600
padding: 4px;
width: 60%;
}
div.old-rev {
padding: 1em 1em 0.1em 1em;
margin-bottom: 1em;
background-color: #bbe394;
width: 40%;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}

Archive Download the corresponding diff file

Page rendered in 0.07871s using 13 queries.