diff --git a/.run/Development Server (External).run.xml b/.run/Development Server (External).run.xml index aec6c1f..592e434 100644 --- a/.run/Development Server (External).run.xml +++ b/.run/Development Server (External).run.xml @@ -1,5 +1,10 @@ + + + + + \ No newline at end of file diff --git a/.run/Development Server.run.xml b/.run/Development Server.run.xml index eb6b77f..4c31072 100644 --- a/.run/Development Server.run.xml +++ b/.run/Development Server.run.xml @@ -1,5 +1,10 @@ + + + + + - + \ No newline at end of file diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php new file mode 100644 index 0000000..da4bf15 --- /dev/null +++ b/app/Http/Controllers/Auth/LoginController.php @@ -0,0 +1,40 @@ +validate([ + 'username' => 'required|string|max:50', + 'password' => 'required|string', + ]); + + if (Auth::attempt($credentials)) { + $request->session()->regenerate(); + + return redirect()->intended('/'); + } + + return back()->withErrors([ + 'username' => 'Invalid credentials', + ])->withInput(); + } + + public function logout(Request $request) { + Auth::logout(); + + $request->session()->invalidate(); + $request->session()->regenerateToken(); + + return redirect('/'); + + } +} diff --git a/app/Http/Controllers/BookmarksController.php b/app/Http/Controllers/BookmarksController.php index 56aacc7..39bb637 100644 --- a/app/Http/Controllers/BookmarksController.php +++ b/app/Http/Controllers/BookmarksController.php @@ -4,6 +4,9 @@ use App\Models\BookmarkSite; use App\Models\BookmarkCategory; +use App\Models\GuestbookEntry; +use Illuminate\Http\RedirectResponse; +use Illuminate\Http\Request; use Illuminate\View\View; class BookmarksController extends Controller @@ -12,4 +15,40 @@ public function show() : View { $categories = BookmarkCategory::with('sites')->get(); return view('bookmarks', compact('categories')); } + + public function createBookmark() { + $categories = BookmarkCategory::all(); + return view('admin.create-bookmark', [ + 'categories' => $categories + ]); + } + + public function addBookmark(Request $request): RedirectResponse { + $newEntry = BookmarkSite::create($request); + return redirect()->route('bookmarks'); + } + + public function destroyBookmark($id): RedirectResponse { + $site = BookmarkSite::findOrFail($id); + $site->delete(); + return redirect()->route('bookmarks'); + } + + + public function createCategory() { + return view('admin.create-category'); + } + + public function addCategory(Request $request): RedirectResponse { + $newEntry = BookmarkCategory::create($request); + return redirect()->route('bookmarks'); + } + + public function destroyCategory($id): RedirectResponse { + if (BookmarkSite::where('category', $id)->count() <= 0) { + $category = BookmarkCategory::findOrFail($id); + $category->delete(); + } + return redirect()->route('bookmarks'); + } } diff --git a/app/Http/Controllers/GuestbookController.php b/app/Http/Controllers/GuestbookController.php index 3fd179b..91dc458 100644 --- a/app/Http/Controllers/GuestbookController.php +++ b/app/Http/Controllers/GuestbookController.php @@ -6,12 +6,13 @@ use Illuminate\Http\Request; use Illuminate\Http\RedirectResponse; use Illuminate\Contracts\View\View; +use Illuminate\Support\Facades\Http; use Illuminate\Validation\ValidationException; use UAParser\Parser; class GuestbookController extends Controller { public function show(): View { - $entries = GuestbookEntry::selectEntries(); + $entries = GuestbookEntry::get(); $parser = Parser::create(); return view('guestbook') @@ -27,7 +28,46 @@ public function show(): View { * @throws ValidationException */ public function addEntry(Request $request): RedirectResponse { - GuestbookEntry::insertGuestbookEntry($request); + $newEntry = GuestbookEntry::create($request); + $response = Http::withBasicAuth(config('services.mailjet.key'), config('services.mailjet.secret'))->post('https://api.mailjet.com/v3.1/send', [ + 'Messages' => [ + [ + 'From' => [ + 'Email' => 'wah@wah.moe', + 'Name' => 'wah dot moe' + ], + 'To' => [ + [ + 'Email' => 'roscoe@wah.moe', + 'Name' => 'Roscoe D. Wah' + ] + ], + 'Subject' => 'New Guestbook Entry!', + 'HtmlPart' => ' + + + + + + +
Name:'.htmlentities($newEntry->name).'
IP:'.$newEntry->ip.'
Agent:'.htmlentities($newEntry->agent).'
Message:'.htmlentities($newEntry->message).'
' + ] + ] + ]); return back()->with('success', 'Entry submitted successfully!'); } + + public function destroy($id): RedirectResponse { + $entry = GuestbookEntry::findOrFail($id); + $entry->delete(); + return redirect()->route('guestbook'); + } + + public function flag($id): RedirectResponse { + $entry = GuestbookEntry::where("id", $id)->get()->first; + $entry->update([ + "flagged" => !$entry->flagged, + ]); + return redirect()->route('guestbook'); + } } diff --git a/app/Models/BookmarkCategory.php b/app/Models/BookmarkCategory.php index a8bc8d2..6d1054d 100644 --- a/app/Models/BookmarkCategory.php +++ b/app/Models/BookmarkCategory.php @@ -4,18 +4,29 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Http\Request; class BookmarkCategory extends Model { use HasFactory; protected $table = "bookmark__categories"; - protected $fillable = ['name']; + protected $fillable = ['name', 'shuffled']; + protected $casts = ['shuffled' => 'boolean']; public function sites() { return $this->hasMany(BookmarkSite::class, 'category'); } - public static function insertBookmarkCategory(string $name) { + public static function create(Request $request): BookmarkCategory { + $newCategory = new BookmarkCategory(); + $newCategory->name = $request->get('name'); + $newCategory->shuffled = $request->has('shuffled'); + $newCategory->save(); + return $newCategory; + } + + + public static function insertBookmarkCategory(string $name): void { $newBookmarkCategory = new BookmarkCategory; $newBookmarkCategory->name = $name; $newBookmarkCategory->save(); @@ -24,13 +35,4 @@ public static function selectBookmarks(int $id) { $bookmarks = BookmarkSite::where('category', '=', $id)->firstOrFail(); return $bookmarks; } - - public static function importBookmarkCategory(array $data) { - foreach ($data as $category) { - $newBookmarkCategory = new BookmarkCategory; - $newBookmarkCategory->name = $category['name']; - $newBookmarkCategory->priority = intval($category['priority']); - $newBookmarkCategory->save(); - } - } } diff --git a/app/Models/BookmarkSite.php b/app/Models/BookmarkSite.php index 3c9cc5d..08e8342 100644 --- a/app/Models/BookmarkSite.php +++ b/app/Models/BookmarkSite.php @@ -4,16 +4,31 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Http\RedirectResponse; +use Illuminate\Http\Request; class BookmarkSite extends Model { use HasFactory; protected $table = "bookmark__sites"; protected $fillable = ['name', 'description', 'url', 'category']; - public function category() { + public function category(): BelongsTo { return $this->belongsTo(BookmarkCategory::class, 'category'); } - public static function insertBookmark(string $name, string $url, int $category) { + + public static function create(Request $request): BookmarkSite { + $category = BookmarkCategory::where('id', $request->get('category'))->firstOrFail(); + $newSite = new BookmarkSite; + $newSite->name = $request->get('name'); + $newSite->url = $request->get('url'); + $newSite->description = $request->get('description'); + $newSite->category = $category->id; + $newSite->save(); + return $newSite; + } + + public static function insertBookmark(string $name, string $url, int $category): void { $category = BookmarkCategory::where('id', $category)->firstOrFail(); $newBookmark = new BookmarkSite; $newBookmark->name = $name; @@ -21,15 +36,4 @@ public static function insertBookmark(string $name, string $url, int $category) $newBookmark->category = $category->id; $newBookmark->save(); } - - public static function importBookmark(array $data) { - foreach ($data as $site) { - $newBookmark = new BookmarkSite; - $newBookmark->name = $site['name']; - $newBookmark->description = $site['description']; - $newBookmark->url = $site['url']; - $newBookmark->category = $site['category_id']; - $newBookmark->save(); - } - } } diff --git a/app/Models/GuestbookEntry.php b/app/Models/GuestbookEntry.php index b25e0b4..507f6cf 100644 --- a/app/Models/GuestbookEntry.php +++ b/app/Models/GuestbookEntry.php @@ -5,46 +5,37 @@ use Illuminate\Http\Request; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Facades\Auth; class GuestbookEntry extends Model { use HasFactory; protected $table = "guestbook__entries"; - protected $fillable = ['name', 'message']; + protected $fillable = ['name', 'message', + 'flagged' + ]; /** * Creates a new guestbook entry. * * @param Request $request The HTTP POST request - * @return void + * @return GuestbookEntry */ - public static function insertGuestbookEntry(Request $request) { + public static function create(Request $request): GuestbookEntry { $newEntry = new GuestbookEntry; $newEntry->name = $request->get('name'); $newEntry->message = $request->get('message'); $newEntry->ip = $request->ip(); $newEntry->agent = $request->userAgent(); - $newEntry->legacy_flagged = isLegacy(); + $newEntry->flagged = true; $newEntry->save(); + return $newEntry; } - public static function selectEntries() { - $entries = GuestbookEntry::where("legacy_flagged", false)->orderBy('created_at', 'desc')->get(); - return $entries; - } - - public static function importGuestbookEntry(array $data) { - foreach ($data as $entry) { - $dt = new \DateTime('@' . $entry['timestamp']); - $newEntry = new GuestbookEntry; - $newEntry->name = $entry['name']; - $newEntry->ip = $entry['ip_address']; - $newEntry->agent = $entry['agent']; - $newEntry->admin = $entry['site_owner']; - $newEntry->message = $entry['message']; - $newEntry->created_at = $dt; - $newEntry->updated_at = $dt; - $newEntry->save(); + public static function get() { + if (Auth::check()) { + return GuestbookEntry::select()->orderBy('created_at', 'desc')->get(); } + return GuestbookEntry::where("flagged", false)->orderBy('created_at', 'desc')->get(); } } diff --git a/app/Models/User.php b/app/Models/User.php new file mode 100644 index 0000000..d5430b4 --- /dev/null +++ b/app/Models/User.php @@ -0,0 +1,42 @@ + + */ + protected $fillable = [ + 'username', + 'email', + 'password', + ]; + + /** + * The attributes that should be hidden for serialization. + * + * @var array + */ + protected $hidden = [ + 'password', + 'remember_token', + ]; + + /** + * The attributes that should be cast. + * + * @var array + */ + protected $casts = [ + 'email_verified_at' => 'datetime', + 'password' => 'hashed', + ]; +} diff --git a/composer.json b/composer.json index 18a6d2c..d23249c 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,8 @@ "scrivo/highlight.php": "v9.18.1.10", "spatie/laravel-honeypot": "^4.3", "spatie/laravel-html": "^3.4", - "ua-parser/uap-php": "^3.9.14" + "ua-parser/uap-php": "^3.9.14", + "ext-pdo": "*" }, "require-dev": { "fakerphp/faker": "^1.9.1", diff --git a/config/app.php b/config/app.php index 24f9283..6acb105 100644 --- a/config/app.php +++ b/config/app.php @@ -5,9 +5,9 @@ return [ 'name' => env('APP_NAME', 'wah.moe'), - 'version' => '2026.01.09', + 'version' => '2026.01.23', 'env' => env('APP_ENV', 'production'), - 'debug' => (bool) env('APP_DEBUG', false), + 'debug' => (bool)env('APP_DEBUG', false), 'url' => env('APP_URL', 'http://localhost'), 'asset_url' => env('ASSET_URL'), diff --git a/config/auth.php b/config/auth.php index 9548c15..0b54965 100644 --- a/config/auth.php +++ b/config/auth.php @@ -60,10 +60,10 @@ */ 'providers' => [ - 'users' => [ - 'driver' => 'eloquent', - 'model' => App\Models\User::class, - ], + 'users' => [ + 'driver' => 'eloquent', + 'model' => App\Models\User::class, + ], // 'users' => [ // 'driver' => 'database', @@ -91,12 +91,12 @@ */ 'passwords' => [ - 'users' => [ - 'provider' => 'users', - 'table' => 'password_reset_tokens', - 'expire' => 60, - 'throttle' => 60, - ], + 'users' => [ + 'provider' => 'users', + 'table' => 'password_reset_tokens', + 'expire' => 60, + 'throttle' => 60, + ], ], /* diff --git a/config/cache.php b/config/cache.php index d4171e2..5c9a98b 100644 --- a/config/cache.php +++ b/config/cache.php @@ -55,40 +55,12 @@ 'lock_path' => storage_path('framework/cache/data'), ], - 'memcached' => [ - 'driver' => 'memcached', - 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), - 'sasl' => [ - env('MEMCACHED_USERNAME'), - env('MEMCACHED_PASSWORD'), - ], - 'options' => [ - // Memcached::OPT_CONNECT_TIMEOUT => 2000, - ], - 'servers' => [ - [ - 'host' => env('MEMCACHED_HOST', '127.0.0.1'), - 'port' => env('MEMCACHED_PORT', 11211), - 'weight' => 100, - ], - ], - ], - 'redis' => [ 'driver' => 'redis', 'connection' => 'cache', 'lock_connection' => 'default', ], - 'dynamodb' => [ - 'driver' => 'dynamodb', - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), - 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), - 'endpoint' => env('DYNAMODB_ENDPOINT'), - ], - 'octane' => [ 'driver' => 'octane', ], diff --git a/config/database.php b/config/database.php index 5e2b5d4..89f105b 100644 --- a/config/database.php +++ b/config/database.php @@ -1,7 +1,5 @@ env('DB_CONNECTION', 'mysql'), diff --git a/config/services.php b/config/services.php index 21e97c7..193a34b 100644 --- a/config/services.php +++ b/config/services.php @@ -17,5 +17,9 @@ 'lastfm' => [ 'key' => env('LASTFM_KEY'), 'user' => env('LASTFM_USER'), + ], + 'mailjet' => [ + 'key' => env('MAILJET_API'), + 'secret' => env('MAILJET_SECRET'), ] ]; diff --git a/database/factories/BookmarkCategoryFactory.php b/database/factories/BookmarkCategoryFactory.php index ca49ce5..694f8ab 100644 --- a/database/factories/BookmarkCategoryFactory.php +++ b/database/factories/BookmarkCategoryFactory.php @@ -2,20 +2,19 @@ namespace Database\Factories; +use App\Models\BookmarkCategory; use Illuminate\Database\Eloquent\Factories\Factory; /** - * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\BookmarkCategory> + * @extends Factory */ -class BookmarkCategoryFactory extends Factory -{ +class BookmarkCategoryFactory extends Factory { /** * Define the model's default state. * * @return array */ - public function definition(): array - { + public function definition(): array { return [ 'name' => $this->faker->word, ]; diff --git a/database/factories/BookmarkSiteFactory.php b/database/factories/BookmarkSiteFactory.php index c77c011..4a763ec 100644 --- a/database/factories/BookmarkSiteFactory.php +++ b/database/factories/BookmarkSiteFactory.php @@ -2,21 +2,20 @@ namespace Database\Factories; +use App\Models\BookmarkSite; use Illuminate\Database\Eloquent\Factories\Factory; use App\Models\BookmarkCategory; /** - * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\BookmarkSite> + * @extends Factory */ -class BookmarkSiteFactory extends Factory -{ +class BookmarkSiteFactory extends Factory { /** * Define the model's default state. * * @return array */ - public function definition(): array - { + public function definition(): array { return [ 'name' => $this->faker->name, 'description' => $this->faker->sentence, diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php new file mode 100644 index 0000000..4f3ae8e --- /dev/null +++ b/database/factories/UserFactory.php @@ -0,0 +1,35 @@ + + */ +class UserFactory extends Factory { + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array { + return [ + 'username' => fake()->userName(), + 'email' => fake()->unique()->safeEmail(), + 'email_verified_at' => now(), + 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password + 'remember_token' => Str::random(10), + ]; + } + + /** + * Indicate that the model's email address should be unverified. + */ + public function unverified(): static { + return $this->state(fn(array $attributes) => [ + 'email_verified_at' => null, + ]); + } +} diff --git a/database/migrations/2024_02_13_230402_create_bookmark__categories_table.php b/database/migrations/2024_02_13_230402_create_bookmark__categories_table.php index bb1799b..5ab0fc1 100644 --- a/database/migrations/2024_02_13_230402_create_bookmark__categories_table.php +++ b/database/migrations/2024_02_13_230402_create_bookmark__categories_table.php @@ -14,7 +14,7 @@ public function up(): void Schema::create('bookmark__categories', function (Blueprint $table) { $table->id(); $table->string('name'); - $table->unsignedBigInteger('priority')->nullable(); + $table->boolean('shuffled'); $table->timestamps(); }); } diff --git a/database/migrations/2024_02_13_230457_create_bookmark__sites_table.php b/database/migrations/2024_02_13_230457_create_bookmark__sites_table.php index f016f43..9dd3e8b 100644 --- a/database/migrations/2024_02_13_230457_create_bookmark__sites_table.php +++ b/database/migrations/2024_02_13_230457_create_bookmark__sites_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('bookmark__sites', function (Blueprint $table) { $table->id(); $table->string('name'); @@ -28,8 +26,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('bookmarks'); } }; diff --git a/database/migrations/2024_02_25_151527_create_guestbook__entries_table.php b/database/migrations/2024_02_25_151527_create_guestbook__entries_table.php index f1b2a11..97c5deb 100644 --- a/database/migrations/2024_02_25_151527_create_guestbook__entries_table.php +++ b/database/migrations/2024_02_25_151527_create_guestbook__entries_table.php @@ -4,20 +4,18 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('guestbook__entries', function (Blueprint $table) { $table->id(); $table->string('name'); $table->string('ip'); $table->string('agent'); $table->longText('message'); - $table->boolean('admin'); + $table->boolean('flagged'); $table->timestamps(); }); } @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('guestbook__entries'); } }; diff --git a/database/migrations/2026_01_18_004639_create_users_table.php b/database/migrations/2026_01_18_004639_create_users_table.php new file mode 100644 index 0000000..e7ded63 --- /dev/null +++ b/database/migrations/2026_01_18_004639_create_users_table.php @@ -0,0 +1,29 @@ +id(); + $table->string('username'); + $table->string('email')->unique(); + $table->timestamp('email_verified_at')->nullable(); + $table->string('password'); + $table->rememberToken(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void { + Schema::dropIfExists('users'); + } +}; diff --git a/database/seeders/BookmarkCategoriesTableSeeder.php b/database/seeders/BookmarkCategoriesTableSeeder.php deleted file mode 100644 index 5c8ea2f..0000000 --- a/database/seeders/BookmarkCategoriesTableSeeder.php +++ /dev/null @@ -1,30 +0,0 @@ -count(5)->create()->each(function ($category) { -// $category->sites()->saveMany(BookmarkSite::factory()->count(3)->make()); -// }); - $category = new BookmarkCategory([ - 'name' => 'cool people', - ]); - $category->save(); - $site = new BookmarkSite([ - 'name' => 'campos', - 'description' => 'Cool brazilian dude, does programming and stuff', - 'url' => 'https://campos02.me/', - 'category' => 1, - ]); - $site->save(); - } -} diff --git a/public/css/master.css b/public/css/master.css index f8ee557..f73bcb7 100644 --- a/public/css/master.css +++ b/public/css/master.css @@ -141,16 +141,16 @@ a:hover { } div.page-container { - width: 800px; + width: 950px; margin: 5px auto; -} - -div.page-container > div { background-color: var(--background); filter: var(--shadow); padding: 10px; border: var(--border); - margin-bottom: 20px; +} + +div.page-container > hr { + padding: 3px 0; } div.page-container > div:last-child { @@ -166,6 +166,10 @@ header { align-items: center; } +header div:nth-child(2) { + padding-left: 14px; +} + header img { image-rendering: pixelated; } @@ -190,20 +194,28 @@ main>div::after { clear: both; } -div#footer { +footer, +div.footer-footer div { + text-align: center; +} + +div.footer-footer { display: grid; - grid-template-columns: auto 1fr; + grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr; grid-column-gap: 0; grid-row-gap: 0; - align-items: center; } -div#footer div:last-child { +div.footer-footer div:first-child { + text-align: left; +} + +div.footer-footer div:last-child { text-align: right; } -div#footer div:last-child img { +footer img { image-rendering: pixelated; margin: 0; padding: 0; @@ -240,9 +252,9 @@ div.wah img { } /** Guestbook **/ -table.form input, -table.form textarea, -table.form button { +form input, +form textarea, +form button { background-color: var(--background); border: var(--border); filter: var(--shadow-small); @@ -272,10 +284,19 @@ div.gb-entry { border: var(--border); filter: var(--shadow-small); background-color: var(--background); - width: 75%; padding: 10px; } +div.gb-entry form { + display: inline; +} + +div.gb-entry-flagged { + border-color: red; + filter: drop-shadow(3px 3px hsla(0, 100%, 50%, 0.4)); +} + + /** Music **/ table.music-top10 { border: var(--border); diff --git a/public/css/minimal.css b/public/css/minimal.css index 697673f..aadb5d0 100644 --- a/public/css/minimal.css +++ b/public/css/minimal.css @@ -1,13 +1,13 @@ html { color-scheme: light; } -body { color: #2a271c; background-color: #f2efbd; font-family: serif; } +body { color: #1d232b; background-color: #bfd5f2; font-family: serif; } h1, h2, h4, ul, p { margin: 0; } h1 { font-weight: normal; } h4 { margin-bottom: 5px; } ul { padding: 5px 30px; } -a { color: hsl(183, 93%, 27%); text-decoration: underline dotted; } -a:hover { color: hsl(183, 93%, 15%); text-decoration: underline solid; } +a { color: #293647; text-decoration: underline dotted; } +a:hover { color: #1c2531; text-decoration: underline solid; } code { font-family: monospace; } code.addr { font-size: 24px; } -table { border: #f27405 2px solid; background-color: #f2efbd; filter: drop-shadow(3px 3px hsla(11, 96%, 43%, 0.4)); } -img { border: #f27405 2px solid; filter: drop-shadow(3px 3px hsla(11, 96%, 43%, 0.4)); } -hr { border: none; border-bottom: 2px solid #f27405; } +table { border: #056bf0 2px solid; background-color: #bfd5f2; filter: drop-shadow(3px 3px hsla(214, 96%, 43%, 0.4)); } +img { border: #056bf0 2px solid; filter: drop-shadow(3px 3px hsla(214, 96%, 43%, 0.4)); } +hr { border: none; border-bottom: 2px solid #056bf0; } diff --git a/public/images/buttons/benjae.png b/public/images/buttons/benjae.png new file mode 100644 index 0000000..c3125cb Binary files /dev/null and b/public/images/buttons/benjae.png differ diff --git a/public/images/buttons/boky.png b/public/images/buttons/boky.png new file mode 100644 index 0000000..b93d667 Binary files /dev/null and b/public/images/buttons/boky.png differ diff --git a/public/images/buttons/doskel2.png b/public/images/buttons/doskel2.png new file mode 100644 index 0000000..4030f35 Binary files /dev/null and b/public/images/buttons/doskel2.png differ diff --git a/public/images/buttons/elwiwi.png b/public/images/buttons/elwiwi.png new file mode 100644 index 0000000..8505737 Binary files /dev/null and b/public/images/buttons/elwiwi.png differ diff --git a/public/images/buttons/gggg.png b/public/images/buttons/gggg.png new file mode 100644 index 0000000..2064746 Binary files /dev/null and b/public/images/buttons/gggg.png differ diff --git a/public/images/buttons/krisbtn.gif b/public/images/buttons/krisbtn.gif new file mode 100644 index 0000000..9b485ac Binary files /dev/null and b/public/images/buttons/krisbtn.gif differ diff --git a/public/images/buttons/notcompliant.gif b/public/images/buttons/notcompliant.gif new file mode 100644 index 0000000..65e9fb8 Binary files /dev/null and b/public/images/buttons/notcompliant.gif differ diff --git a/public/images/buttons/violet.png b/public/images/buttons/violet.png new file mode 100644 index 0000000..7978245 Binary files /dev/null and b/public/images/buttons/violet.png differ diff --git a/public/images/buttons/yahoo.gif b/public/images/buttons/yahoo.gif new file mode 100644 index 0000000..a62dc56 Binary files /dev/null and b/public/images/buttons/yahoo.gif differ diff --git a/public/images/login.jpg b/public/images/login.jpg new file mode 100644 index 0000000..9a31c43 Binary files /dev/null and b/public/images/login.jpg differ diff --git a/resources/views/admin/create-bookmark.blade.php b/resources/views/admin/create-bookmark.blade.php new file mode 100644 index 0000000..70a1623 --- /dev/null +++ b/resources/views/admin/create-bookmark.blade.php @@ -0,0 +1,40 @@ + +

TEMPORARY FORM REPLACE THIS BEFORE PUSHING TO PROD

+
+ @csrf + + + + + + + + + + + + + + + + + +
/td>
+ +
+ + +
+ + el wiwi diff --git a/resources/views/admin/create-category.blade.php b/resources/views/admin/create-category.blade.php new file mode 100644 index 0000000..701ab47 --- /dev/null +++ b/resources/views/admin/create-category.blade.php @@ -0,0 +1,25 @@ + +

TEMPORARY FORM REPLACE THIS BEFORE PUSHING TO PROD

+
+ @csrf + + + + + + + + + +
+ + +
+ + el wiwi diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php new file mode 100644 index 0000000..f8f5fa6 --- /dev/null +++ b/resources/views/auth/login.blade.php @@ -0,0 +1,34 @@ + +

TEMPORARY LOGIN REPLACE THIS BEFORE PUSHING TO PROD

+

what your login

+

twust him with youw wogin infowmation

+ + diff --git a/resources/views/bookmarks.blade.php b/resources/views/bookmarks.blade.php index 178478f..00f3824 100644 --- a/resources/views/bookmarks.blade.php +++ b/resources/views/bookmarks.blade.php @@ -1,9 +1,21 @@ Bookmarks + @if(auth()->check()) + new category pretty please
+ new bookmark pretty please + @endif @foreach($categories as $category)

{{ $category->name }}

- @if($category->id == 1) + @if(Auth::check()) +
+
+ @csrf + @method('DELETE') + +
+ @endif + @if($category->shuffled)

(These are shuffled every load)

@php $sites = $category->sites->shuffle(); @@ -16,7 +28,17 @@
    @foreach($sites as $site) -
  • {{ $site->name }} - {{ $site->description }}
  • +
  • + {{ $site->name }} - {{ $site->description }} + @if(Auth::check()) +
    +
    + @csrf + @method('DELETE') + +
    + @endif +
  • @endforeach
diff --git a/resources/views/components/layout.blade.php b/resources/views/components/layout.blade.php index a9a1728..36a4add 100644 --- a/resources/views/components/layout.blade.php +++ b/resources/views/components/layout.blade.php @@ -24,53 +24,61 @@ progressive pride flag
- -
-
- {{ $slot }} -
-
-
-
+
+
+ A pixel art depiction of a paw, in three alternating shades of blue. +
+
+

wah!

+

+ (dot moe) +

+ +
+
+
+
+ {{ $slot }} +
+
+
-
diff --git a/resources/views/components/navigation.blade.php b/resources/views/components/navigation.blade.php index 0a7ef34..255d439 100644 --- a/resources/views/components/navigation.blade.php +++ b/resources/views/components/navigation.blade.php @@ -7,4 +7,7 @@ guestbook | music | pandamonium + @if(Auth::check()) + | logout + @endif diff --git a/resources/views/guestbook.blade.php b/resources/views/guestbook.blade.php index fb73da2..1333b36 100644 --- a/resources/views/guestbook.blade.php +++ b/resources/views/guestbook.blade.php @@ -103,7 +103,7 @@ @php $user_agent = $parser->parse($entry->agent); @endphp -
+
Submitted by {{ $entry->name }} on {{ $entry->created_at->format('Y-m-d') }} at {{ $entry->created_at->format('h:i:s A (e)') }} @@ -120,6 +120,21 @@ on {{ $user_agent->os->toString() }} @endif @endif + @if(Auth::check()) +
+ @if($entry->flagged) +
+ @csrf + +
+   + @endif +
+ @csrf + @method('DELETE') + +
+ @endif

@endforeach diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index faeb0fa..975dcc0 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -7,9 +7,6 @@

Hi! This is my personal homepage on the World Wide Web.

- @if(!isLegacy()) -
- @endif

Some quick facts about me:

  • {{ $age }} y/o, he/him, British
  • @@ -20,12 +17,9 @@ Minecraft, Stardew Valley, N++ and Starbound
  • CWOP member
- @if(!isLegacy()) -
- @endif

Interests:

    -
  • Tech Theatre - Lighting, Stage Management, etc.
  • +
  • Tech Theatre - Lighting, Sound, etc.
  • Programming - HTML, CSS, JavaScript, C#, Java, PHP, Ruby, Python (GitHub)
  • Photography - Flickr
  • diff --git a/routes/web.php b/routes/web.php index 28bb7d0..35df84b 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,10 +1,12 @@ name('bookmarks'); Route::get('/music', [MusicController::class, 'show']); Route::get('/pandamonium', [RoscoLekoController::class, 'show']); +Route::get('/guestbook', [GuestbookController::class, 'show']); Route::post('/guestbook', [GuestbookController::class, 'addEntry']) + ->name('guestbook') ->middleware('validator') ->middleware('rate_limit'); -Route::get('/proxy/wah/{image}', function (string $image) { - $client = new \GuzzleHttp\Client(); - $response = $client->request('GET', 'https://api.tinyfox.dev/hourly/wahs/'.$image); +Route::middleware('auth')->group(function () { + Route::get('/bookmarks/bookmark/new', [BookmarksController::class, 'createBookmark']) + ->name('bookmarks.create-bookmark'); + Route::post('/bookmarks/bookmark/new', [BookmarksController::class, 'addBookmark']); + Route::delete('/bookmarks/bookmark/{id}', [BookmarksController::class, 'destroyBookmark']) + ->name('bookmarks.destroy-bookmark'); + Route::get('/bookmarks/category/new', [BookmarksController::class, 'createCategory']) + ->name('bookmarks.create-category'); + Route::post('/bookmarks/category/new', [BookmarksController::class, 'addCategory']); + Route::delete('/bookmarks/category/{id}', [BookmarksController::class, 'destroyCategory']) + ->name('bookmarks.destroy-category'); - return response($response->getBody()) - ->header('Content-Type', $response->getHeader('Content-Type')); + Route::delete('/guestbook/{id}', [GuestbookController::class, 'destroy']) + ->name('guestbook.destroy'); + Route::get('/guestbook/{id}/flag', [GuestbookController::class, 'flag']) + ->name('guestbook.flag'); }); -Route::get('/proxy/lastfm/{image}', function (string $image) { - $client = new \GuzzleHttp\Client(); - $response = $client->request('GET', 'https://lastfm.freetls.fastly.net/i/u/174s/'.$image); - - return response($response->getBody()) - ->header('Content-Type', $response->getHeader('Content-Type')); +/* Authentication */ +Route::prefix('auth')->group(function() { + Route::get('login', [LoginController::class, 'showLoginForm']); + Route::post('login', [LoginController::class, 'login'])->name('login'); + Route::get('logout', [LoginController::class, 'logout'])->name('logout'); }); + +/* Legacy Proxies */ +Route::prefix('proxy')->group(function () { + Route::get('/wah/{image}', function (string $image) { + $client = new GuzzleClient(); + $response = $client->request('GET', 'https://api.tinyfox.dev/hourly/wahs/'.$image); + + return response($response->getBody()) + ->header('Content-Type', $response->getHeader('Content-Type')); + }); + + Route::get('/lastfm/{image}', function (string $image) { + $client = new GuzzleClient(); + $response = $client->request('GET', 'https://lastfm.freetls.fastly.net/i/u/174s/'.$image); + + return response($response->getBody()) + ->header('Content-Type', $response->getHeader('Content-Type')); + }); +}); + +