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 = TypeActivity::craft_create ($actor, $note);
|
||||||
|
|
||||||
|
$create_activity->to = $note->to;
|
||||||
|
$create_activity->cc = $note->cc;
|
||||||
|
|
||||||
$note->activity_id = $create_activity->id;
|
$note->activity_id = $create_activity->id;
|
||||||
$note->save ();
|
$note->save ();
|
||||||
|
|
||||||
|
@ -58,7 +58,14 @@ class HomeController extends Controller
|
|||||||
|
|
||||||
public function tag ($tag)
|
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 ()
|
public function search ()
|
||||||
|
@ -16,7 +16,9 @@ class TypeActivity {
|
|||||||
public static function craft_response (Activity $activity)
|
public static function craft_response (Activity $activity)
|
||||||
{
|
{
|
||||||
$crafted_activity = [
|
$crafted_activity = [
|
||||||
"@context" => "https://www.w3.org/ns/activitystreams",
|
"@context" => [
|
||||||
|
"https://www.w3.org/ns/activitystreams",
|
||||||
|
],
|
||||||
"id" => $activity->activity_id,
|
"id" => $activity->activity_id,
|
||||||
"type" => $activity->type,
|
"type" => $activity->type,
|
||||||
"actor" => $activity->actor,
|
"actor" => $activity->actor,
|
||||||
|
@ -209,6 +209,8 @@ class TypeActor {
|
|||||||
// we need to save the model first
|
// we need to save the model first
|
||||||
$actor->save ();
|
$actor->save ();
|
||||||
|
|
||||||
|
if (isset ($request ["attachment"]))
|
||||||
|
{
|
||||||
ProfileAttachment::where ("actor_id", $actor->id)->delete ();
|
ProfileAttachment::where ("actor_id", $actor->id)->delete ();
|
||||||
foreach ($request ["attachment"] as $attachment)
|
foreach ($request ["attachment"] as $attachment)
|
||||||
{
|
{
|
||||||
@ -218,6 +220,7 @@ class TypeActor {
|
|||||||
"content" => $attachment ["value"]
|
"content" => $attachment ["value"]
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$featured_items = TypeActor::actor_process_featured ($actor);
|
$featured_items = TypeActor::actor_process_featured ($actor);
|
||||||
ProfilePin::where ("actor_id", $actor->id)->delete ();
|
ProfilePin::where ("actor_id", $actor->id)->delete ();
|
||||||
|
@ -88,6 +88,9 @@ class TypeNote
|
|||||||
"tag" => $request ["tag"] ?? null,
|
"tag" => $request ["tag"] ?? null,
|
||||||
|
|
||||||
// TODO: This should change when I implement visibilities and private notes
|
// TODO: This should change when I implement visibilities and private notes
|
||||||
|
"to" => [
|
||||||
|
"https://www.w3.org/ns/activitystreams#Public"
|
||||||
|
],
|
||||||
"cc" => [
|
"cc" => [
|
||||||
$actor->followers
|
$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>
|
</tr>
|
||||||
|
|
||||||
@foreach ($processed_notifications as $notification)
|
@foreach ($processed_notifications as $notification)
|
||||||
|
@if (!$notification ['actor'] || !$notification ['object'])
|
||||||
|
@continue
|
||||||
|
@endif
|
||||||
|
|
||||||
<tr @if ($notification ['read_at'] == null) style="font-weight: bold" @endif>
|
<tr @if ($notification ['read_at'] == null) style="font-weight: bold" @endif>
|
||||||
<td>
|
<td>
|
||||||
@if ($notification ['type'] == 'Signup')
|
@if ($notification ['type'] == 'Signup')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user