Make dashboard dynamic
This commit is contained in:
@@ -35,7 +35,46 @@ class Dashboard extends CI_Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function index() {
|
public function index() {
|
||||||
$this->load->view('dashboard');
|
$tpl['action_buttons'] = array(
|
||||||
|
array(
|
||||||
|
'icon' => 'tango/folder-new.png',
|
||||||
|
'text' => _('New project'),
|
||||||
|
'target' => site_url('projects/create'),
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'icon' => 'tango/document-open.png',
|
||||||
|
'text' => _('Recent results'),
|
||||||
|
'target' => site_url('jobs/results'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
$tpl['recent_buttons'] = array(
|
||||||
|
array(
|
||||||
|
'count' => 4,
|
||||||
|
'text' => _('Jobs finished'),
|
||||||
|
'title' => sprintf(_('%d jobs finished recently'), 3),
|
||||||
|
'target' => '#',
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'count' => 2,
|
||||||
|
'text' => _('Newly shared projects'),
|
||||||
|
'title' => sprintf(_('You were invited to join %d projects'), 2),
|
||||||
|
'target' => '#',
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'count' => 1,
|
||||||
|
'text' => _('Job running'),
|
||||||
|
'title' => sprintf(_('There is %d job currently running'), 1),
|
||||||
|
'target' => '#',
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'count' => 2,
|
||||||
|
'text' => _('Jobs pending'),
|
||||||
|
'title' => sprintf(_('There are %2 job currently pending'), 1),
|
||||||
|
'target' => '#',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
$this->load->view('dashboard', $tpl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,54 @@
|
|||||||
<?php $this->load->view('header');?>
|
<?php $this->load->view('header');?>
|
||||||
|
|
||||||
<div id="content">
|
<div id="content">
|
||||||
|
<div id="dashboard">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<h2><?=_('Dashboard');?></h2>
|
<h2><?=_('Dashboard');?></h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<h3><?=_('Projects');?></h3>
|
<h3><?=_('Quick actions');?></h3>
|
||||||
<p>
|
<p>
|
||||||
<a class="button left big" href="projects/create"><?=_('Create a project');?></a><a class="button middle big" href="projects"><?=_('Show projects');?></a><a class="button right big" href="#"><?=_('Search projects');?></a>
|
<?
|
||||||
|
if(count($action_buttons) > 0):
|
||||||
|
$i = 1;
|
||||||
|
foreach ($action_buttons as $button):
|
||||||
|
if($i == 1 && (count($action_buttons) == 1))
|
||||||
|
$button['class'] = '';
|
||||||
|
elseif($i == count($action_buttons))
|
||||||
|
$button['class'] = 'right';
|
||||||
|
elseif($i == 1)
|
||||||
|
$button['class'] = 'left';
|
||||||
|
else
|
||||||
|
$button['class'] = 'middle';
|
||||||
|
?><a class="button <?=$button['class'];?> big" href="<?=$button['target'];?>"><strong><?=image_asset($button['icon']);?></strong><br /><?=$button['text'];?></a><?
|
||||||
|
$i++;
|
||||||
|
endforeach;
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<h3><?=_('Experiments');?></h3>
|
<h3><?=_('Recent events');?></h3>
|
||||||
<p>
|
<p>
|
||||||
<a class="button left big" href="#"><?=_('Newest results');?></a><a class="button middle big" href="#"><?=_('Running jobs');?></a>
|
<?
|
||||||
|
if(count($recent_buttons) > 0):
|
||||||
|
$i = 1;
|
||||||
|
foreach ($recent_buttons as $button):
|
||||||
|
if($i == 1 && (count($recent_buttons) == 1))
|
||||||
|
$button['class'] = '';
|
||||||
|
elseif($i == count($recent_buttons))
|
||||||
|
$button['class'] = 'right';
|
||||||
|
elseif($i == 1)
|
||||||
|
$button['class'] = 'left';
|
||||||
|
else
|
||||||
|
$button['class'] = 'middle';
|
||||||
|
?><a class="button <?=$button['class'];?> big" href="<?=$button['target'];?>" title="<?=$button['title'];?>"><strong><?=$button['count'];?></strong><br /><?=$button['text'];?></a><?
|
||||||
|
$i++;
|
||||||
|
endforeach;
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
@@ -24,7 +57,7 @@
|
|||||||
<a class="button left big" href="#"><?=_('Manage servers');?></a><a class="button middle big" href="<?=site_url('admin/programs');?>"><?=_('Manage programs');?></a><a class="button right big" href="<?=site_url('admin/users');?>"><?=_('Manage users');?></a>
|
<a class="button left big" href="#"><?=_('Manage servers');?></a><a class="button middle big" href="<?=site_url('admin/programs');?>"><?=_('Manage programs');?></a><a class="button right big" href="<?=site_url('admin/users');?>"><?=_('Manage users');?></a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php $this->load->view('footer');?>
|
<?php $this->load->view('footer');?>
|
||||||
|
|||||||
BIN
assets/images/tango/document-new.png
Normal file
BIN
assets/images/tango/document-new.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1008 B |
BIN
assets/images/tango/document-open.png
Normal file
BIN
assets/images/tango/document-open.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
BIN
assets/images/tango/folder-new.png
Normal file
BIN
assets/images/tango/folder-new.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
BIN
assets/images/tango/folder-remote.png
Normal file
BIN
assets/images/tango/folder-remote.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Reference in New Issue
Block a user