added a very simple tag page
This commit is contained in:
parent
7e3b868a90
commit
d2a2e466ef
@ -391,6 +391,10 @@ class APOutboxController extends Controller
|
||||
}
|
||||
|
||||
$create_activity = TypeActivity::craft_create ($actor, $note);
|
||||
|
||||
$create_activity->to = $note->to;
|
||||
$create_activity->cc = $note->cc;
|
||||
|
||||
$note->activity_id = $create_activity->id;
|
||||
$note->save ();
|
||||
|
||||
|
@ -58,7 +58,14 @@ class HomeController extends Controller
|
||||
|
||||
public function tag ($tag)
|
||||
{
|
||||
dd ($tag);
|
||||
$tag_name = "#" . $tag;
|
||||
$hashtag = Hashtag::where ("name", $tag_name)->first ();
|
||||
if (!$hashtag)
|
||||
return redirect ()->route ("browse");
|
||||
|
||||
$posts = $hashtag->get_notes ()->paginate (20);
|
||||
|
||||
return view ("posts.tag", compact ("hashtag", "posts"));
|
||||
}
|
||||
|
||||
public function search ()
|
||||
|
@ -16,7 +16,9 @@ class TypeActivity {
|
||||
public static function craft_response (Activity $activity)
|
||||
{
|
||||
$crafted_activity = [
|
||||
"@context" => "https://www.w3.org/ns/activitystreams",
|
||||
"@context" => [
|
||||
"https://www.w3.org/ns/activitystreams",
|
||||
],
|
||||
"id" => $activity->activity_id,
|
||||
"type" => $activity->type,
|
||||
"actor" => $activity->actor,
|
||||
|
@ -209,14 +209,17 @@ class TypeActor {
|
||||
// we need to save the model first
|
||||
$actor->save ();
|
||||
|
||||
ProfileAttachment::where ("actor_id", $actor->id)->delete ();
|
||||
foreach ($request ["attachment"] as $attachment)
|
||||
if (isset ($request ["attachment"]))
|
||||
{
|
||||
$profile_attachment = ProfileAttachment::create ([
|
||||
"actor_id" => $actor->id,
|
||||
"name" => $attachment ["name"],
|
||||
"content" => $attachment ["value"]
|
||||
]);
|
||||
ProfileAttachment::where ("actor_id", $actor->id)->delete ();
|
||||
foreach ($request ["attachment"] as $attachment)
|
||||
{
|
||||
$profile_attachment = ProfileAttachment::create ([
|
||||
"actor_id" => $actor->id,
|
||||
"name" => $attachment ["name"],
|
||||
"content" => $attachment ["value"]
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
$featured_items = TypeActor::actor_process_featured ($actor);
|
||||
|
@ -88,6 +88,9 @@ class TypeNote
|
||||
"tag" => $request ["tag"] ?? null,
|
||||
|
||||
// TODO: This should change when I implement visibilities and private notes
|
||||
"to" => [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"cc" => [
|
||||
$actor->followers
|
||||
]
|
||||
|
20
resources/views/posts/tag.blade.php
Normal file
20
resources/views/posts/tag.blade.php
Normal file
@ -0,0 +1,20 @@
|
||||
@extends ("partials.layout")
|
||||
|
||||
@section ("title", "Posts Tagged with " . $hashtag->name)
|
||||
|
||||
@section ("content")
|
||||
<div class="simple-container">
|
||||
<h1>Showing posts with tag: {{ $hashtag->name }}</h1>
|
||||
<br>
|
||||
|
||||
<table class="comments-table" cellspacing="0" cellpadding="3" bordercollor="#ffffff" border="1">
|
||||
<tbody>
|
||||
@foreach ($posts as $post)
|
||||
<x-comment_block :post="$post" />
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{{ $posts->links("pagination::default") }}
|
||||
</div>
|
||||
@endsection
|
@ -16,6 +16,10 @@
|
||||
</tr>
|
||||
|
||||
@foreach ($processed_notifications as $notification)
|
||||
@if (!$notification ['actor'] || !$notification ['object'])
|
||||
@continue
|
||||
@endif
|
||||
|
||||
<tr @if ($notification ['read_at'] == null) style="font-weight: bold" @endif>
|
||||
<td>
|
||||
@if ($notification ['type'] == 'Signup')
|
||||
|
Loading…
x
Reference in New Issue
Block a user