Skip to content

Commit

Permalink
Abstract person navigation
Browse files Browse the repository at this point in the history
- Enable votes link for all except NIA and LA
  • Loading branch information
ajparsons committed Mar 5, 2024
1 parent 210fdf3 commit 78e8767
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 23 deletions.
1 change: 1 addition & 0 deletions www/docs/mp/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@
}

// Prepare data for the template
$data["pagetype"] = $pagetype;
$data['full_name'] = $MEMBER->full_name();
$data['person_id'] = $MEMBER->person_id();
$data['member_id'] = $MEMBER->member_id();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<div class="person-navigation">
<ul>
<li <?php if ($pagetype == ""): ?>class="active"<?php endif; ?>><a href="<?= $member_url ?>"><?= gettext('Overview') ?></a></li>
<?php if ($this_page == "mp"): ?>
<li <?php if ($pagetype == "votes"): ?>class="active"<?php endif; ?>><a href="<?= $member_url ?>/votes"><?= gettext('Voting Summary') ?></a></li>
<?php endif; ?>
<?php if (in_array($this_page, ["mp", "msp", "ms"])): ?>
<li <?php if ($pagetype == "recent"): ?>class="active"<?php endif; ?>><a href="<?= $member_url ?>/recent"><?= gettext('Recent Votes') ?></a></li>
<?php endif; ?>
</ul>
</div>
10 changes: 1 addition & 9 deletions www/includes/easyparliament/templates/html/mp/profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,7 @@
<div class="full-page">
<div class="full-page__row">
<div class="full-page__unit">
<?php if (count($policyPositions->positions) > 0): ?>
<div class="person-navigation">
<ul>
<li class="active"><a href="<?= $member_url ?>"><?= gettext('Overview') ?></a></li>
<li><a href="<?= $member_url ?>/votes"><?= gettext('Voting Record') ?></a></li>
<li><a href="<?= $member_url ?>/recent"><?= gettext('Recent Votes') ?></a></li>
</ul>
</div>
<?php endif; ?>
<?php include '_person_navigation.php'; ?>
</div>
<div class="person-panels">
<div class="sidebar__unit in-page-nav">
Expand Down
8 changes: 1 addition & 7 deletions www/includes/easyparliament/templates/html/mp/recent.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@
<div class="full-page">
<div class="full-page__row">
<div class="full-page__unit">
<div class="person-navigation">
<ul>
<li><a href="<?= $member_url ?>"><?= gettext('Overview') ?></a></li>
<li><a href="<?= $member_url ?>/votes"><?= gettext('Voting Record') ?></a></li>
<li class="active"><a href="<?= $member_url ?>/recent"><?= gettext('Recent Votes') ?></a></li>
</ul>
</div>
<?php include '_person_navigation.php'; ?>
</div>
<div class="person-panels">
<div class="primary-content__unit">
Expand Down
8 changes: 1 addition & 7 deletions www/includes/easyparliament/templates/html/mp/votes.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@
<div class="full-page">
<div class="full-page__row">
<div class="full-page__unit">
<div class="person-navigation">
<ul>
<li><a href="<?= $member_url ?>">Overview</a></li>
<li class="active"><a href="<?= $member_url ?>/votes">Voting Record</a></li>
<li><a href="<?= $member_url ?>/recent">Recent Votes</a></li>
</ul>
</div>
<?php include '_person_navigation.php'; ?>
</div>
<div class="person-panels">
<div class="sidebar__unit in-page-nav">
Expand Down

0 comments on commit 78e8767

Please sign in to comment.