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>
<link rel="stylesheet" href="/css/styles.css" />
<link rel="stylesheet" href="{{ url('css/styles.css') }}" />
</head>
<body>
<h1>{{ $mastodon_domain }} | Thread</h1>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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"

View File

@ -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>

View File

@ -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')