+
+
+
+ diff --git a/app/Livewire/Forms/ProjectProposalForm.php b/app/Livewire/Forms/ProjectProposalForm.php new file mode 100644 index 0000000..c43341f --- /dev/null +++ b/app/Livewire/Forms/ProjectProposalForm.php @@ -0,0 +1,18 @@ + 'integer', + 'einundzwanzig_pleb_id' => 'integer', + ]; + + protected static function booted() + { + + } + + public function getSlugOptions(): SlugOptions + { + return SlugOptions::create() + ->generateSlugsFrom(['name']) + ->saveSlugsTo('slug') + ->usingLanguage(Cookie::get('lang', config('app.locale'))); + } + + public function registerMediaConversions(Media $media = null): void + { + $this + ->addMediaConversion('preview') + ->fit(Fit::Crop, 300, 300) + ->nonQueued(); + $this + ->addMediaConversion('thumb') + ->fit(Fit::Crop, 130, 130) + ->width(130) + ->height(130); + } + + public function registerMediaCollections(): void + { + $this + ->addMediaCollection('main') + ->singleFile() + ->useFallbackUrl(asset('img/einundzwanzig.png')); + } + + public function einundzwanzigPleb(): BelongsTo + { + return $this->belongsTo(EinundzwanzigPleb::class); + } + + public function votes(): HasMany + { + return $this->hasMany(Vote::class); + } +} diff --git a/app/Models/Vote.php b/app/Models/Vote.php new file mode 100644 index 0000000..6daa12f --- /dev/null +++ b/app/Models/Vote.php @@ -0,0 +1,39 @@ + 'integer', + 'einundzwanzig_pleb_id' => 'integer', + 'project_proposal_id' => 'integer', + 'value' => 'bool', + ]; + + public function einundzwanzigPleb(): BelongsTo + { + return $this->belongsTo(EinundzwanzigPleb::class); + } + + public function projectProposal(): BelongsTo + { + return $this->belongsTo(ProjectProposal::class); + } +} diff --git a/composer.lock b/composer.lock index 8d99986..a87d0be 100644 --- a/composer.lock +++ b/composer.lock @@ -6413,16 +6413,16 @@ }, { "name": "spatie/laravel-medialibrary", - "version": "11.9.1", + "version": "11.9.2", "source": { "type": "git", "url": "https://github.com/spatie/laravel-medialibrary.git", - "reference": "ff589ea5532a33d84faeb64bfdfd59057b4148b8" + "reference": "6a39eca52236bc1e1261f366d4022996521ae843" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-medialibrary/zipball/ff589ea5532a33d84faeb64bfdfd59057b4148b8", - "reference": "ff589ea5532a33d84faeb64bfdfd59057b4148b8", + "url": "https://api.github.com/repos/spatie/laravel-medialibrary/zipball/6a39eca52236bc1e1261f366d4022996521ae843", + "reference": "6a39eca52236bc1e1261f366d4022996521ae843", "shasum": "" }, "require": { @@ -6506,7 +6506,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-medialibrary/issues", - "source": "https://github.com/spatie/laravel-medialibrary/tree/11.9.1" + "source": "https://github.com/spatie/laravel-medialibrary/tree/11.9.2" }, "funding": [ { @@ -6518,7 +6518,7 @@ "type": "github" } ], - "time": "2024-09-02T06:32:15+00:00" + "time": "2024-10-18T14:24:58+00:00" }, { "name": "spatie/laravel-package-tools", @@ -12769,12 +12769,12 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": [], "prefer-stable": true, "prefer-lowest": false, "platform": { "php": "^8.2" }, - "platform-dev": {}, + "platform-dev": [], "plugin-api-version": "2.6.0" } diff --git a/database/migrations/2023_03_10_190300_create_project_proposals_table.php b/database/migrations/2023_03_10_190300_create_project_proposals_table.php new file mode 100644 index 0000000..a84dff3 --- /dev/null +++ b/database/migrations/2023_03_10_190300_create_project_proposals_table.php @@ -0,0 +1,36 @@ +id(); + $table->foreignId('einundzwanzig_pleb_id')->constrained()->cascadeOnDelete()->cascadeOnUpdate(); + $table->string('slug')->unique(); + $table->string('name')->unique(); + $table->unsignedBigInteger('support_in_sats'); + $table->text('description'); + $table->timestamps(); + }); + + Schema::enableForeignKeyConstraints(); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('project_proposals'); + } +}; diff --git a/database/migrations/2023_03_10_190301_create_votes_table.php b/database/migrations/2023_03_10_190301_create_votes_table.php new file mode 100644 index 0000000..39fc172 --- /dev/null +++ b/database/migrations/2023_03_10_190301_create_votes_table.php @@ -0,0 +1,34 @@ +id(); + $table->foreignId('einundzwanzig_pleb_id')->constrained()->cascadeOnDelete()->cascadeOnUpdate(); + $table->foreignId('project_proposal_id')->constrained()->cascadeOnDelete()->cascadeOnUpdate(); + $table->unsignedInteger('value'); + $table->text('reason')->nullable(); + $table->timestamps(); + }); + + Schema::enableForeignKeyConstraints(); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('votes'); + } +}; diff --git a/database/migrations/2024_10_23_143503_create_media_table.php b/database/migrations/2024_10_23_143503_create_media_table.php new file mode 100644 index 0000000..47a4be9 --- /dev/null +++ b/database/migrations/2024_10_23_143503_create_media_table.php @@ -0,0 +1,32 @@ +id(); + + $table->morphs('model'); + $table->uuid()->nullable()->unique(); + $table->string('collection_name'); + $table->string('name'); + $table->string('file_name'); + $table->string('mime_type')->nullable(); + $table->string('disk'); + $table->string('conversions_disk')->nullable(); + $table->unsignedBigInteger('size'); + $table->json('manipulations'); + $table->json('custom_properties'); + $table->json('generated_conversions'); + $table->json('responsive_images'); + $table->unsignedInteger('order_column')->nullable()->index(); + + $table->nullableTimestamps(); + }); + } +}; diff --git a/database/migrations/2024_10_23_160756_add_accepted_field_to_project_proposals_table.php b/database/migrations/2024_10_23_160756_add_accepted_field_to_project_proposals_table.php new file mode 100644 index 0000000..9974037 --- /dev/null +++ b/database/migrations/2024_10_23_160756_add_accepted_field_to_project_proposals_table.php @@ -0,0 +1,28 @@ +boolean('accepted')->default(false); + $table->unsignedInteger('sats_paid')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('project_proposals', function (Blueprint $table) { + // + }); + } +}; diff --git a/public/site.webmanifest b/public/site.webmanifest new file mode 100644 index 0000000..45dc8a2 --- /dev/null +++ b/public/site.webmanifest @@ -0,0 +1 @@ +{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} \ No newline at end of file diff --git a/resources/js/app.js b/resources/js/app.js index 03e84c6..1676168 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -1,5 +1,6 @@ import {Alpine, Livewire} from '../../vendor/livewire/livewire/dist/livewire.esm'; +import nostrDefault from "./nostrDefault.js"; import nostrApp from "./nostrApp.js"; import nostrLogin from "./nostrLogin.js"; import nostrZap from "./nostrZap.js"; @@ -18,6 +19,7 @@ Alpine.store('nostr', { user: null, }); +Alpine.data('nostrDefault', nostrDefault); Alpine.data('nostrApp', nostrApp); Alpine.data('nostrLogin', nostrLogin); Alpine.data('nostrZap', nostrZap); diff --git a/resources/js/nostrDefault.js b/resources/js/nostrDefault.js new file mode 100644 index 0000000..ade8389 --- /dev/null +++ b/resources/js/nostrDefault.js @@ -0,0 +1,5 @@ +export default (livewireComponent) => ({ + + isAllowed: livewireComponent.entangle('isAllowed', true), + +}); diff --git a/resources/views/components/input/filepond.blade.php b/resources/views/components/input/filepond.blade.php new file mode 100644 index 0000000..39e3bbb --- /dev/null +++ b/resources/views/components/input/filepond.blade.php @@ -0,0 +1,30 @@ +
+
+
+
+