Compare commits

..

No commits in common. "develop" and "a0.06" have entirely different histories.

29 changed files with 778 additions and 1466 deletions

2
.gitignore vendored
View file

@ -4,8 +4,6 @@
/public/hot /public/hot
/public/storage /public/storage
/public/reference /public/reference
/public/assets/images/references
/public/assets/images/members
/storage/*.key /storage/*.key
/vendor /vendor
.env .env

View file

@ -34,6 +34,14 @@ class DenController extends Controller
]); ]);
} }
public function member(Request $request)
{
$member = Auth::user();
return view('back.member', [
'handle' => $member->handle,
'title' => "Manage Members"]);
}
public function locations(Request $request) public function locations(Request $request)
{ {
$member = Auth::user(); $member = Auth::user();

View file

@ -46,12 +46,12 @@ class ExportController extends Controller
$sources = Source::where("active", true)->get(); $sources = Source::where("active", true)->get();
if ($type == 'mastodon') { if ($type == 'mastodon') {
$columns = [ $columns = [
'#domain', 'domain',
'#severity', 'severity',
'#public_comment', 'public_comment',
'#reject_media', 'reject_media',
'#reject_reports', 'reject_reports',
'#obfuscate', 'obfuscate',
]; ];
}; };
@ -60,18 +60,13 @@ class ExportController extends Controller
if ($rate * 100 >= $percent) { if ($rate * 100 >= $percent) {
if ($type == 'mastodon') { if ($type == 'mastodon') {
//comman break teh CSV so just take them out //comman break teh CSV so just take them out
$comments = str_replace(",", ";", $location->public_comments); $comments = str_replace(",", ";", $location->description);
//remove extra white space //remove extra white space
$comments = str_replace(["\n\r", "\n", "\r"], " ", $comments); $comments = str_replace(["\n\r", "\n", "\r"], " ", $comments);
$comments = str_replace(['"', "'"], "", $comments); $comments = str_replace(['"', "'"], "", $comments);
if ($location->rating == 'defederate') {
$rating = 'suspend';
} else {
$rating = $location->rating;
}
//add to the export list //add to the export list
array_push($list, [$location->url, $rating, $comments, "FALSE", "FALSE", "FALSE"]); array_push($list, [$location->url, $location->rating, $comments, "FALSE", "FALSE", "FALSE"]);
} }
} }
} }

View file

@ -76,19 +76,15 @@ class FrontIndexController extends Controller
} }
if (isset($member->role)) { if (isset($member->role)) {
($member->role == 0 || $member->role == 1) ? $edit = true : $edit = false; ($member->role == 1 || $member->role == 2) ? $edit = true : $edit = false;
} }
$links = explode(',', $location->archive_links);
$comments = explode('+', $location->public_comments);
return view('front.location', [ return view('front.location', [
'title' => str_replace(".", " ", $name), 'title' => str_replace(".", " ", $name),
'location' => $location, 'location' => $location,
'comments' => $comments,
'actions' => $location->block_count + $location->silence_count, 'actions' => $location->block_count + $location->silence_count,
'sources_count' => count($sources), 'sources_count' => count($sources),
'images' => json_decode($location->images), 'images' => json_decode($location->images),
'links' => $links,
'updated' => $location->updated_at->format('Y M d'), 'updated' => $location->updated_at->format('Y M d'),
'edit' => $edit 'edit' => $edit
]); ]);

View file

@ -5,7 +5,6 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\Services\UpdateService; use App\Services\UpdateService;
use App\Repositories\LocationRepository; use App\Repositories\LocationRepository;
use Illuminate\Support\Facades\Auth;
class LocationController extends Controller class LocationController extends Controller
{ {
@ -19,51 +18,34 @@ class LocationController extends Controller
$this->location = $locationRepository; $this->location = $locationRepository;
} }
//actions
public function updateLocations() public function updateLocations()
{ {
//role check $result = $this->update->data();
$member = Auth::user();
if ($member->role == 0) { return back()->with(
$result = $this->update->data(); 'message',
return back()->with( $result
'message', );
$result
);
} else {
return back()->withErrors('message', 'Nah, you don\'t have permission to do this');
}
} }
public function compileLocations() public function compileLocations()
{ {
//role check $result = $this->update->list();
$member = Auth::user();
if ($member->role == 0) { return back()->with(
$result = $this->update->list(); 'message',
return back()->with( $result
'message', );
$result
);
} else {
return back()->withErrors('message', 'Nah, you don\'t have permission to do this');
}
} }
public function editLocation(Request $request) public function editLocation(Request $request)
{ {
$token = csrf_token(); $token = csrf_token();
//role check $response = $this->location->editLocation($request);
$member = Auth::user(); if ($response['status']) {
if ($member->role == 0 || $member->role == 1) { return back()->with('message', $response['message']);
$response = $this->location->editLocation($request);
if ($response['status']) {
return back()->with('message', $response['message']);
} else {
return back()->withErrors('message', $response['message']);
}
} else { } else {
return back()->withErrors('message', 'Nah, you don\'t have permission to do this'); return back()->withErrors('message', $response['message']);
} }
} }
} }

View file

@ -1,154 +0,0 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Repositories\MemberRepository;
class MemberController extends Controller
{
protected $member;
public function __construct(
MemberRepository $memberRepo
) {
$this->member = $memberRepo;
}
public function index(Request $request)
{
$member = Auth::user();
return view('back.member', [
'handle' => $member->handle,
'members' => $this->member->getAll(),
'mode' => 'index',
'title' => "Manage Members"]);
}
public function profile(Request $request)
{
$member = Auth::user();
$avi = '';
if ($member->avatar == 'default-member-avatar') {
$avi = '/assets/images/global/default-avi.png';
} else {
$avi = $member->avatar;
}
return view('back.profile', [
'title' => "Hey, it's you!",
'handle' => $member->handle,
'email' => $member->email,
'avatar' => $avi,
'pronouns' => $member->pronoun,
'uuid' => $member->uuid,
'role' => $member->role
]);
}
public function editMember(Request $request, $uuid = 0)
{
$member = $this->member->get($uuid);
$avi = '';
if ($member->avatar == 'default-member-avatar') {
$avi = '/assets/images/global/default-avi.png';
} else {
$avi = $member->avatar;
}
return view('back.member', [
'member' => $member,
'avatar' => $avi,
'mode' => 'member-edit',
'title' => "Edit Member Info"]);
}
public function createMember(Request $Request)
{
return view('back.member', [
'mode' => 'member-create',
'title' => "Make a new friend"]);
}
//actions
public function profileEdit(Request $request)
{
$token = csrf_token();
//check if logged in member id matches profile request id
$member = Auth::user();
if ($member->uuid == $request->id) {
//validate required fields
$valid = $request->validate([
'handle' => ['required'],
'email' => ['required'],
]);
if ($valid) {
$response = $this->member->editProfile($request);
if ($response['status'] == true) {
return back()->with('message', $response['message']);
} else {
return back()->withErrors([$response['message']]);
}
} else {
return back()->withErrors(['Misssing some required info, homie.']);
}
} else {
return back()->withErrors(['This is not your profile to edit.']);
}
}
public function memberEdit(Request $request)
{
$token = csrf_token();
//role check
$member = Auth::user();
if ($member->role == 0) {
$valid = $request->validate([
'handle' => ['required'],
'email' => ['required'],
'role' => ['required']
]);
if ($valid) {
$response = $this->member->edit($request);
if ($response['status'] == true) {
return back()->with('message', $response['message']);
} else {
return back()->withErrors([$response['message']]);
}
} else {
return back()->withErrors(['Misssing some required info, homie.']);
}
} else {
return back()->withErrors(['Nah, you can\'t do this. Wrong permissions.']);
}
}
public function memberCreate(Request $request)
{
$token = csrf_token();
$member = Auth::user();
if ($member->role == 0) {
$valid = $request->validate([
'handle' => ['required'],
'email' => ['required'],
'role' => ['required'],
'pronouns' => ['required'],
'fresh_pass' => ['required'],
'fresh_pass_confirm' => ['required'],
]);
if ($valid) {
$response = $this->member->add($request);
if ($response['status'] == true) {
return redirect('/den/member')->with('message', $response['message']);
} else {
return back()->withErrors([$response['message']]);
}
} else {
return back()->withErrors(['Misssing some required info, homie.']);
}
} else {
return back()->withErrors(['Nah, you can\'t do this. Wrong permissions.']);
}
}
}

View file

@ -24,7 +24,7 @@ class Location extends Model
"uuid", "uuid",
"name", "name",
"url", "url",
"public_comments", "description",
"images", "images",
"active", "active",
"rating", "rating",
@ -35,7 +35,6 @@ class Location extends Model
"created_at", "created_at",
"updated_at", "updated_at",
"actions_count", "actions_count",
"archive_links", "archive_links"
"notes",
]; ];
} }

View file

@ -9,20 +9,6 @@ class Member extends Authenticatable
{ {
use HasFactory; use HasFactory;
public $timestamps = false; protected $table = "member";
protected $table = "member"; protected $fillable = ["uuid", "handle", "email", "password", "active", "role", "avatar", "pronoun", "gender"];
protected $primaryKey = 'id';
public $incrementing = true;
protected $fillable = [
"uuid",
"handle",
"email",
"password",
"active",
"role",
"avatar",
"pronoun",
"created_at",
"last_login"
];
} }

View file

@ -5,12 +5,10 @@ namespace App\Providers;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
use App\Repositories\LocationRepository; use App\Repositories\LocationRepository;
use App\Repositories\SourceRepository; use App\Repositories\SourceRepository;
use App\Repositories\MemberRepository;
use App\Services\UpdateService; use App\Services\UpdateService;
use App\Services\MaintenanceService; use App\Services\MaintenanceService;
use App\Models\Location; use App\Models\Location;
use App\Models\Source; use App\Models\Source;
use App\Models\Member;
class AppServiceProvider extends ServiceProvider class AppServiceProvider extends ServiceProvider
{ {
@ -27,10 +25,6 @@ class AppServiceProvider extends ServiceProvider
return new SourceRepository(new Source()); return new SourceRepository(new Source());
}); });
$this->app->bind(MemberRepository::class, function ($app) {
return new MemberRepository(new Member());
});
$this->app->bind(UpdateService::class, function ($app) { $this->app->bind(UpdateService::class, function ($app) {
return new UpdateService( return new UpdateService(
new LocationRepository(new Location()), new LocationRepository(new Location()),

View file

@ -56,34 +56,24 @@ class LocationRepository
public function editLocation($request) public function editLocation($request)
{ {
$location = $this->getLocation($request->id); $location = $this->getLocation($request->id);
$publicPath = '../public/'; $images = [];
$refPath = 'assets/images/references/' . $location->uuid;
$images = [];
if ($request->hasfile("references")) { if ($request->hasfile("references")) {
foreach ($request->references as $file) { foreach ($request->references as $file) {
if (!is_dir($publicPath . $refPath)) { $path = $file->store('reference');
mkdir($publicPath . $refPath, 0755, true); array_push($images, ["path" => $path]);
}
$filename = urlencode($file->getClientOriginalName());
$file->move($publicPath . $refPath, $filename);
//$path = $file->store('reference');
array_push($images, ["path" => '/' . $refPath . '/' . $filename]);
} }
} }
if (!empty($images)) { $request->merge(['images' => json_encode($images)]);
$request->merge(['images' => json_encode($images)]);
$location->images = json_encode($images);
}
$location->name = $request->name; $location->name = $request->name;
$location->notes = $request->notes; $location->description = $request->description;
$location->archive_links = $request->archive_links; $location->archive_links = $request->archive_links;
$location->images = json_encode($images);
$result = []; $result = [];
if ($location->save()) { if ($location->save()) {
return ['status' => true, 'message' => "Location Editited" . $request->hasfile("references")]; return ['status' => true, 'message' => "Location Editited -IMG- " . $request->hasfile("references")];
} else { } else {
return ['status' => false, 'message' => "Location Not Editited"]; return ['status' => false, 'message' => "Location Not Editited"];
} }

View file

@ -1,127 +0,0 @@
<?php
namespace App\Repositories;
use App\Models\Member;
use Illuminate\Support\Facades\Hash;
use Ramsey\Uuid\Uuid;
use Carbon\Carbon;
class MemberRepository
{
protected $model;
public function __construct(Member $model)
{
$this->model = $model;
}
public function getAll()
{
return $this->model::all();
}
public function get($uuid)
{
return $this->model::where("uuid", $uuid)->first();
}
public function edit($request)
{
//get member to edit
$member = $this->get($request->id);
//save new avi if available
$publicPath = '../public/';
$refPath = 'assets/images/members/' . $member->uuid;
if ($request->hasfile("fresh_avi")) {
$file = $request->fresh_avi;
if (!is_dir($publicPath . $refPath)) {
mkdir($publicPath . $refPath, 0755, true);
}
$filename = urlencode($file->getClientOriginalName());
$file->move($publicPath . $refPath, $filename);
$freshAvi = '/' . $refPath . '/' . $filename;
$member->avatar = $freshAvi;
}
$member->handle = $request->handle;
$member->email = $request->email;
$member->pronoun = $request->pronouns;
$member->role = $request->role;
$member->active = $request->status;
if ($member->save()) {
return ['status' => true, 'message' => "Member Editited"];
} else {
return ['status' => false, 'message' => "Member Not Editited"];
}
}
public function add($request)
{
$password = [];
if ($request->fresh_pass === $request->fresh_pass_confirm) {
$password = Hash::make($request->fresh_pass);
} else {
return ['status' => false, 'message' => "Passwords Do Not Match"];
}
$newFriend = $this->model::create([
'uuid' => Uuid::uuid4(),
'avatar' => 'default-member-avatar',
'handle' => $request->handle,
'email' => $request->email,
'pronoun' => $request->pronouns,
'role' => $request->role,
'active' => $request->status,
'password' => $password,
'created_at' => Carbon::now(),
'last_login' => Carbon::now(),
]);
if ($newFriend) {
return ['status' => true, 'message' => "New Friend Made!"];
} else {
return ['status' => false, 'message' => "Uh oh, New Friend Delay!"];
}
}
public function editProfile($request)
{
//get member to edit
$member = $this->get($request->id);
//save new avi if available
$publicPath = '../public/';
$refPath = 'assets/images/members/' . $member->uuid;
if ($request->hasfile("fresh_avi")) {
$file = $request->fresh_avi;
if (!is_dir($publicPath . $refPath)) {
mkdir($publicPath . $refPath, 0755, true);
}
$filename = urlencode($file->getClientOriginalName());
$file->move($publicPath . $refPath, $filename);
$freshAvi = '/' . $refPath . '/' . $filename;
$member->avatar = $freshAvi;
}
//changing password
if (isset($request->fresh_pass) && $request->fresh_pass !== '') {
if ($request->fresh_pass === $request->fresh_pass_confirm) {
$member->password = Hash::make($request->fresh_pass);
} else {
return ['status' => false, 'message' => "Passwords Do Not Match"];
}
}
$member->handle = $request->handle;
$member->email = $request->email;
$member->pronoun = $request->pronouns;
if ($member->save()) {
return ['status' => true, 'message' => "Profile Editited"];
} else {
return ['status' => false, 'message' => "Profile Not Editited"];
}
}
}

View file

@ -9,16 +9,10 @@ use GuzzleHttp\Exception\ConnectException;
class SourceRepository class SourceRepository
{ {
protected $source; protected $source;
protected $missing;
protected $updated;
protected $sources;
public function __construct(Source $source) public function __construct(Source $source)
{ {
$this->source = $source; $this->source = $source;
$this->missing = [];
$this->updated = [];
$this->sources = $source::where("active", true)->get();
} }
public function getActive() public function getActive()
@ -26,80 +20,51 @@ class SourceRepository
return $this->source::where("active", true)->get(); return $this->source::where("active", true)->get();
} }
public function updateSourceData($index = 0) public function updateSourceData()
{ {
$sources = $this->getActive();
$missing = [];
$checked = [];
//checks all the sources to refresh data //checks all the sources to refresh data
$count = count($this->sources); foreach ($sources as $source) {
if ($count == 0) { $result = [];
return [ if ($source['type'] == 'mastodon') {
'checked' => $this->updated, if ($source['token'] == null) {
'notchecked' => $this->missing, try {
'count' => $count, $result = \Mastodon::domain('https://' . $source['url'])
'updated' => 'false', ->get('/instance/domain_blocks');
]; array_push($checked, ['source' => $source->url]);
} else { } catch (ConnectException $e) {
//check index array_push($missing, ['source' => $source->url]);
if ($index <= $count - 1) { }
$source = $this->sources[$index];
$result = $this->getMastoBlocklist($source);
if (count($result) > 0) {
$source->list_data = json_encode($result);
$source->last_updated = Carbon::now();
$source->save();
array_push($this->updated, ['source' => $source->url]);
$index++;
$result = $this->updateSourceData($index);
} else { } else {
//if empty run the same index again try {
array_push($this->missing, ['source' => $source->url]); $result = \Mastodon::domain('https://' . $source['url'])
$result = $this->updateSourceData($index); ->token($source['token'])
->get('/instance/domain_blocks');
array_push($checked, ['source' => $source->url]);
} catch (ConnectException $e) {
}
}
} elseif ($source['type'] == 'custom' && $source['format'] == 'csv') {
try {
$denylist = array_map('str_getcsv', file('https://' . $source['url']));
foreach ($denylist as $item) {
array_push($result, [
'domain' => $item[0],
'severity' => $item[1],
'comment' => $item[2]]);
}
array_push($checked, ['source' => $source->url]);
} catch (Exception $e) {
array_push($missing, ['source' => $source->url]);
} }
} else {
//continue
} }
return [
'checked' => $this->updated,
'notchecked' => $this->missing,
'count' => $count,
'updated' => 'true',
];
}
}
private function getMastoBlocklist($source) $source->list_data = json_encode($result);
{ $source->last_updated = Carbon::now();
$result = []; $source->save();
if ($source['type'] == 'mastodon') {
if ($source['token'] == null) {
try {
$result = \Mastodon::domain('https://' . $source['url'])
->get('/instance/domain_blocks');
} catch (ConnectException $e) {
//TODO: Logo Errors
}
} else {
try {
$result = \Mastodon::domain('https://' . $source['url'])
->token($source['token'])
->get('/instance/domain_blocks');
} catch (ConnectException $e) {
//TODO: Logo Errors
}
}
} elseif ($source['type'] == 'custom' && $source['format'] == 'csv') {
try {
$denylist = array_map('str_getcsv', file('https://' . $source['url']));
foreach ($denylist as $item) {
array_push($result, [
'domain' => $item[0],
'severity' => $item[1],
'comment' => $item[2]]);
}
array_push($checked, ['source' => $source->url]);
} catch (Exception $e) {
array_push($missing, ['source' => $source->url]);
}
} }
return $result; return ['checked' => $checked, 'notchecked' => $missing];
} }
} }

View file

@ -23,11 +23,8 @@ class UpdateService
public function data() public function data()
{ {
$response = $this->source->updateSourceData(); $response = $this->source->updateSourceData();
if ($response['updated'] == 'true') { return count($response['checked']) . ' SOURCES UPDATED - ' .
return count($response['checked']) . ' SOURCES UPDATED'; count($response['notchecked']) . ' SOURCES NOT CHECKED';
} else {
return 'NO SOURCES PRESENT';
}
} }
public function list() public function list()
@ -36,15 +33,14 @@ class UpdateService
$fresh = 0; $fresh = 0;
$unified = []; $unified = [];
$sources = $this->source->getActive(); $sources = $this->source->getActive();
$locations = $this->location->getActiveLocations();
foreach ($sources as $source) { foreach ($sources as $source) {
//$listData = json_decode(); //$listData = json_decode();
foreach (json_decode($source->list_data) as $item) { foreach (json_decode($source->list_data) as $item) {
$index = array_search($item->domain, array_column($unified, 'url')); $index = array_search($item->domain, array_column($unified, 'url'));
if ($index) { if ($index) {
//if there is a match, update the count and comment //if there is a match, update the count
if ($item->severity == "suspend" || $item->severity == "defederate") { if ($item->severity == "suspend" || $item->severity == "defederate") {
++$unified[$index]['block_count']; ++$unified[$index]['block_count'];
array_push($unified[$index]['block_vote'], $source->url); array_push($unified[$index]['block_vote'], $source->url);
@ -52,9 +48,6 @@ class UpdateService
++$unified[$index]['silence_count']; ++$unified[$index]['silence_count'];
array_push($unified[$index]['silence_vote'], $source->url); array_push($unified[$index]['silence_vote'], $source->url);
} }
if (!is_null($item->comment) && $item->comment != ' ' && $item->comment != '') {
$unified[$index]['comment'] = $item->comment . '+' . $unified[$index]['comment'];
}
} else { } else {
$silence = 0; $silence = 0;
$suspend = 0; $suspend = 0;
@ -81,12 +74,6 @@ class UpdateService
} }
} }
//clear out all previous descriptions
foreach ($locations as $loc) {
$loc->public_comments = ' ';
$loc->save();
}
foreach ($unified as $item) { foreach ($unified as $item) {
$location = $this->location->getLocation($item['url']); $location = $this->location->getLocation($item['url']);
if ($location) { if ($location) {
@ -99,12 +86,6 @@ class UpdateService
$location->silence_count = $item['silence_count']; $location->silence_count = $item['silence_count'];
$location->silence_vote = []; $location->silence_vote = [];
$location->silence_vote = $item['silence_vote']; $location->silence_vote = $item['silence_vote'];
//clear descriptions
if (!is_null($item['comment']) || !$item['comment'] != " ") {
$location->public_comments = $item['comment'];
} else {
$location->public_comments = 'Comments Pending';
}
$location->actions_count = $item['block_count'] + $item['silence_count']; $location->actions_count = $item['block_count'] + $item['silence_count'];
@ -131,20 +112,20 @@ class UpdateService
} }
$new = Location::create([ $new = Location::create([
'uuid' => Uuid::uuid4(), 'uuid' => Uuid::uuid4(),
'name' => $item['url'], 'name' => $item['url'],
'url' => $item['url'], 'url' => $item['url'],
'public_comments' => ($item['comment'] != null) ? $item['comment'] : "comments pending", 'description' => ($item['comment'] != null) ? $item['comment'] : "no description",
'active' => $status, 'active' => $status,
'rating' => $rating, 'rating' => $rating,
'added_by' => 1, 'added_by' => 1,
'tags' => 'poor moderation, hate speech', 'tags' => 'poor moderation, hate speech',
'images' => json_encode($images), 'images' => json_encode($images),
'block_count' => $item['block_count'], 'block_count' => $item['block_count'],
'block_vote' => $item['block_vote'], 'block_vote' => $item['block_vote'],
'silence_count' => $item['silence_count'], 'silence_count' => $item['silence_count'],
'silence_vote' => $item['silence_vote'], 'silence_vote' => $item['silence_vote'],
'actions_cont' => $item['block_count'] + $item['silence_count'] 'actions_cont' => $item['block_count'] + $item['silence_count']
]); ]);
} }
} }

View file

@ -1,40 +1,23 @@
{ {
"name": "project/thebadspace", "name": "laravel/laravel",
"type": "moderation", "type": "project",
"description": "A tool for improving independent social media curation", "description": "The skeleton application for the Laravel framework.",
"version": "0.7-alpha", "keywords": ["laravel", "framework"],
"keywords": [ "license": "MIT",
"thebadspace", "require": {
"tbs", "php": "^8.1",
"activty-pub", "guzzlehttp/guzzle": "^7.2",
"laravel", "laravel/framework": "^10.10",
"framework", "laravel/sanctum": "^3.2",
"moderation", "laravel/tinker": "^2.8",
"safety", "revolution/laravel-mastodon-api": "^3.0"
"curation",
"tooling",
"fediverse"
],
"license": [
"GPL-3.0-only"
],
"authors": [
{
"name": "Ro",
"homepage": "https://roiskinda.cool"
}
],
"support": {
"source": "https://koodu.h-i.works/projects/thebadspace",
"wiki": "https://koodu.h-i.works/projects/thebadspace/wiki/?action=_pages",
"issues": "https://koodu.h-i.works/projects/thebadspace/issues"
}, },
"require-dev": { "require-dev": {
"fakerphp/faker": "^1.9.1", "fakerphp/faker": "^1.9.1",
"laravel/pint": "^1.0", "laravel/pint": "^1.0",
"laravel/sail": "^1.18", "laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4", "mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^8.1", "nunomaduro/collision": "^7.0",
"phpunit/phpunit": "^10.1", "phpunit/phpunit": "^10.1",
"spatie/laravel-ignition": "^2.0" "spatie/laravel-ignition": "^2.0"
}, },
@ -67,9 +50,7 @@
}, },
"extra": { "extra": {
"laravel": { "laravel": {
"dont-discover": [ "dont-discover": []
]
} }
}, },
"config": { "config": {

1379
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -36,7 +36,6 @@ input[type="submit"] {
border: 0; border: 0;
transition: all 0.3s linear; transition: all 0.3s linear;
height: 35px; height: 35px;
margin-top: 15px;
} }
select { select {
@ -46,5 +45,4 @@ select {
appearance: none; appearance: none;
color: var(--primary); color: var(--primary);
background: var(--secondary); background: var(--secondary);
height: 35px;
} }

View file

@ -199,7 +199,9 @@ footer {
padding: 10px; padding: 10px;
gap: 10px; gap: 10px;
height: auto; height: auto;
width: auto; width: 80%;
margin: 20px auto;
max-width: 1000px;
position: relative; position: relative;
} }
@ -211,15 +213,6 @@ footer > div:nth-child(2) {
text-align: right; text-align: right;
} }
/*
member stuff
*/
.your-avatar {
width: 250px;
border-radius: 5px;
}
/* /*
responsive responsive
*/ */

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

