Skip to content

Commit

Permalink
Added HTML head titles for all the main navigation items as well as t…
Browse files Browse the repository at this point in the history
…he Admin menu items.

Fixes #109
  • Loading branch information
inghamn committed Apr 1, 2016
1 parent 4be1f37 commit 1e81a7b
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 10 deletions.
9 changes: 8 additions & 1 deletion Controllers/ApplicantsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public function index()
$table = new ApplicantTable();
$list = $table->find();

$title = $this->template->_(['applicant', 'applicants', count($list)]);
$this->template->title = $title.' - '.APPLICATION_HOME;
$this->template->blocks[] = new Block('applicants/list.inc', ['applicants'=>$list]);
}

Expand Down Expand Up @@ -112,10 +114,15 @@ public function apply()
}


$title = $this->template->_('apply');
if (isset($_REQUEST['committee_id'])) {
try { $committee = new Committee($_REQUEST['committee_id']); }
try {
$committee = new Committee($_REQUEST['committee_id']);
$title.= ' - '.$committee->getName();
}
catch (\Exception $e) { $_SESSION['errorMessages'][] = $e; }
}
$this->template->title = $title.' - '.APPLICATION_NAME;
$block = new Block('applicants/applyForm.inc', ['applicant'=>$applicant]);
if (isset($committee)) { $block->committee = $committee; }
$this->template->blocks[] = $block;
Expand Down
2 changes: 2 additions & 0 deletions Controllers/AppointersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public function index()
$table = new AppointerTable();
$appointers = $table->find();

$title = $this->template->_(['appointer', 'appointers', count($appointers)]);
$this->template->title = $title.' - '.APPLICATION_NAME;
$this->template->blocks[] = new Block('appointers/list.inc', ['appointers'=>$appointers]);
}

Expand Down
4 changes: 2 additions & 2 deletions Controllers/CommitteesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function index()
else {
$block = 'list';
}
$this->template->title = $this->template->_("committees_$block");
$this->template->title = $this->template->_("committees_$block").' - '.APPLICATION_NAME;
$this->template->blocks[] = new Block("committees/$block.inc", ['data'=>$data]);
}

Expand Down Expand Up @@ -81,7 +81,7 @@ public function members()
$this->template->blocks[] = new Block('committees/breadcrumbs.inc', ['committee' => $committee]);
$this->template->blocks[] = new Block('committees/header.inc', ['committee' => $committee]);
}

if ($committee->getType() === 'seated') {
$data = SeatTable::currentData(['committee_id'=>$committee->getId()]);
$this->template->blocks[] = new Block('seats/data.inc', [
Expand Down
2 changes: 2 additions & 0 deletions Controllers/DepartmentsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public function index()
$table = new DepartmentTable();
$list = $table->find();

$title = $this->template->_(['department', 'departments', count($list)]);
$this->template->title = $title.' - '.APPLICATION_NAME;
$this->template->blocks[] = new Block('departments/list.inc', ['departments'=>$list]);
}

Expand Down
5 changes: 4 additions & 1 deletion Controllers/LiaisonsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ public function index()
? $_GET['type']
: Liaison::$types[0];

$data = LiaisonTable::data(['type'=>$type, 'current'=>true]);
$data = LiaisonTable::data(['type'=>$type, 'current'=>true]);
$title = $this->template->_(['liaison', 'liaisons', count($data['results'])]);

$this->template->title = $title.' - '.APPLICATION_NAME;
$this->template->blocks[] = new Block('liaisons/list.inc', ['data'=>$data]);
}

Expand Down
2 changes: 2 additions & 0 deletions Controllers/PeopleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ public function index()
$this->template->blocks[] = new Block('people/list.inc', ['people' =>$people]);
$this->template->blocks[] = new Block('pageNavigation.inc', ['paginator'=>$people]);
}
$this->template->title = $this->template->_(['person', 'people', 2]).' - '.APPLICATION_NAME;
}

public function view()
{
try {
$person = new Person($_REQUEST['person_id']);
$this->template->title = $person->getFullname().' - '.APPLICATION_NAME;
$this->template->blocks[] = new Block('people/info.inc', ['person'=>$person]);

if ($this->template->outputFormat == 'html') {
Expand Down
2 changes: 2 additions & 0 deletions Controllers/RacesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public function index()
$table = new RaceTable();
$races = $table->find();

$title = $this->template->_(['race', 'races', count($races)]);
$this->template->title = $title.' - '.APPLICATION_NAME;
$this->template->blocks[] = new Block('races/list.inc', ['races'=>$races]);
}

Expand Down
10 changes: 5 additions & 5 deletions Controllers/SeatsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public function index()
$data = SeatTable::currentData();

if ($this->template->outputFormat === 'html') {
$this->template->title = $this->template->_('seats_current').' - '.APPLICATION_NAME;
$this->template->blocks[] = new Block('committees/breadcrumbs.inc');
$this->template->blocks[] = new Block('seats/header.inc');
}
Expand All @@ -28,16 +29,15 @@ public function index()

public function vacancies()
{
$data = SeatTable::currentData(['vacant'=>true]);
$data = SeatTable::currentData(['vacant'=>true]);
$title = $this->template->_(['vacancy', 'vacancies', count($data['results'])]);

if ($this->template->outputFormat === 'html') {
$this->template->title = $title.' - '.APPLICATION_NAME;
$this->template->blocks[] = new Block('committees/breadcrumbs.inc');
$this->template->blocks[] = new Block('seats/header.inc');
}
$this->template->blocks[] = new Block('seats/data.inc', [
'data' => $data,
'title' => $this->template->_(['vacancy', 'vacancies', count($data['results'])])
]);
$this->template->blocks[] = new Block('seats/data.inc', ['data' => $data, 'title' => $title]);
}

public function view()
Expand Down
4 changes: 3 additions & 1 deletion Controllers/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ public function index()
$users->setCurrentPageNumber($page);
$users->setItemCountPerPage(20);

$this->template->blocks[] = new Block('users/list.inc',array('users'=>$users));
$title = $this->template->_(['user', 'users', 2]);
$this->template->title = $title.' - '.APPLICATION_NAME;
$this->template->blocks[] = new Block('users/list.inc', ['users' =>$users]);
$this->template->blocks[] = new Block('pageNavigation.inc', ['paginator'=>$users]);
}

Expand Down

0 comments on commit 1e81a7b

Please sign in to comment.