mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
voting added
This commit is contained in:
@@ -16,7 +16,7 @@ class ProjectProposalTable extends DataTableComponent
|
|||||||
public function configure(): void
|
public function configure(): void
|
||||||
{
|
{
|
||||||
$this->setPrimaryKey('id')
|
$this->setPrimaryKey('id')
|
||||||
->setAdditionalSelects(['project_proposals.id', 'project_proposals.created_by', 'project_proposals.slug'])
|
->setAdditionalSelects(['project_proposals.id', 'project_proposals.created_by', 'project_proposals.slug', 'project_proposals.user_id'])
|
||||||
->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',
|
||||||
@@ -45,6 +45,10 @@ class ProjectProposalTable extends DataTableComponent
|
|||||||
return [
|
return [
|
||||||
Column::make("Id", "id")
|
Column::make("Id", "id")
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
Column::make(__('From'))
|
||||||
|
->label(
|
||||||
|
fn ($row, Column $column) => view('columns.project_proposals.author')->withRow($row)
|
||||||
|
),
|
||||||
Column::make("Name", "name")
|
Column::make("Name", "name")
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Column::make(__('Intended support in sats'), "support_in_sats")
|
Column::make(__('Intended support in sats'), "support_in_sats")
|
||||||
@@ -61,6 +65,6 @@ class ProjectProposalTable extends DataTableComponent
|
|||||||
|
|
||||||
public function builder(): Builder
|
public function builder(): Builder
|
||||||
{
|
{
|
||||||
return ProjectProposal::query();
|
return ProjectProposal::query()->with(['user']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,23 @@
|
|||||||
<div class="flex flex-col space-y-1">
|
<div class="flex flex-col space-y-1">
|
||||||
@can('update', $row)
|
@can('update', $row)
|
||||||
<div>
|
<div>
|
||||||
<x-button xs amber :href="route('project.projectProposal.form', ['country' => $country, 'projectProposal' => $row])">
|
<x-button xs amber
|
||||||
|
:href="route('project.projectProposal.form', ['country' => $country, 'projectProposal' => $row])">
|
||||||
<i class="fa fa-thin fa-edit mr-2"></i>
|
<i class="fa fa-thin fa-edit mr-2"></i>
|
||||||
{{ __('Edit') }}
|
{{ __('Edit') }}
|
||||||
</x-button>
|
</x-button>
|
||||||
</div>
|
</div>
|
||||||
@endcan
|
@endcan
|
||||||
|
@auth
|
||||||
<div>
|
<div>
|
||||||
<x-button xs black :href="route('voting.projectFunding', ['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>
|
||||||
</div>
|
</div>
|
||||||
|
@else
|
||||||
|
<div>
|
||||||
|
<x-badge>{{ __('for voting you have to be logged in') }}</x-badge>
|
||||||
|
</div>
|
||||||
|
@endauth
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<div class="flex items-center space-x-2">
|
||||||
|
<img class="h-12" src="{{ $row->user->profile_photo_url }}" alt="{{ $row->user->name }}">
|
||||||
|
<div>
|
||||||
|
{{ $row->user->name }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
Reference in New Issue
Block a user