View file

@ -11,10 +11,8 @@
@csrf @csrf
<label>Edit Location Name</label><br> <label>Edit Location Name</label><br>
<input type="text" name="name" value="{{$location->name}}" /><br> <input type="text" name="name" value="{{$location->name}}" /><br>
<label>Edit Location Comments</label><br>
<label>Edit Location Notes</label><br> <textarea name="description">{{$location->description}}</textarea><br>
<textarea name="notes">{{$location->notes}}</textarea><br>
<label>Edit Reference Links (comma seperated)</label><br> <label>Edit Reference Links (comma seperated)</label><br>
<textarea name="archive_links">{{$location->archive_links}}</textarea><br> <textarea name="archive_links">{{$location->archive_links}}</textarea><br>
<label>Edit Reference Images</label><br> <label>Edit Reference Images</label><br>
@ -26,7 +24,7 @@
<h3>Images</h3> <h3>Images</h3>
@if($images != null) @if($images != null)
@foreach($images as $image) @foreach($images as $image)
<a href="{{$image->path}}" class="location-image" style="background: url({{$image->path}}) no-repeat center center / cover #fc6399" /> <a href="/{{$image->path}}" class="location-image" style="background: url(/{{$image->path}}) no-repeat center center / cover #fc6399" />
</a> </a>
@endforeach @endforeach
@endif @endif

