Indefero

Indefero Commit Details


Date:2011-03-29 17:12:07 (13 years 8 months ago)
Author:Stewart Platt
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, release-1.2, release-1.3
Commit:51c6cdb20d40a89be2af97e839fadaea333c31db
Parents: 766232f29bc3b80ddea6c18b09cd8b5d56a88b86
Message:Only display those filter options for items the user actually has access to (fixes issue 655)

Changes:

File differences

src/IDF/Views/Project.php
6262
6363
6464
65
65
6666
6767
6868
69
69
7070
71
72
73
74
75
76
77
78
71
72
73
74
75
76
77
78
79
80
81
82
83
84
7985
8086
8187
......
141147
142148
143149
144
145
150
151
146152
147153
148
154
149155
150156
151157
......
183189
184190
185191
186
192
187193
188194
189195
......
214220
215221
216222
217
218
223
224
219225
220226
221
227
222228
223229
224230
}
/**
* Returns an associative array with available model filters
* Returns an associative array with all accessible model filters
*
* @return array
*/
private static function getAvailableModelFilters()
private function getAccessibleModelFilters($request)
{
return array(
'all' => __('All Updates'),
'commits' => __('Commits'),
'issues' => __('Issues and Comments'),
'downloads' => __('Downloads'),
'documents' => __('Documents'),
'reviews' => __('Reviews and Patches'),
);
$filters = array('all' => __('All Updates'));
if (true === IDF_Precondition::accessSource($request))
$filters['commits'] = __('Commits');
if (true === IDF_Precondition::accessIssues($request))
$filters['issues'] = __('Issues and Comments');
if (true === IDF_Precondition::accessDownloads($request))
$filters['downloads'] = __('Downloads');
if (true === IDF_Precondition::accessWiki($request))
$filters['documents'] = __('Documents');
if (true === IDF_Precondition::accessReview($request))
$filters['reviews'] = __('Reviews and Patches');
return $filters;
}
/**
$prj = $request->project;
$model_filter = @$match[2];
$all_model_filters = self::getAvailableModelFilters();
if (!array_key_exists($model_filter, $all_model_filters)) {
$accessible_model_filters = self::getAccessibleModelFilters($request);
if (!array_key_exists($model_filter, $accessible_model_filters)) {
$model_filter = 'all';
}
$title = (string)$prj . ' ' . $all_model_filters[$model_filter];
$title = (string)$prj . ' ' . $accessible_model_filters[$model_filter];
$pag = new IDF_Timeline_Paginator(new IDF_Timeline());
$pag->class = 'recent-issues';
'feedurl' => $feedurl,
'timeline' => $pag,
'model_filter' => $model_filter,
'all_model_filters' => $all_model_filters,
'accessible_model_filters' => $accessible_model_filters,
),
$request);
$prj = $request->project;
$model_filter = @$match[2];
$all_model_filters = self::getAvailableModelFilters();
if (!array_key_exists($model_filter, $all_model_filters)) {
$accessible_model_filters = self::getAccessibleModelFilters($request);
if (!array_key_exists($model_filter, $accessible_model_filters)) {
$model_filter = 'all';
}
$title = $all_model_filters[$model_filter];
$title = $accessible_model_filters[$model_filter];
$classes = self::determineModelClasses($request, $model_filter);
$sqls = sprintf('model_class IN (%s)', implode(', ', $classes));
src/IDF/templates/idf/project/timeline.html
1515
1616
1717
18
18
1919
2020
2121
{block context}
<p><span class="label{if 'all' == $model_filter} active{/if}"><a href="{url 'IDF_Views_Project::timeline', array($project.shortname, 'all')}">{trans 'All Updates'}</a></span></p>
<p><strong>{trans 'Filter by type'}</strong><br />
{foreach $all_model_filters as $filter_key => $filter_name}
{foreach $accessible_model_filters as $filter_key => $filter_name}
{if $filter_key != 'all'}
<span class="label{if $filter_key == $model_filter} active{/if}"><a href="{url 'IDF_Views_Project::timeline', array($project.shortname, $filter_key)}">{$filter_name}</a></span><br />
{/if}

Archive Download the corresponding diff file

Page rendered in 0.08533s using 14 queries.