* [task#134016,doing,0.5h] add grade group.
This commit is contained in:
@@ -588,6 +588,10 @@ class story extends control
|
||||
$this->product->setMenu($story->product, $story->branch);
|
||||
}
|
||||
|
||||
$gradeGroup = array();
|
||||
$gradeList = $this->story->getGradeList('');
|
||||
foreach($gradeList as $grade) $gradeGroup[$grade->type][$grade->grade] = $grade->name;
|
||||
|
||||
$this->view->title = "STORY #$story->id $story->title - $product->name";
|
||||
$this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($product->id);
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
@@ -600,6 +604,7 @@ class story extends control
|
||||
$this->view->product = $product;
|
||||
$this->view->maxGradeGroup = $this->story->getMaxGradeGroup();
|
||||
$this->view->gradePairs = $this->story->getGradePairs($story->type, 'all');
|
||||
$this->view->gradeGroup = $gradeGroup;
|
||||
$this->view->roadmaps = $this->config->edition == 'ipd' ? array(0 => '') + $this->loadModel('roadmap')->getPairs() : array();
|
||||
$this->view->demand = $this->config->edition == 'ipd' ? $this->loadModel('demand')->getByID($story->demand) : new stdclass();
|
||||
$this->view->showGrade = !empty($this->config->showStoryGrade);
|
||||
|
||||
@@ -36,3 +36,18 @@ window.waitDom('body.body-modal .toolbar', function()
|
||||
{
|
||||
$('.body-modal .toolbar a[data-load="modal"]').attr('data-toggle', 'modal').removeAttr('data-load');
|
||||
})
|
||||
|
||||
window.renderChildCell = function(result, info)
|
||||
{
|
||||
if(info.col.name == 'title' && result)
|
||||
{
|
||||
let html = '';
|
||||
const story = info.row.data;
|
||||
const gradeMap = gradeGroup[story.type] || {};
|
||||
let gradeLabel = gradeMap[story.grade];
|
||||
|
||||
if(gradeLabel) html += "<span class='label gray-pale rounded-xl clip'>" + gradeLabel + "</span> ";
|
||||
if(html) result.unshift({html});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user