[go: nahoru, domu]

Skip to content

Commit

Permalink
navbar reorganized with dropdown "Python package" tab
Browse files Browse the repository at this point in the history
  • Loading branch information
luponzo86 committed Aug 16, 2019
1 parent dfb4758 commit dd51382
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 38 deletions.
15 changes: 12 additions & 3 deletions about.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<body>
<?php
$currentPage = 'About';
$currentPage = 'about';
include './html/navbar.php';
?>

Expand All @@ -29,8 +29,17 @@
significance of missense variants </i><br>
</a>
Luca Ponzoni, Ivet Bahar <br>
<small>Proceedings of the National Academy of Sciences Apr 2018,
115 (16) 4164-4169; DOI: 10.1073/pnas.1715896115 </small>
<small>PNAS Apr 2018, 115 (16) 4164-4169;
DOI: 10.1073/pnas.1715896115 </small>
</p>

<p>
<a href="https://www.biorxiv.org/content/10.1101/737429v1" target="_blank">
<i>[preprint] Rhapsody: Pathogenicity prediction of human missense variants
based on protein sequence, structure and dynamics</i><br>
</a>
Luca Ponzoni, Zoltan N. Oltvai, Ivet Bahar <br>
<small>bioRxiv Aug 2019, 737429; DOI: 10.1101/737429 </small>
</p>

<h5>other:</h5>
Expand Down
2 changes: 1 addition & 1 deletion batch_query.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<body>

<?php
$currentPage = 'Batch query';
$currentPage = 'batch_query';
include './html/navbar.php';
?>

Expand Down
2 changes: 1 addition & 1 deletion download.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<body>

<?php
$currentPage = 'Download';
$currentPage = 'Py_package';
include './html/navbar.php';
?>

Expand Down
87 changes: 56 additions & 31 deletions html/navbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,66 @@
<span class="navbar-toggler-icon"></span>
</button>

<div class="collapse navbar-collapse" id="myNavBar">
<ul class="navbar-nav mr-auto">
<?php

$urls = [
'Saturation mutagenesis' => 'href="sat_mutagen.php"',
'Batch query' => 'href="batch_query.php"',
'Retrieve jobs' => 'href="retrieve_jobs.php"',
'Docs' => 'href="https://rhapsody.readthedocs.io/en/latest/"'.
' target="_blank"',
'Tutorials' => 'href="https://nbviewer.jupyter.org/github/luponzo86/'.
'rhapsody-tutorials/tree/master/tutorials" target="_blank"',
'Download' => 'href="download.php"',
'About' => 'href="about.php"',
<?php
$a = [
'sat_mutagen' => ['', ''],
'batch_query' => ['', ''],
'retrieve_jobs' => ['', ''],
'Py_package' => ['', ''],
'about' => ['', ''],
];
$a[$currentPage] = ['active', '<span class="sr-only">(current)</span>']
?>

foreach ($urls as $name => $url) {
// break between left and right tabs
if ($name === 'Docs') {
echo '</ul><ul class="navbar-nav navbar-right">' . "\r\n" ;
}
// single tab
if ($currentPage === $name) {
echo '<li class="nav-item active">' .
'<a class="nav-link" ' . $url . '>' . $name .
'<span class="sr-only">(current)</span></a></li>' . "\r\n";
}
else {
echo '<li class="nav-item">' .
'<a class="nav-link" ' . $url . '>' . $name .
'</a></li>' . "\r\n";
}
}
<div class="collapse navbar-collapse" id="myNavBar">

?>
<!-- left navbar -->
<ul class="navbar-nav mr-auto">
<li class="nav-item <?php echo $a['sat_mutagen'][0]?>">
<a class="nav-link" href="sat_mutagen.php">Saturation mutagenesis
<?php echo $a['sat_mutagen'][1]?>
</a>
</li>
<li class="nav-item <?php echo $a['batch_query'][0]?>">
<a class="nav-link" href="batch_query.php">Batch query
<?php echo $a['batch_query'][1]?>
</a>
</li>
<li class="nav-item <?php echo $a['retrieve_jobs'][0]?>">
<a class="nav-link" href="retrieve_jobs.php">Retrieve jobs
<?php echo $a['retrieve_jobs'][1]?>
</a>
</li>
</ul>

<!-- right navbar -->
<ul class="navbar-nav navbar-right">
<li class="nav-item dropdown <?php echo $a['Py_package'][0]?>">
<a class="nav-link dropdown-toggle" href="#" id="dropdownID"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Python package <?php echo $a['Py_package'][1]?>
</a>
<div class="dropdown-menu" aria-labelledby="dropdownID">
<a class="dropdown-item" href="download.php">
Download
</a>
<a class="dropdown-item"
href="https://nbviewer.jupyter.org/github/luponzo86/rhapsody-tutorials/tree/master/tutorials"
target="_blank">
Tutorials
</a>
<a class="dropdown-item" href="https://rhapsody.readthedocs.io/en/latest/"
target="_blank">
Docs
</a>
</div>
</li>
<li class="nav-item <?php echo $a['about'][0]?>">
<a class="nav-link" href="about.php">About
<?php echo $a['about'][1]?>
</a>
</li>
</ul>
</div>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion retrieve_jobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<body>

<?php
$currentPage = 'Retrieve jobs';
$currentPage = 'retrieve_jobs';
include './html/navbar.php';
?>

Expand Down
2 changes: 1 addition & 1 deletion sat_mutagen.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<body>

<?php
$currentPage = 'Saturation mutagenesis';
$currentPage = 'sat_mutagen';
include './html/navbar.php';
?>

Expand Down

0 comments on commit dd51382

Please sign in to comment.