comments user

This commit is contained in:
2026-06-11 13:14:01 +05:45
parent 812822ebb5
commit 5c69f89de8
5 changed files with 44 additions and 6 deletions
+2 -2
View File
@@ -33,11 +33,11 @@
</div>
<div class="flex items-center justify-end mt-4">
@if (Route::has('password.request'))
{{-- @if (Route::has('password.request'))
<a class="underline text-sm text-gray-600 hover:text-gray-900 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" href="{{ route('password.request') }}">
{{ __('Forgot your password?') }}
</a>
@endif
@endif --}}
<x-primary-button class="ms-3">
{{ __('Log in') }}
+5 -2
View File
@@ -60,6 +60,7 @@
$commentData = $reg->comments->sortByDesc('created_at')->map(fn($c) => [
'comment' => $c->comment,
'author' => $c->author_name,
'created_at' => $c->created_at->diffForHumans(),
])->values()->toArray();
@endphp
@@ -291,6 +292,7 @@ function openDetailPanel(row) {
const created = row.dataset.created;
const sessions = JSON.parse(row.dataset.sessions || '[]');
const comments = JSON.parse(row.dataset.comments || '[]');
console.log(comments);
const countryTitle=row.dataset.countryTitle;
const countryFlag=row.dataset.countryFlag;
@@ -367,7 +369,7 @@ function renderPanelComments(comments) {
el.innerHTML = comments.map(c => `
<div class="bg-slate-50 border border-slate-200 rounded-xl px-4 py-3">
<div class="flex items-center justify-between mb-1.5">
<span class="text-xs font-semibold text-indigo-600">Counselor</span>
<span class="text-xs font-semibold text-indigo-600">${escHtml(c.author)}</span>
<span class="text-xs text-slate-400">${escHtml(c.created_at)}</span>
</div>
<p class="text-sm text-slate-700 leading-relaxed">${escHtml(c.comment)}</p>
@@ -405,8 +407,9 @@ document.getElementById('panelCommentBtn').addEventListener('click', function ()
const list = Array.isArray(r.comments) ? r.comments : Object.values(r.comments || {});
renderPanelComments(list.map(c => ({
comment: c.comment,
author: c.author_name,
created_at: c.created_at_human ?? c.created_at,
})));
})));
}
});
},