View file

@ -2,38 +2,12 @@
@section('title', 'Den | Member Admin') @section('title', 'Den | Member Admin')
@php
if($mode == 'member-create')
{
$action_url = '/den/member/create';
}else{
$action_url = '/den/member/edit';
}
@endphp
@section('main-content') @section('main-content')
<section> <section>
<article> <article>
@switch($mode) <h2>Member Listing </h2>
@case('member-edit') <a href="/den/admin/update">UPDATE LOCATIONS</a><br />
<h2>Edit Info for {{$member->handle}}</h2> <a href="/den/admin/compile">COMPILE LOCATIONS</a>
@include('forms.member-edit')
<br />
@break
@case('member-create')
<h2>New Member Info</h2>
@include('forms.member-edit')
<br />
@break
@default
<h2>Member Listing </h2>
@foreach($members as $member)
<a href="/den/member/{{$member->uuid}}">{{$member->handle}}</a><br />
@endforeach
<h2>Add Member </h2>
<a href="/den/member/edit/create">Make a new friend</a><br />
@endswitch
</article> </article>
</section> </section>
@endsection @endsection

View file

@ -1,13 +0,0 @@
@extends('frame')
@section('title', 'Den | Your Profile')
@section('main-content')
<section>
<article>
<h2>Edit Profile Deets </h2>
@include('forms.profile-edit')
</article>
</section>
<br />
@endsection

View file

@ -8,8 +8,8 @@
<article> <article>
<h2>Hey {{$handle}} </h2> <h2>Hey {{$handle}} </h2>
<a href="/den/you">Edit Your Account</a><br /> <a href="/den/you">Edit Your Account</a><br />
@if($role==0) <a href="/den/locations">Manage Locations</a><br />
<a href="/den/locations">Manage Locations</a><br /> @if($role==1)
<a href="/den/member">Manage Members</a><br /> <a href="/den/member">Manage Members</a><br />
@endif @endif
</article> </article>

View file

@ -1,61 +0,0 @@
<form action="{{$action_url}}" method="post" enctype="multipart/form-data">
<div>
@php
isset($avatar) ? $avi = $avatar : $avi = '';
@endphp
<img class="your-avatar" src='{{$avi}}'>
<br />
<label>Handle</label><br />
@php
isset($member->handle) ? $handle = $member->handle : $handle = '';
@endphp
<input type="text" name="handle" value="{{$handle}}" />
<br />
@php
isset($member->email) ? $email = $member->email : $email = '';
@endphp
<label>Email</label><br />
<input type="text" name="email" value="{{$email}}" />
<br />
@php
isset($member->pronoun) ? $pronoun = $member->pronoun : $pronoun = '';
@endphp
<label>Pronouns</label><br />
<input type="text" name="pronouns" value="{{$pronoun}}" />
<br />
@php
isset($member->role) ? $role = $member->role : $role = 2;
@endphp
<label>Role</label><br />
<input type="text" name="role" value="{{$role}}" />
<br />
@if($mode == 'member-create')
<label>Fresh Password</label><br />
<input type="password" id="fresh_pass" name="fresh_pass" value="" />
<br />
<label>Confirm Fresh Password</label><br />
<input type="password" id="fresh_pass_confirm" name="fresh_pass_confirm" value="" />
<br />
@endif
@php
isset($member->active) ? $status = $member->active : $status = false;
@endphp
<label>Status</label><br />
<select name="status">
@if($status)
<option value="true" selected>Active</option>
<option value="false">Not Active</option>
@else
<option value="true">Active</option>
<option value="false" selected>Not Active</option>
@endif
</select>
<br />
</div>
@csrf
@php
isset($member->uuid) ? $uuid = $member->uuid : $uuid = 0;
@endphp
<input type="hidden" name="id" value="{{$uuid}}" />
<input type="submit" value="Edit Member" name="submit_button">
</form>

View file

@ -1,30 +0,0 @@
<form action="/den/profile/edit" method="post" enctype="multipart/form-data">
<div>
<img class="your-avatar" src='{{$avatar}}'>
<br />
<label>New Avatar</label><br />
<input type="file" id="fresh_avi" name="fresh_avi" />
<br />
<label>Handle</label><br />
<input type="text" name="handle" value="{{$handle}}" />
<br />
<label>Email</label><br />
<input type="text" name="email" value="{{$email}}" />
<br />
<label>Pronouns</label><br />
<input type="text" name="pronouns" value="{{$pronouns}}" />
<br />
<h2>Change Password</h2>
<label>Fresh Password</label><br />
<input type="password" id="fresh_pass" name="fresh_pass" value="" />
<br />
<label>Confirm Fresh Password</label><br />
<input type="password" id="fresh_pass_confirm" name="fresh_pass_confirm" value="" />
<br />
</div>
@csrf
<input type="hidden" name="id" value="{{$uuid}}" />
<input type="submit" value="Edit Profile" name="submit_button">
</form>

View file

@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="theme-color" content="#c3639e" /> <meta name="theme-color" content="#d66365" />
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title> <title>
@yield('title') @yield('title')
@ -17,9 +17,7 @@
</head> </head>
<body> <body>
<script>
0
</script>
<header> <header>
<div> <div>
<div class="header-left"> <div class="header-left">
@ -94,7 +92,7 @@
an <a href="https://h-i.works">h.i.</a> project an <a href="https://h-i.works">h.i.</a> project
</div> </div>
<div> <div>
a0.7 a0.6
</div> </div>
</footer> </footer>
</body> </body>

