Fixed album links

This commit is contained in:
gballan1 2016-12-06 17:11:42 -05:00
parent 687e5b8fe3
commit b1c9fd959c
3 changed files with 16 additions and 4 deletions

View File

@ -5,10 +5,12 @@ $app->get('/music1', function() use($app) {
$albums = $app->album->all()->sortByDesc('release_date')->values()->all();
$songs = $albums[0]->songs;
$links = $albums[0]->links;
$app->render('pages/music1.twig', [
'albums' => $albums,
'songs' => $songs,
'links' => $links,
]);
})->name('music1');
@ -18,10 +20,12 @@ $app->get('/music2', function() use($app) {
$albums = $app->album->all()->sortByDesc('release_date')->values()->all();
$songs = $albums[0]->songs;
$links = $albums[0]->links;
$app->render('pages/music2.twig', [
$app->render('pages/music1.twig', [
'albums' => $albums,
'songs' => $songs,
'links' => $links,
]);
})->name('music2');

View File

@ -28,10 +28,10 @@
<hr />
<p id="album-description">{{ albums[0].description }}</p>
{% endif %}
{% if albums[0].links %}
{% if links %}
<hr />
<ul>
{% for link in albums[0].links %}
<ul style="padding-left:20px">
{% for link in links %}
<li>Buy on <a href="{{ link.link_ref }}">{{ link.link_name }}</a></li>
{% endfor %}
</ul>

View File

@ -29,6 +29,14 @@
<hr />
<p id="album-description">{{ albums[0].description }}</p>
{% endif %}
{% if links %}
<hr />
<ul style="padding-left:20px">
{% for link in links %}
<li>Buy on <a href="{{ link.link_ref }}">{{ link.link_name }}</a></li>
{% endfor %}
</ul>
{% endif %}
</div>
</div>