Tweaking of code, along with deleting cached view files have got tests working locally again
This commit is contained in:
parent
721cbc541b
commit
c50d8a7b51
10 changed files with 56 additions and 50 deletions
|
@ -3,7 +3,6 @@
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Article;
|
use App\Article;
|
||||||
use Illuminate\Http\Response;
|
|
||||||
use Jonnybarnes\IndieWeb\Numbers;
|
use Jonnybarnes\IndieWeb\Numbers;
|
||||||
|
|
||||||
class ArticlesController extends Controller
|
class ArticlesController extends Controller
|
||||||
|
@ -20,7 +19,7 @@ class ArticlesController extends Controller
|
||||||
->orderBy('updated_at', 'desc')
|
->orderBy('updated_at', 'desc')
|
||||||
->simplePaginate(5);
|
->simplePaginate(5);
|
||||||
|
|
||||||
return view('multipost', ['data' => $articles]);
|
return view('articles', compact('articles'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,7 +34,7 @@ class ArticlesController extends Controller
|
||||||
throw new \Exception;
|
throw new \Exception;
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('singlepost', ['article' => $article]);
|
return view('article', compact('article'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -62,8 +61,9 @@ class ArticlesController extends Controller
|
||||||
{
|
{
|
||||||
$articles = Article::where('published', '1')->orderBy('updated_at', 'desc')->get();
|
$articles = Article::where('published', '1')->orderBy('updated_at', 'desc')->get();
|
||||||
$buildDate = $articles->first()->updated_at->toRssString();
|
$buildDate = $articles->first()->updated_at->toRssString();
|
||||||
$contents = (string) view('rss', ['articles' => $articles, 'buildDate' => $buildDate]);
|
|
||||||
|
|
||||||
return (new Response($contents, '200'))->header('Content-Type', 'application/rss+xml');
|
return response()
|
||||||
|
->view('rss', compact('articles', 'buildDate'), 200)
|
||||||
|
->header('Content-Type', 'application/rss+xml');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ class ContactsController extends Controller
|
||||||
'/assets/profile-images/default-image';
|
'/assets/profile-images/default-image';
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('contacts', ['contacts' => $contacts]);
|
return view('contacts', compact('contacts'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -63,7 +63,7 @@ class NotesController extends Controller
|
||||||
|
|
||||||
$homepage = ($request->path() == '/');
|
$homepage = ($request->path() == '/');
|
||||||
|
|
||||||
return view('allnotes', ['notes' => $notes, 'homepage' => $homepage]);
|
return view('notes', compact('notes', 'homepage'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -161,12 +161,7 @@ class NotesController extends Controller
|
||||||
}
|
}
|
||||||
$note->photoURLs = $photoURLs;
|
$note->photoURLs = $photoURLs;
|
||||||
|
|
||||||
return view('singlenote', [
|
return view('note', compact('note', 'replies', 'reposts', 'likes'));
|
||||||
'note' => $note,
|
|
||||||
'replies' => $replies,
|
|
||||||
'reposts' => $reposts,
|
|
||||||
'likes' => $likes,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -201,7 +196,7 @@ class NotesController extends Controller
|
||||||
$note->human_time = $note->updated_at->diffForHumans();
|
$note->human_time = $note->updated_at->diffForHumans();
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('taggednotes', ['notes' => $notes, 'tag' => $tag]);
|
return view('taggednotes', compact('notes', 'tag'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
36
resources/views/articles.blade.php
Normal file
36
resources/views/articles.blade.php
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
@extends('master')
|
||||||
|
|
||||||
|
@section('title')
|
||||||
|
Articles «
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
|
||||||
|
@if (count($articles) == 0)
|
||||||
|
<p>No articles exist for this time.</p>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@foreach ($articles as $article)
|
||||||
|
@if ($article->url != '')<article class="link h-entry">@else<article class="h-entry">@endif
|
||||||
|
<header>
|
||||||
|
<h1 class="p-name">
|
||||||
|
@if($article->url == '')
|
||||||
|
<a href="{{ $article->link }}">{{ $article->title }}</a>
|
||||||
|
@else
|
||||||
|
<a href="{{ $article->url }}">{{ $article->title }}</a>
|
||||||
|
@endif
|
||||||
|
</h1>
|
||||||
|
<span class="post-info">Posted <time class="dt-published" title="{{ $article->tooltip_time }}" datetime="{{ $article->w3c_time }}">{{ $article->human_time }}</time> - <a title="Permalink" href="{{ $article->link }}">⚓</a></span>
|
||||||
|
</header>
|
||||||
|
<div class="e-content">
|
||||||
|
{!! $article['main'] !!}
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
@endforeach
|
||||||
|
{{ $articles->links() }}
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('scripts')
|
||||||
|
<script src="/assets/prism/prism.js"></script>
|
||||||
|
<link rel="stylesheet" href="/assets/prism/prism.css">
|
||||||
|
@stop
|
|
@ -6,6 +6,6 @@ Contacts «
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
@foreach($contacts as $contact)
|
@foreach($contacts as $contact)
|
||||||
@include('templates.contact', array('contact' => $contact))
|
@include('templates.contact', ['contact' => $contact])
|
||||||
@endforeach
|
@endforeach
|
||||||
@stop
|
@stop
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
@extends('master')
|
|
||||||
|
|
||||||
@section('title')
|
|
||||||
Articles «
|
|
||||||
@stop
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
@if (count($data) == 0)
|
|
||||||
<p>No articles exist for this time.</p>
|
|
||||||
@endif
|
|
||||||
@foreach ($data as $article)
|
|
||||||
@if ($article['url'] != '')<article class="link h-entry">@else<article class="h-entry">@endif
|
|
||||||
<header>
|
|
||||||
<h1 class="p-name">
|
|
||||||
<a href="@if($article['url'] == ''){{ $article['link'] }}@else{{ $article['url'] }}@endif">{{ $article['title'] }}</a>
|
|
||||||
</h1>
|
|
||||||
<span class="post-info">Posted <time class="dt-published" title="{{ $article['tooltip_time'] }}" datetime="{{ $article['w3c_time'] }}">{{ $article['human_time'] }}</time> - <a title="Permalink" href="{{ $article['link'] }}">⚓</a></span>
|
|
||||||
</header>
|
|
||||||
<div class="e-content">
|
|
||||||
{!! $article['main'] !!}
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
@endforeach
|
|
||||||
{!! $data->render() !!}
|
|
||||||
@stop
|
|
||||||
|
|
||||||
@section('scripts')
|
|
||||||
<script src="/assets/prism/prism.js"></script>
|
|
||||||
<link rel="stylesheet" href="/assets/prism/prism.css">
|
|
||||||
@stop
|
|
|
@ -11,7 +11,12 @@
|
||||||
@foreach($articles as $article)
|
@foreach($articles as $article)
|
||||||
<item>
|
<item>
|
||||||
<title>{{ strip_tags($article->title) }}</title>
|
<title>{{ strip_tags($article->title) }}</title>
|
||||||
<description><![CDATA[{{ $article->main }}@if($article->url)<p><a href="{{ config('app.url') }}{{ $article->link }}">Permalink</a></p>@endif]]></description>
|
<description>
|
||||||
|
<![CDATA[
|
||||||
|
{{ $article->main }}
|
||||||
|
@if($article->url)<p><a href="{{ config('app.url') }}{{ $article->link }}">Permalink</a></p>@endif
|
||||||
|
]]>
|
||||||
|
</description>
|
||||||
<link>@if($article->url != ''){{ $article->url }}@else{{ config('app.url') }}{{ $article->link }}@endif</link>
|
<link>@if($article->url != ''){{ $article->url }}@else{{ config('app.url') }}{{ $article->link }}@endif</link>
|
||||||
<guid>{{ config('app.url') }}{{ $article->link }}</guid>
|
<guid>{{ config('app.url') }}{{ $article->link }}</guid>
|
||||||
<pubDate>{{ $article->pubdate }}</pubDate>
|
<pubDate>{{ $article->pubdate }}</pubDate>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue