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.
This commit is contained in:
St John Karp 2018-09-09 20:55:08 -07:00
parent 0247f8b57e
commit d0e5b5fe67
8 changed files with 22 additions and 16 deletions

View File

@ -7,7 +7,7 @@
<title>{{ $mastodon_domain }} | Thread</title> <title>{{ $mastodon_domain }} | Thread</title>
<link rel="stylesheet" href="/css/styles.css" /> <link rel="stylesheet" href="{{ url('css/styles.css') }}" />
</head> </head>
<body> <body>
<h1>{{ $mastodon_domain }} | Thread</h1> <h1>{{ $mastodon_domain }} | Thread</h1>

View File

@ -7,7 +7,7 @@
<title>{{ $mastodon_domain }} | Timeline</title> <title>{{ $mastodon_domain }} | Timeline</title>
<link rel="stylesheet" href="/css/styles.css" /> <link rel="stylesheet" href="{{ url('css/styles.css') }}" />
</head> </head>
<body> <body>
<h1>{{ $mastodon_domain }} | Timeline</h1> <h1>{{ $mastodon_domain }} | Timeline</h1>

View File

@ -1,7 +1,7 @@
<nav> <nav>
<ul> <ul>
<li><a href="/timeline/home">Timeline</a></li> <li><a href="{{ route('home') }}">Timeline</a></li>
<li><a href="/timeline/public">Public Timeline</a></li> <li><a href="{{ route('public') }}">Public Timeline</a></li>
<li><a href="/notifications">Notifications</a></li> <li><a href="{{ route('notifications') }}">Notifications</a></li>
</ul> </ul>
</nav> </nav>

View File

@ -7,7 +7,7 @@
<title>{{ $mastodon_domain }} | Notifications</title> <title>{{ $mastodon_domain }} | Notifications</title>
<link rel="stylesheet" href="/css/styles.css" /> <link rel="stylesheet" href="{{ url('css/styles.css') }}" />
</head> </head>
<body> <body>
<h1>{{ $mastodon_domain }} | Notifications</h1> <h1>{{ $mastodon_domain }} | Notifications</h1>

View File

@ -7,7 +7,7 @@
<title>{{ $mastodon_domain }} | Public Timeline</title> <title>{{ $mastodon_domain }} | Public Timeline</title>
<link rel="stylesheet" href="/css/styles.css" /> <link rel="stylesheet" href="{{ url('css/styles.css') }}" />
</head> </head>
<body> <body>
<h1>{{ $mastodon_domain }} | Public Timeline</h1> <h1>{{ $mastodon_domain }} | Public Timeline</h1>

View File

@ -7,7 +7,7 @@
<title>{{ $mastodon_domain }} | Status</title> <title>{{ $mastodon_domain }} | Status</title>
<link rel="stylesheet" href="/css/styles.css" /> <link rel="stylesheet" href="{{ url('css/styles.css') }}" />
</head> </head>
<body> <body>
<h1>{{ $mastodon_domain }} | Status</h1> <h1>{{ $mastodon_domain }} | Status</h1>
@ -19,7 +19,7 @@
@endcomponent @endcomponent
@if ($logged_in) @if ($logged_in)
<form method="post" action="/status"> <form method="post" action="{{ route('post_status') }}">
<input <input
type="text" type="text"
name="spoiler_text" name="spoiler_text"

View File

@ -22,22 +22,22 @@
<div class="actions"> <div class="actions">
<!-- Context --> <!-- Context -->
<span title="Expand thread"> <span title="Expand thread">
<a href="/status/{{ $status['id'] }}/thread">&#10568;</a> <a href="{{ route('thread', ['id' => $status['id']]) }}">&#10568;</a>
</span> </span>
<!-- Reply --> <!-- Reply -->
<span title="Reply"> <span title="Reply">
<a href="/status/{{ $status['id'] }}">&#8629;</a> <a href="{{ route('status', ['id' => $status['id']]) }}">&#8629;</a>
</span> </span>
<!-- Reblog --> <!-- Reblog -->
<span title="Reblog"> <span title="Reblog">
@if ($status['reblogged']) @if ($status['reblogged'])
<span class="reblogged"> <span class="reblogged">
<a href="/status/{{ $status['id'] }}/unreblog">&#8634;</a> <a href="{{ route('unreblog', ['id' => $status['id']]) }}">&#8634;</a>
</span> </span>
@else @else
<a href="/status/{{ $status['id'] }}/reblog">&#8634;</a> <a href="{{ route('reblog', ['id' => $status['id']]) }}">&#8634;</a>
@endif @endif
{{ $status['reblogs_count'] }} {{ $status['reblogs_count'] }}
</span> </span>
@ -46,10 +46,10 @@
<span title="Favourite"> <span title="Favourite">
@if ($status['favourited']) @if ($status['favourited'])
<span class="favourited"> <span class="favourited">
<a href="/status/{{ $status['id'] }}/unfavourite">&#9733;</a> <a href="{{ route('unfavourite', ['id' => $status['id']]) }}">&#9733;</a>
</span> </span>
@else @else
<a href="/status/{{ $status['id'] }}/favourite">&#9734;</a> <a href="{{ route('favourite', ['id' => $status['id']]) }}">&#9734;</a>
@endif @endif
{{ $status['favourites_count'] }} {{ $status['favourites_count'] }}
</span> </span>

View File

@ -33,20 +33,26 @@ Route::get('/status/{status_id}', 'StatusController@show_status')
->name('status'); ->name('status');
Route::get('/status/{status_id}/reblog', 'StatusController@reblog_status') Route::get('/status/{status_id}/reblog', 'StatusController@reblog_status')
->name('reblog')
->middleware('authorize'); ->middleware('authorize');
Route::get('/status/{status_id}/unreblog', 'StatusController@unreblog_status') Route::get('/status/{status_id}/unreblog', 'StatusController@unreblog_status')
->name('unreblog')
->middleware('authorize'); ->middleware('authorize');
Route::get('/status/{status_id}/favourite', 'StatusController@favourite_status') Route::get('/status/{status_id}/favourite', 'StatusController@favourite_status')
->name('favourite')
->middleware('authorize'); ->middleware('authorize');
Route::get('/status/{status_id}/unfavourite', 'StatusController@unfavourite_status') Route::get('/status/{status_id}/unfavourite', 'StatusController@unfavourite_status')
->name('unfavourite')
->middleware('authorize'); ->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') Route::post('/status', 'StatusController@post_status')
->name('post_status')
->middleware('authorize'); ->middleware('authorize');
Route::get('/notifications', 'NotificationsController@get_notifications') Route::get('/notifications', 'NotificationsController@get_notifications')