diff --git a/app/routes/pages/music.php b/app/routes/pages/music.php index a094106..f64ba0d 100755 --- a/app/routes/pages/music.php +++ b/app/routes/pages/music.php @@ -1,31 +1,16 @@ get('/music1', function() use($app) { +// music page +$app->get('/music', 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', [ + $app->render('pages/music.twig', [ 'albums' => $albums, 'songs' => $songs, 'links' => $links, ]); -})->name('music1'); - -# music design #2 -$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', [ - 'albums' => $albums, - 'songs' => $songs, - 'links' => $links, - ]); - -})->name('music2'); +})->name('music'); diff --git a/app/views/pages/music1.twig b/app/views/pages/music.twig similarity index 98% rename from app/views/pages/music1.twig rename to app/views/pages/music.twig index 9e5ab9a..64a9018 100644 --- a/app/views/pages/music1.twig +++ b/app/views/pages/music.twig @@ -4,7 +4,7 @@ {% endblock %} -{% block title %}Music Design #1{% endblock %} +{% block title %}Music{% endblock %} {% block content %} diff --git a/app/views/pages/music2.twig b/app/views/pages/music2.twig deleted file mode 100644 index 863788e..0000000 --- a/app/views/pages/music2.twig +++ /dev/null @@ -1,86 +0,0 @@ -{% extends 'templates/default.twig' %} - -{% block javascripts %} - -{% endblock %} - -{% block title %}Music Design #2{% endblock %} - -{% block content %} - -
-

Music

-
- - -
- - - - -
- -
- {{ albums[0].title }} -
-

{{ albums[0].title }}

-
Released on {{ albums[0].releaseDate }}
- {% if albums[0].description %} -
-

{{ albums[0].description }}

- {% endif %} - {% if links %} -
- - {% endif %} -
-
- - -
-

{{ songs[0].title }}

- -
- - -
-
    - {% for song in songs %} -
  • - {{ song.track_order }}. {{ song.title }} -
  • - {% endfor %} -
-
-
- - -
-
- {% for album in albums %} - -
-
- {{ album.title }} -
-
{{ album.title }} ({{ album.releaseYear }})
- {% if album.description %} -
-

{{ album.description|length > 50 ? album.description[:50] ~ '...' : album.description }}

- {% endif %} -
-
-
- {% endfor %} -
-
-
- -{% endblock %} diff --git a/app/views/templates/partials/header.twig b/app/views/templates/partials/header.twig index ac2d2f6..5a88d9e 100755 --- a/app/views/templates/partials/header.twig +++ b/app/views/templates/partials/header.twig @@ -29,10 +29,7 @@ Shows -