From abc521bb2f152c69688ab313a0e381d3f533faa4 Mon Sep 17 00:00:00 2001 From: Josef Citrine Date: Sun, 30 Oct 2016 19:02:14 +0000 Subject: [PATCH] #109: Open Graph and Twitter cards for tracks --- app/Http/Controllers/TracksController.php | 2 +- resources/assets/styles/content.less | 1 + resources/assets/styles/layout.less | 2 +- resources/views/shared/_layout.blade.php | 6 +-- resources/views/tracks/show.blade.php | 64 +++++++++++++++++++++-- 5 files changed, 67 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/TracksController.php b/app/Http/Controllers/TracksController.php index ff42d6cf..8c744383 100644 --- a/app/Http/Controllers/TracksController.php +++ b/app/Http/Controllers/TracksController.php @@ -88,7 +88,7 @@ class TracksController extends Controller return Redirect::action('TracksController@getTrack', [$id, $track->slug]); } - return View::make('tracks.show'); + return View::make('tracks.show', ['track' => $track]); } public function getEdit($id, $slug) diff --git a/resources/assets/styles/content.less b/resources/assets/styles/content.less index 0b461768..1b8988cc 100644 --- a/resources/assets/styles/content.less +++ b/resources/assets/styles/content.less @@ -145,6 +145,7 @@ &.artist-details { > header { padding: 15px; + margin: -10px -10px 10px; > img { width: 150px; diff --git a/resources/assets/styles/layout.less b/resources/assets/styles/layout.less index f432797e..4ec7f9eb 100644 --- a/resources/assets/styles/layout.less +++ b/resources/assets/styles/layout.less @@ -25,7 +25,7 @@ html, body { html body { height: 100%; - background: #444; + background: #fff; font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; padding: 0px !important; overflow-x: hidden; diff --git a/resources/views/shared/_layout.blade.php b/resources/views/shared/_layout.blade.php index 2903a7c8..cd4c335b 100644 --- a/resources/views/shared/_layout.blade.php +++ b/resources/views/shared/_layout.blade.php @@ -19,13 +19,13 @@ - Pony.fm - + @yield('title')Pony.fm + - + @yield('metadata') @yield('styles') diff --git a/resources/views/tracks/show.blade.php b/resources/views/tracks/show.blade.php index 8978d675..86dc2d2a 100644 --- a/resources/views/tracks/show.blade.php +++ b/resources/views/tracks/show.blade.php @@ -18,7 +18,65 @@ @extends('shared._app_layout') -@section('app_content') -

Track Listing!

-

This page should be what search engines see

+@section('title'){{ $track->title }} - {{ $track->user->display_name }} | @endsection +@section('description'){{ str_limit($track->description, $limit = 200, $end = '...') }}@endsection + +@section('metadata') + + + + + + + + + + + + + + + + + + + + + + + +@endsection + +@section('app_content') +
+
+ +

Boooring!

+

+ by: LogicDev +

+
+ +
+
+ + +
    +
  • Published: {!! Helpers::timestamp($track->published_at) !!}
  • +
  • Views: {{ $track->view_count }}
  • +
  • Plays: {{ $track->play_count }}
  • +
  • Downloads: {{ $track->download_count }}
  • +
  • Favourites: {{ $track->favourite_count }}
  • +
+
+
+
+

Description

+

{{ $track->description }}

+
+
+
+
@endsection