View file

@ -38,8 +38,27 @@
@endisset @endisset
<section class="index-meta"> <section class="index-meta">
<article> <article>
<h2>Recent Updates</h2>
@foreach($recent as $item)
<a class="list-link" role="listitem" href="/location/{{$item->uuid}}">
@php
$rating = floor(($item->actions_count / $sources)*100);
@endphp
<span class="item-rating">{{$rating}}%</span>
<label class="item-name">{{$item->name}}</label>
<div class="item-silence">
<img class="item-icon" src="/assets/images/global/status-silence.svg" title="silenced" />
{{$item->silence_count}}
</div>
<div class="item-block">
<img class="item-icon" src="/assets/images/global/status-suspend.svg" title="suspended" />
{{$item->block_count}}
</div>
</a>
@endforeach
<h2>Info</h2>
<div class="index-meta"> <div class="index-meta">
<label>Active Locations Tracked</label> <label>Locations Tracked</label>
<label>{{$count}}</label> <label>{{$count}}</label>
<label>Total Sources</label> <label>Total Sources</label>
<label>{{$sources}}</label> <label>{{$sources}}</label>

View file

@ -6,19 +6,13 @@
@parent @parent
<section> <section>
<article> <article>
<h2>Public Comments</h2> <h2>Description</h2>
@foreach($comments as $comment) {{$location->description}}<br />
@if($comment != " " && $comment != '')
{{trim($comment)}}<br /><br />
@endif
@endforeach
<h2>Notes</h2>
{{$location->notes}}
<h2>References</h2> <h2>References</h2>
<h3>Images</h3> <h3>Images</h3>
@if($images != null) @if($images != null)
@foreach($images as $image) @foreach($images as $image)
<a href="{{$image->path}}" class="location-image" style="background: url({{$image->path}}) no-repeat center center / cover #fc6399" /> <a href="/{{$image->path}}" class="location-image" style="background: url(/{{$image->path}}) no-repeat center center / cover #fc6399" />
</a> </a>
@endforeach @endforeach
@endif @endif
@ -27,9 +21,6 @@
$rating = floor(($action / $sources_count)*100); $rating = floor(($action / $sources_count)*100);
@endphp @endphp
<h3>Links</h3> <h3>Links</h3>
@foreach($links as $link)
<a href="{{$link}}">{{$link}}</a><br />
@endforeach
<div class="location-rating"> <div class="location-rating">
<div> <div>
<img class="rating-icon" src="/assets/images/global/heat.svg" title="heat-rating" /> <img class="rating-icon" src="/assets/images/global/heat.svg" title="heat-rating" />
@ -56,11 +47,8 @@
<br /> <br />
Heat Rating is the percentage of <a href="/about#how">Current Sources</a> that have taken action against an instance. The higher the number of Sources that have silenced and/or suspended an instance, the higher the Heat Rating. Heat Rating is the percentage of <a href="/about#how">Current Sources</a> that have taken action against an instance. The higher the number of Sources that have silenced and/or suspended an instance, the higher the Heat Rating.
<br />
<br />UPDATED : {{$updated}}
<br />
<br />
<br />UPDATED : {{$updated}}
</article> </article>
</section> </section>
@endsection @endsection

