Indefero

Indefero Commit Details


Date:2011-01-06 15:38:38 (13 years 11 months ago)
Author:William MARTIN
Branch: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:afa91188d8e265fa3fcaa6b6a93a3190f8bc8019
Parents: c2a9a60aa724d7e5ee75aa297b299d6e63833897
Message:Enhancement of the view of an issue. Add link previous and after to quickly jump to another issue. Those links are pointing to issue with the same status (open/closed).

With little trick on url we can do the same thing for browse "my issue" and "my watchlist".
Changes:

File differences

src/IDF/Views/Issue.php
435435
436436
437437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
438458
439459
440460
......
447467
448468
449469
470
471
450472
451473
452474
}
}
// Search previous and next issue id
$octags = $prj->getTagIdsByStatus(($closed) ? 'closed' : 'open');
if (count($octags) == 0) $octags[] = 0;
$sql_previous = new Pluf_SQL('project=%s AND status IN ('.implode(', ', $octags).') AND id<%s',
array($prj->id, $match[2])
);
$sql_next = new Pluf_SQL('project=%s AND status IN ('.implode(', ', $octags).') AND id>%s',
array($prj->id, $match[2])
);
$previous_issue = Pluf::factory('IDF_Issue')->getList(array('filter' => $sql_previous->gen(),
'order' => 'id DESC',
'nb' => 1
));
$next_issue = Pluf::factory('IDF_Issue')->getList(array('filter' => $sql_next->gen(),
'order' => 'id ASC',
'nb' => 1
));
$previous_issue_id = (isset($previous_issue[0])) ? $previous_issue[0]->id : 0;
$next_issue_id = (isset($next_issue[0])) ? $next_issue[0]->id : 0;
$arrays = self::autoCompleteArrays($prj);
return Pluf_Shortcuts_RenderToResponse('idf/issues/view.html',
array_merge(
'closed' => $closed,
'preview' => $preview,
'interested' => $interested->count(),
'previous_issue_id' => $previous_issue_id,
'next_issue_id' => $next_issue_id
),
$arrays),
$request);
src/IDF/templates/idf/issues/view.html
11
22
33
4
5
6
7
8
9
10
11
12
413
514
615
{extends "idf/issues/base.html"}
{block titleicon}{if $form}<form class="star" method="post" action="{url 'IDF_Views_Issue::star', array($project.shortname, $issue.id)}"><input type="image" src="{if $starred}{media '/idf/img/star.png'}{else}{media '/idf/img/star-grey.png'}{/if}" name="submit" title="{if $starred}{trans 'Remove this issue from your watch list'}{else}{trans 'Add this issue to your watch list'}{/if}" /></form> {/if}{/block}
{block body}
<div style="float:right;">
{if $previous_issue_id}
<a href="{url 'IDF_Views_Issue::view', array($project.shortname, $previous_issue_id)}" title="{if $closed}{trans 'Click here to view the previous closed issue'}{else}{trans 'Click here to view the previous open issue'}{/if}">Previous issue</a>
{/if}
{if $previous_issue_id and $next_issue_id} - {/if}
{if $next_issue_id}
<a href="{url 'IDF_Views_Issue::view', array($project.shortname, $next_issue_id)}" title="{if $closed}{trans 'Click here to view the next closed issue'}{else}{trans 'Click here to view the next open issue'}{/if}">Next issue</a>
{/if}
</div>
{assign $i = 0}
{assign $nc = $comments.count()}
{foreach $comments as $c}{ashowuser 'submitter', $c.get_submitter(), $request}
www/media/idf/css/style.css
225225
226226
227227
228
228229
229230
230231
div.issue-comment-first {
border-top: 1px solid #d3d7cf;
clear: both;
}
div.issue-comment-signin {

Archive Download the corresponding diff file

Page rendered in 0.08248s using 13 queries.