planiverse

A minimalist, no-JS front-end for Mastodon.
git clone https://git.stjo.hn/planiverse
Log | Files | Refs | README | LICENSE

commit d0e5b5fe675421ad6be473bad4a76db692f2cf5b
parent 0247f8b57ee0c7f85ee0153baa923d9b0fce1b30
Author: St John Karp <stjohn@fuzzjunket.com>
Date:   Sun,  9 Sep 2018 20:55:08 -0700

Use dynamically generated links

Removed hard-coded and relative links and replaced them with
dynamically generated ones. Should allow Planiverse to be served
from a subfolder.

Diffstat:
Mresources/views/context.blade.php | 2+-
Mresources/views/home_timeline.blade.php | 2+-
Mresources/views/navigation.blade.php | 6+++---
Mresources/views/notifications.blade.php | 2+-
Mresources/views/public_timeline.blade.php | 2+-
Mresources/views/show_status.blade.php | 4++--
Mresources/views/status.blade.php | 12++++++------
Mroutes/web.php | 8+++++++-
8 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/resources/views/context.blade.php b/resources/views/context.blade.php @@ -7,7 +7,7 @@ <title>{{ $mastodon_domain }} | Thread</title> - <link rel="stylesheet" href="/css/styles.css" /> + <link rel="stylesheet" href="{{ url('css/styles.css') }}" /> </head> <body> <h1>{{ $mastodon_domain }} | Thread</h1> diff --git a/resources/views/home_timeline.blade.php b/resources/views/home_timeline.blade.php @@ -7,7 +7,7 @@ <title>{{ $mastodon_domain }} | Timeline</title> - <link rel="stylesheet" href="/css/styles.css" /> + <link rel="stylesheet" href="{{ url('css/styles.css') }}" /> </head> <body> <h1>{{ $mastodon_domain }} | Timeline</h1> diff --git a/resources/views/navigation.blade.php b/resources/views/navigation.blade.php @@ -1,7 +1,7 @@ <nav> <ul> - <li><a href="/timeline/home">Timeline</a></li> - <li><a href="/timeline/public">Public Timeline</a></li> - <li><a href="/notifications">Notifications</a></li> + <li><a href="{{ route('home') }}">Timeline</a></li> + <li><a href="{{ route('public') }}">Public Timeline</a></li> + <li><a href="{{ route('notifications') }}">Notifications</a></li> </ul> </nav> diff --git a/resources/views/notifications.blade.php b/resources/views/notifications.blade.php @@ -7,7 +7,7 @@ <title>{{ $mastodon_domain }} | Notifications</title> - <link rel="stylesheet" href="/css/styles.css" /> + <link rel="stylesheet" href="{{ url('css/styles.css') }}" /> </head> <body> <h1>{{ $mastodon_domain }} | Notifications</h1> diff --git a/resources/views/public_timeline.blade.php b/resources/views/public_timeline.blade.php @@ -7,7 +7,7 @@ <title>{{ $mastodon_domain }} | Public Timeline</title> - <link rel="stylesheet" href="/css/styles.css" /> + <link rel="stylesheet" href="{{ url('css/styles.css') }}" /> </head> <body> <h1>{{ $mastodon_domain }} | Public Timeline</h1> diff --git a/resources/views/show_status.blade.php b/resources/views/show_status.blade.php @@ -7,7 +7,7 @@ <title>{{ $mastodon_domain }} | Status</title> - <link rel="stylesheet" href="/css/styles.css" /> + <link rel="stylesheet" href="{{ url('css/styles.css') }}" /> </head> <body> <h1>{{ $mastodon_domain }} | Status</h1> @@ -19,7 +19,7 @@ @endcomponent @if ($logged_in) - <form method="post" action="/status"> + <form method="post" action="{{ route('post_status') }}"> <input type="text" name="spoiler_text" diff --git a/resources/views/status.blade.php b/resources/views/status.blade.php @@ -22,22 +22,22 @@ <div class="actions"> <!-- Context --> <span title="Expand thread"> - <a href="/status/{{ $status['id'] }}/thread">&#10568;</a> + <a href="{{ route('thread', ['id' => $status['id']]) }}">&#10568;</a> </span> <!-- Reply --> <span title="Reply"> - <a href="/status/{{ $status['id'] }}">&#8629;</a> + <a href="{{ route('status', ['id' => $status['id']]) }}">&#8629;</a> </span> <!-- Reblog --> <span title="Reblog"> @if ($status['reblogged']) <span class="reblogged"> - <a href="/status/{{ $status['id'] }}/unreblog">&#8634;</a> + <a href="{{ route('unreblog', ['id' => $status['id']]) }}">&#8634;</a> </span> @else - <a href="/status/{{ $status['id'] }}/reblog">&#8634;</a> + <a href="{{ route('reblog', ['id' => $status['id']]) }}">&#8634;</a> @endif {{ $status['reblogs_count'] }} </span> @@ -46,10 +46,10 @@ <span title="Favourite"> @if ($status['favourited']) <span class="favourited"> - <a href="/status/{{ $status['id'] }}/unfavourite">&#9733;</a> + <a href="{{ route('unfavourite', ['id' => $status['id']]) }}">&#9733;</a> </span> @else - <a href="/status/{{ $status['id'] }}/favourite">&#9734;</a> + <a href="{{ route('favourite', ['id' => $status['id']]) }}">&#9734;</a> @endif {{ $status['favourites_count'] }} </span> diff --git a/routes/web.php b/routes/web.php @@ -33,20 +33,26 @@ Route::get('/status/{status_id}', 'StatusController@show_status') ->name('status'); Route::get('/status/{status_id}/reblog', 'StatusController@reblog_status') + ->name('reblog') ->middleware('authorize'); Route::get('/status/{status_id}/unreblog', 'StatusController@unreblog_status') + ->name('unreblog') ->middleware('authorize'); Route::get('/status/{status_id}/favourite', 'StatusController@favourite_status') + ->name('favourite') ->middleware('authorize'); Route::get('/status/{status_id}/unfavourite', 'StatusController@unfavourite_status') + ->name('unfavourite') ->middleware('authorize'); -Route::get('/status/{status_id}/thread', 'StatusController@context'); +Route::get('/status/{status_id}/thread', 'StatusController@context') + ->name('thread'); Route::post('/status', 'StatusController@post_status') + ->name('post_status') ->middleware('authorize'); Route::get('/notifications', 'NotificationsController@get_notifications')