fix: buyer view — hide upload/mark answered/compose; fix duplicate request text; tighten title size
This commit is contained in:
parent
25f46d5f66
commit
0e11ba2ba1
|
|
@ -411,6 +411,7 @@ func (h *Handlers) Me(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
isSuperAdmin, _ := lib.IsSuperAdmin(h.DB, actorID)
|
isSuperAdmin, _ := lib.IsSuperAdmin(h.DB, actorID)
|
||||||
|
|
||||||
|
testRole := TestRoleFromContext(r.Context())
|
||||||
JSONResponse(w, http.StatusOK, map[string]any{
|
JSONResponse(w, http.StatusOK, map[string]any{
|
||||||
"id": user.UserID,
|
"id": user.UserID,
|
||||||
"name": user.Name,
|
"name": user.Name,
|
||||||
|
|
@ -418,6 +419,7 @@ func (h *Handlers) Me(w http.ResponseWriter, r *http.Request) {
|
||||||
"org_id": user.OrgID,
|
"org_id": user.OrgID,
|
||||||
"org_name": user.OrgName,
|
"org_name": user.OrgName,
|
||||||
"is_super_admin": isSuperAdmin,
|
"is_super_admin": isSuperAdmin,
|
||||||
|
"test_role": testRole,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -23,7 +23,7 @@
|
||||||
<h2 class="text-sm font-semibold text-[#94a3b8] uppercase tracking-wider">Request</h2>
|
<h2 class="text-sm font-semibold text-[#94a3b8] uppercase tracking-wider">Request</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-start gap-3 mb-4">
|
<div class="flex items-start gap-3 mb-4">
|
||||||
<h1 id="reqTitle" class="text-xl font-bold text-white leading-tight flex-1">Loading...</h1>
|
<h1 id="reqTitle" class="text-base font-semibold text-white leading-snug flex-1">Loading...</h1>
|
||||||
<button id="editReqBtn" onclick="startEditRequest()" class="shrink-0 p-1.5 rounded-lg hover:bg-white/[0.08] text-[#94a3b8] hover:text-white transition" title="Edit request">
|
<button id="editReqBtn" onclick="startEditRequest()" class="shrink-0 p-1.5 rounded-lg hover:bg-white/[0.08] text-[#94a3b8] hover:text-white transition" title="Edit request">
|
||||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"/></svg>
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"/></svg>
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -110,7 +110,7 @@
|
||||||
<p class="text-[#475569] text-sm">Select a channel above.</p>
|
<p class="text-[#475569] text-sm">Select a channel above.</p>
|
||||||
</div>
|
</div>
|
||||||
<!-- Compose -->
|
<!-- Compose -->
|
||||||
<div class="border-t border-white/[0.08] p-4">
|
<div id="commentComposer" class="border-t border-white/[0.08] p-4">
|
||||||
<div id="composeReadOnly" class="hidden py-1 text-xs text-[#475569] text-center">Read only in this channel.</div>
|
<div id="composeReadOnly" class="hidden py-1 text-xs text-[#475569] text-center">Read only in this channel.</div>
|
||||||
<div id="composeForm" class="flex gap-3 items-end">
|
<div id="composeForm" class="flex gap-3 items-end">
|
||||||
<textarea id="commentText" rows="2" placeholder="Post an announcement..."
|
<textarea id="commentText" rows="2" placeholder="Post an announcement..."
|
||||||
|
|
@ -158,7 +158,12 @@
|
||||||
document.title = title + ' \u2014 Dealspace';
|
document.title = title + ' \u2014 Dealspace';
|
||||||
document.getElementById('reqRef').textContent = d.item_number || title;
|
document.getElementById('reqRef').textContent = d.item_number || title;
|
||||||
document.getElementById('reqTitle').textContent = title;
|
document.getElementById('reqTitle').textContent = title;
|
||||||
document.getElementById('reqDesc').textContent = d.description || '';
|
// Don't repeat description if it's the same as the title
|
||||||
|
const desc = d.description || '';
|
||||||
|
document.getElementById('reqDesc').textContent = desc === title ? '' : desc;
|
||||||
|
|
||||||
|
// Apply role-based UI restrictions
|
||||||
|
applyRoleRestrictions();
|
||||||
|
|
||||||
if (req.project_id) document.getElementById('backToProject').href = '/app/projects/' + req.project_id;
|
if (req.project_id) document.getElementById('backToProject').href = '/app/projects/' + req.project_id;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue