srchub

srchub Commit Details


Date:2015-10-04 16:45:40 (9 years 2 months ago)
Author:Natalie Adams
Branch:master
Commit:5ef48598192a26bfdb3732fe9a96b0a9a22b643f
Parents: 73aeb058e661207804a0ab52d0086292793f5014
Message:Issue 106: Allow size to be sorted on admin page

Changes:

File differences

indefero/src/IDF/Project.php
136136
137137
138138
139
140
139141
142
143
144
145
146
147
148
149
140150
141151
142152
);
$activityTable = $this->_con->pfx.'idf_projectactivities';
$tagTable = $this->_con->pfx.'idf_project_idf_tag_assoc';
$confTable = $this->_con->pfx.'idf_conf';
$thisTable = $this->_con->pfx.'idf_projects';
$this->_a['views'] = array(
'repo_size' => [
'join' => "INNER JOIN $confTable ON $thisTable.id = $confTable.project",
'select' => $this->getSelect() . ', CAST(vdesc as UNSIGNED) as vdesc',
'where' => 'vkey = "repository_size"',
'props' => array(
'vdesc' => 'vdesc',
),
],
'join_activities_and_tags' =>
array(
'join' => 'LEFT JOIN '.$activityTable.' ON current_activity='.$activityTable.'.id '
indefero/src/IDF/Views/Admin.php
8181
8282
8383
84
8485
8586
8687
87
88
89
8890
89
90
91
92
9193
9294
9395
......
657659
658660
659661
662
663
664
665
666
660667
661668
662669
$pag->action = 'IDF_Views_Admin::projects';
$pag->edit_action = array('IDF_Views_Admin::projectUpdate', 'id');
$pag->sort_order = array('shortname', 'ASC');
$pag->model_view = "repo_size";
$list_display = array(
'shortname' => __('Short Name'),
'name' => __('Name'),
array('id', 'IDF_Views_Admin_projectSize', __('Repository Size')),
'vdesc' => ["vdesc", "IDF_Views_Admin_projectSize2", __('Repository Size')],
);
$pag->configure($list_display, array(),
array('shortname' ));
$pag->configure($list_display, array('shortname', 'shortname'),
array('shortname', 'name', 'vdesc' ));
$pag->extra_classes = array('', '', 'right');
$pag->items_per_page = 25;
$pag->no_results_text = __('No projects were found.');
return Pluf_Utils::prettySize($size);
}
function IDF_Views_Admin_projectSize2($field, $project)
{
return Pluf_Utils::prettySize($project->vdesc);
}
/**
* Get a forge size.
*

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.06417s using 20 queries.