DB edit: description to public_comments

the update process now compiles public comments from instance blocklists
and displays them, so the name of the table that stores these comments
has been changed so it's not confusing.

also made the appropriate changes on the backend and in the template
that shows that information
This commit is contained in:
ro 2024-09-29 16:34:52 -06:00
parent 098cd72186
commit 8353d154c4
5 changed files with 22 additions and 20 deletions

View file

@ -80,7 +80,7 @@ class FrontIndexController extends Controller
}
$links = explode(',', $location->archive_links);
$comments = explode('+', $location->description);
$comments = explode('+', $location->public_comments);
return view('front.location', [
'title' => str_replace(".", " ", $name),
'location' => $location,

View file

@ -24,7 +24,7 @@ class Location extends Model
"uuid",
"name",
"url",
"description",
"public_comments",
"images",
"active",
"rating",

View file

@ -83,7 +83,7 @@ class UpdateService
//clear out all previous descriptions
foreach ($locations as $loc) {
$loc->description = ' ';
$loc->public_comments = ' ';
$loc->save();
}
@ -101,9 +101,9 @@ class UpdateService
$location->silence_vote = $item['silence_vote'];
//clear descriptions
if (!is_null($item['comment']) || !$item['comment'] != " ") {
$location->description = $item['comment'];
$location->public_comments = $item['comment'];
} else {
$location->description = 'description pending';
$location->public_comments = 'Comments Pending';
}
$location->actions_count = $item['block_count'] + $item['silence_count'];
@ -131,20 +131,20 @@ class UpdateService
}
$new = Location::create([
'uuid' => Uuid::uuid4(),
'name' => $item['url'],
'url' => $item['url'],
'description' => ($item['comment'] != null) ? $item['comment'] : "no description",
'active' => $status,
'rating' => $rating,
'added_by' => 1,
'tags' => 'poor moderation, hate speech',
'images' => json_encode($images),
'block_count' => $item['block_count'],
'block_vote' => $item['block_vote'],
'silence_count' => $item['silence_count'],
'silence_vote' => $item['silence_vote'],
'actions_cont' => $item['block_count'] + $item['silence_count']
'uuid' => Uuid::uuid4(),
'name' => $item['url'],
'url' => $item['url'],
'public_comments' => ($item['comment'] != null) ? $item['comment'] : "comments pending",
'active' => $status,
'rating' => $rating,
'added_by' => 1,
'tags' => 'poor moderation, hate speech',
'images' => json_encode($images),
'block_count' => $item['block_count'],
'block_vote' => $item['block_vote'],
'silence_count' => $item['silence_count'],
'silence_vote' => $item['silence_vote'],
'actions_cont' => $item['block_count'] + $item['silence_count']
]);
}
}

View file

@ -11,8 +11,10 @@
@csrf
<label>Edit Location Name</label><br>
<input type="text" name="name" value="{{$location->name}}" /><br>
<!--
<label>Edit Location Comments</label><br>
<textarea name="description">{{$location->description}}</textarea><br>
-->
<label>Edit Reference Links (comma seperated)</label><br>
<textarea name="archive_links">{{$location->archive_links}}</textarea><br>
<label>Edit Reference Images</label><br>

View file

@ -6,7 +6,7 @@
@parent
<section>
<article>
<h2>Description</h2>
<h2>Public Comments</h2>
@foreach($comments as $comment)
@if($comment != " " && $comment != '')
{{trim($comment)}}<br /><br />