Skip to content

Commit

Permalink
New design
Browse files Browse the repository at this point in the history
  • Loading branch information
piero-la-lune committed Mar 5, 2013
1 parent 405f645 commit 3aec8f4
Show file tree
Hide file tree
Showing 34 changed files with 5,399 additions and 1,963 deletions.
301 changes: 214 additions & 87 deletions classes/Issues.class.php

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions classes/Mail.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ public function __construct($object, $content) {
$this->content = $content;
$this->replace(array('%title%' => $config['title']));
if (getProject()) {
if (onlyDefaultProject()) { $this->replace(array('%project%' => '')); }
else { $this->replace(array('%project%' => getProject())); }
if (onlyDefaultProject()) {
$this->replace(array('%project%' => ''));
}
else {
$this->replace(array('%project%' => getProject()));
}
}
}

Expand Down Expand Up @@ -53,6 +57,7 @@ public function send($to) {

return mail($to, $object, $this->personal_content, $headers);
}

}

?>
33 changes: 29 additions & 4 deletions classes/Page.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,35 @@ class Page {
protected $javascript;
protected $errors = array();

private $pages = array('home', 'install', 'dashboard', 'issues', 'search', 'view_issue', 'new_issue', 'view_user', 'settings', 'error/403', 'error/404', 'signup');
private $need_project = array('dashboard', 'issues', 'search', 'view_issue', 'new_issue');
private $pages = array(
'home',
'install',
'dashboard',
'issues',
'search',
'view_issue',
'new_issue',
'view_user',
'settings',
'error/403',
'error/404',
'signup'
);
private $need_project = array(
'dashboard',
'issues',
'search',
'view_issue',
'new_issue'
);

public function load($page) {
$this->page = $page;
$path = dirname(__FILE__).'/../pages/'.$page.'.php';
if (!in_array($page, $this->pages)
|| (in_array($page, $this->need_project) && !getProject())
|| !is_file($path)) {
|| !is_file($path)
) {
$this->page = 'error/404';
$path = dirname(__FILE__).'/../pages/error/404.php';
}
Expand Down Expand Up @@ -62,7 +82,12 @@ public function getAlerts() {
unset($_SESSION['alert']);
}
foreach ($this->errors as $error) {
$txt .= '<div class="alert '.$error['type'].'"><button type="button" class="close" data-dismiss="alert">×</button>'.$error['text'].'</div>';
$txt .= '<div class="alert '.$error['type'].'">'
.'<button type="button" class="close" data-dismiss="alert">'
.'×'
.'</button>'
.$error['text']
.'</div>';
}
return $txt;
}
Expand Down
21 changes: 17 additions & 4 deletions classes/Pager.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ public function get($a, $url, $render, $per_page) {
$keys = array_keys($a);
$nb = count($keys);

$page = (isset($_GET['pagen']) && !empty($_GET['pagen'])) ? intval($_GET['pagen']) : 1;
$page = (isset($_GET['pagen']) && !empty($_GET['pagen'])) ?
intval($_GET['pagen']):
1;
$page = ($page < 1) ? 1 : $page;
$nbpages = ceil($nb/$per_page);
$start = $per_page*($page-1);
Expand All @@ -27,12 +29,23 @@ public function get($a, $url, $render, $per_page) {
$html .= '<div class="pager">';
if ($page > 1) {
$url->addParam('pagen', $page-1);
$html .= '<a href="'.$url->get().'" class="previous a-icon-hover"><i class="icon-chevron-left"></i> '.Trad::W_PREVIOUS.'</a>';
$html .= '<a href="'.$url->get().'" class="previous a-icon-hover">'
.'<i class="icon-chevron-left"></i> '
.Trad::W_PREVIOUS
.'</a>';
}
$html .= '<span class="current">'.str_replace(array('%nb1%', '%nb2%'), array($page, $nbpages), Trad::W_CURRENT).'</span>';
$html .= '<span class="current">'
.str_replace(
array('%nb1%', '%nb2%'),
array($page, $nbpages),
Trad::W_CURRENT)
.'</span>';
if ($page < $nbpages) {
$url->addParam('pagen', $page+1);
$html .= '<a href="'.$url->get().'" class="next a-icon-hover">'.Trad::W_NEXT.' <i class="icon-chevron-right"></i></a>';
$html .= '<a href="'.$url->get().'" class="next a-icon-hover">'
.Trad::W_NEXT
.' <i class="icon-chevron-right"></i>'
.'</a>';
}
$html .= '</div>';
return $html;
Expand Down
Loading

0 comments on commit 3aec8f4

Please sign in to comment.