diff --git a/app/Livewire/Forms/ProjectProposalForm.php b/app/Livewire/Forms/ProjectProposalForm.php index c43341f..1e89e20 100644 --- a/app/Livewire/Forms/ProjectProposalForm.php +++ b/app/Livewire/Forms/ProjectProposalForm.php @@ -15,4 +15,7 @@ class ProjectProposalForm extends Form #[Validate('required|string|min:5')] public $description = ''; + + #[Validate('required|url')] + public $website= ''; } diff --git a/database/migrations/2024_10_24_153410_add_website_field_to_project_proposals_table.php b/database/migrations/2024_10_24_153410_add_website_field_to_project_proposals_table.php new file mode 100644 index 0000000..fdde4b8 --- /dev/null +++ b/database/migrations/2024_10_24_153410_add_website_field_to_project_proposals_table.php @@ -0,0 +1,27 @@ +string('website')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('project_proposals', function (Blueprint $table) { + // + }); + } +}; diff --git a/resources/views/pages/association/project-support/form/create.blade.php b/resources/views/pages/association/project-support/form/create.blade.php index 4d1faef..34e32e0 100644 --- a/resources/views/pages/association/project-support/form/create.blade.php +++ b/resources/views/pages/association/project-support/form/create.blade.php @@ -31,7 +31,7 @@ on([ $this->currentPubkey = $pubkey; $this->currentPleb = \App\Models\EinundzwanzigPleb::query()->where('pubkey', $pubkey)->first(); if ($this->currentPleb->association_status->value < 3) { - return $this->js('alert("Du bist hierzu berechtigt.")'); + return $this->js('alert("Du bist hierzu nicht berechtigt.")'); } $this->isAllowed = true; }, @@ -57,7 +57,8 @@ $save = function () { @volt -
+
@@ -82,6 +83,11 @@ $save = function () { :placeholder="__('Name')"/> + + + + diff --git a/resources/views/pages/association/project-support/index.blade.php b/resources/views/pages/association/project-support/index.blade.php index 421a350..8ce2c34 100644 --- a/resources/views/pages/association/project-support/index.blade.php +++ b/resources/views/pages/association/project-support/index.blade.php @@ -23,13 +23,32 @@ state([ 'votes', ]) ->get(), + 'isAllowed' => false, + 'currentPubkey' => null, + 'currentPleb' => null, +]); + +on([ + 'nostrLoggedIn' => function ($pubkey) { + $this->currentPubkey = $pubkey; + $this->currentPleb = \App\Models\EinundzwanzigPleb::query()->where('pubkey', $pubkey)->first(); + if ($this->currentPleb->association_status->value < 2) { + return $this->js('alert("Du bist hierzu nicht berechtigt.")'); + } + $this->isAllowed = true; + }, + 'nostrLoggedOut' => function () { + $this->isAllowed = false; + $this->currentPubkey = null; + $this->currentPleb = null; + }, ]); ?> @volt -
+