View file

@ -5,7 +5,6 @@ use App\Http\Controllers\FrontIndexController;
use App\Http\Controllers\AuthController; use App\Http\Controllers\AuthController;
use App\Http\Controllers\DenController; use App\Http\Controllers\DenController;
use App\Http\Controllers\LocationController; use App\Http\Controllers\LocationController;
use App\Http\Controllers\MemberController;
use App\Http\Controllers\ExportController; use App\Http\Controllers\ExportController;
use App\Http\Controllers\AppealController; use App\Http\Controllers\AppealController;
@ -41,6 +40,7 @@ Route::get("/logout", [AuthController::class, 'leave']);
//back //back
Route::group(['prefix' => 'den', 'middleware' => 'member.check'], function () { Route::group(['prefix' => 'den', 'middleware' => 'member.check'], function () {
Route::get("/", [DenController::class, 'start']); Route::get("/", [DenController::class, 'start']);
Route::get("/member", [DenController::class, 'member']);
Route::get("/listings/{pageNum}", [DenController::class, 'location']); Route::get("/listings/{pageNum}", [DenController::class, 'location']);
Route::get("/location/edit/{uuid}", [DenController::class, 'locationEdit']); Route::get("/location/edit/{uuid}", [DenController::class, 'locationEdit']);
Route::get("/locations", [DenController::class, 'locations']); Route::get("/locations", [DenController::class, 'locations']);
@ -48,13 +48,4 @@ Route::group(['prefix' => 'den', 'middleware' => 'member.check'], function () {
Route::post("/locations/edit", [LocationController::class, 'editLocation']); Route::post("/locations/edit", [LocationController::class, 'editLocation']);
Route::get("/admin/update", [LocationController::class, 'updateLocations']); Route::get("/admin/update", [LocationController::class, 'updateLocations']);
Route::get("/admin/compile", [LocationController::class, 'compileLocations']); Route::get("/admin/compile", [LocationController::class, 'compileLocations']);
//member stuff
Route::get("/you", [MemberController::class, 'profile']);
Route::get("/member", [MemberController::class, 'index']);
Route::get("/member/{uuid}", [MemberController::class, 'editMember']);
Route::get("/member/edit/create", [MemberController::class, 'createMember']);
//actions
Route::post("/profile/edit", [MemberController::class, 'profileEdit']);
Route::post("/member/edit", [MemberController::class, 'memberEdit']);
Route::post("/member/create", [MemberController::class, 'memberCreate']);
}); });