voting added

This commit is contained in:
HolgerHatGarKeineNode
2023-03-11 00:17:05 +01:00
parent a6ebbb685a
commit 81fe8be073
4 changed files with 8 additions and 11 deletions

View File

@@ -12,9 +12,6 @@ use RalphJSmit\Laravel\SEO\Support\SEOData;
class ProjectProposalVoting extends Component class ProjectProposalVoting extends Component
{ {
public Country $country;
public ?ProjectProposal $projectProposal = null; public ?ProjectProposal $projectProposal = null;
public ?Vote $vote = null; public ?Vote $vote = null;
@@ -62,7 +59,7 @@ class ProjectProposalVoting extends Component
$this->vote->save(); $this->vote->save();
return to_route('project.voting.projectFunding', return to_route('project.voting.projectFunding',
['country' => $this->country, 'projectProposal' => $this->projectProposal, 'fromUrl' => $this->fromUrl]); ['projectProposal' => $this->projectProposal, 'fromUrl' => $this->fromUrl]);
} }
public function no() public function no()
@@ -73,7 +70,7 @@ class ProjectProposalVoting extends Component
$this->vote->save(); $this->vote->save();
return to_route('project.voting.projectFunding', return to_route('project.voting.projectFunding',
['country' => $this->country, 'projectProposal' => $this->projectProposal, 'fromUrl' => $this->fromUrl]); ['projectProposal' => $this->projectProposal, 'fromUrl' => $this->fromUrl]);
} }
public function render() public function render()

View File

@@ -16,7 +16,7 @@ class ProjectProposalTable extends DataTableComponent
public function configure(): void public function configure(): void
{ {
$this->setPrimaryKey('id') $this->setPrimaryKey('id')
->setAdditionalSelects(['id', 'created_by']) ->setAdditionalSelects(['project_proposals.id', 'project_proposals.created_by', 'project_proposals.slug'])
->setThAttributes(function (Column $column) { ->setThAttributes(function (Column $column) {
return [ return [
'class' => 'px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider dark:bg-gray-800 dark:text-gray-400', 'class' => 'px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider dark:bg-gray-800 dark:text-gray-400',

View File

@@ -8,7 +8,7 @@
</div> </div>
@endcan @endcan
<div> <div>
<x-button xs black :href="route('project.voting.projectFunding', ['country' => $country, 'projectProposal' => $row])"> <x-button xs black :href="route('voting.projectFunding', ['projectProposal' => $row])">
<i class="fa fa-thin fa-check-to-slot mr-2"></i> <i class="fa fa-thin fa-check-to-slot mr-2"></i>
{{ __('Vote') }} [0] {{ __('Vote') }} [0]
</x-button> </x-button>

View File

@@ -118,6 +118,10 @@ Route::middleware([])
->get('/lecturer-material/{libraryItem:slug}', \App\Http\Livewire\News\InternArticleView::class) ->get('/lecturer-material/{libraryItem:slug}', \App\Http\Livewire\News\InternArticleView::class)
->name('lecturerMaterial.view'); ->name('lecturerMaterial.view');
Route::get('/project/voting/{projectProposal:slug}', \App\Http\Livewire\ProjectProposal\ProjectProposalVoting::class)
->name('voting.projectFunding')
->middleware(['auth']);
Route::middleware([ Route::middleware([
'auth', 'auth',
]) ])
@@ -220,10 +224,6 @@ Route::middleware([])
->name('projectProposal.form') ->name('projectProposal.form')
->middleware(['auth']); ->middleware(['auth']);
Route::get('/project/voting/{projectProposal?}', \App\Http\Livewire\ProjectProposal\ProjectProposalVoting::class)
->name('voting.projectFunding')
->middleware(['auth']);
Route::get('/projects', \App\Http\Livewire\ProjectProposal\ProjectProposalTable::class) Route::get('/projects', \App\Http\Livewire\ProjectProposal\ProjectProposalTable::class)
->name('table.projectFunding'); ->name('table.projectFunding');
}); });