Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion app/Livewire/Conducting/StudySelection/PaperModal.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public function mount()
$this->projectId = request()->segment(2);
$this->currentProject = Project::findOrFail($this->projectId);
}

#[On('showPaper')]
public function showPaper($paper, $criterias)
{
Expand Down Expand Up @@ -309,6 +308,23 @@ private function determineNewStatus($inclusion, $exclusion, $old_status)
}
}


public function nextPaper(){
$this->paper = Papers::where('id_paper', '>', $this->paper['id_paper'])
->where('data_base', $this->paper['data_base'])
->orderBy('id_paper')
->first();

if ($this->paper) {
$this->dispatch('close-paper');

$this->showPaper($this->paper, $this->criterias);
} else {
session()->flash('errorMessage', 'No more papers available.');
}
}


public function render()
{
return view('livewire.conducting.study-selection.paper-modal');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@
<button type="button" class="btn btn-secondary"
data-bs-dismiss="modal">{{ __('project/conducting.study-selection.modal.close' )}}</button>
</div>
<div class="d-flex justify-content-between px-4">
<button type="button" class="btn btn-outline-secondary" wire:click="previousPaper">
<i class="fa-solid fa-arrow-left"></i>
</button>
<button type="button" class="btn btn-outline-secondary" wire:click="nextPaper">
<i class="fa-solid fa-arrow-right"></i>
</button>
</div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
class="list-group-item d-flex row w-100"
>
<div class='w-10 pl-2'>

<span data-search>{{ $paper['id'] }}</span>
</div>
<div class='w-55' role='button' wire:click.prevent="openPaper({{ $paper }})">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<div id="status_per_members" style="height: 400px;" class="card my-2 p-2"></div>
</figure>
</div>

@section('scripts')
@parent
@push('js')
Expand Down
Loading