fix: add org modal HTML was missing from template, wire onclick

This commit is contained in:
James 2026-03-07 13:54:53 -05:00
parent 27c682b960
commit 0e98be999c
2 changed files with 128 additions and 4 deletions

BIN
dealspace

Binary file not shown.

View File

@ -71,12 +71,11 @@
<!-- Orgs Tab -->
<div id="tab-orgs" class="hidden">
<div class="flex justify-between items-center mb-4">
<p class="text-[#94a3b8] text-sm">Organizations and team members in this deal.</p>
<button id="addOrgBtn" class="px-3 py-1.5 bg-white/[0.05] hover:bg-white/[0.08] text-white rounded-lg text-sm transition">+ Add Org</button>
<div class="flex justify-between items-center mb-6">
<p class="text-[#94a3b8] text-sm">Parties participating in this deal and their permissions.</p>
<button onclick="openAddOrgModal()" class="px-3 py-1.5 bg-[#c9a84c] hover:bg-[#b8973f] text-[#0a1628] font-semibold rounded-lg text-sm transition">+ Add Org</button>
</div>
<div id="orgList" class="space-y-3"><div class="text-[#94a3b8] text-sm">Loading...</div></div>
<div id="teamMembersSection"></div>
</div>
</div>
@ -138,6 +137,131 @@
</div>
</div>
</div>
<!-- Add Org Modal -->
<div id="addOrgModal" class="hidden fixed inset-0 bg-black/60 z-50 flex items-center justify-center p-4">
<div class="bg-[#0d1f3c] border border-white/[0.08] rounded-xl w-full max-w-lg max-h-[90vh] overflow-y-auto">
<div class="p-6 border-b border-white/[0.08] flex items-center justify-between">
<h2 class="text-lg font-semibold text-white">Add Organization</h2>
<button onclick="closeAddOrgModal()" class="text-[#94a3b8] hover:text-white transition text-2xl leading-none">&times;</button>
</div>
<div class="p-6 space-y-5">
<div id="addOrgError" class="hidden p-3 bg-red-500/10 border border-red-500/20 rounded-lg text-red-400 text-sm"></div>
<!-- Org Type -->
<div>
<label class="block text-sm font-medium text-[#94a3b8] mb-2">Organization Type</label>
<div class="grid grid-cols-4 gap-2">
<button onclick="setOrgType('buyer',this)" data-type="buyer" class="org-type-btn py-2 rounded-lg text-sm border border-white/[0.08] text-[#94a3b8] hover:border-[#c9a84c] hover:text-[#c9a84c] transition">Buyer</button>
<button onclick="setOrgType('seller',this)" data-type="seller" class="org-type-btn py-2 rounded-lg text-sm border border-white/[0.08] text-[#94a3b8] hover:border-[#c9a84c] hover:text-[#c9a84c] transition">Seller</button>
<button onclick="setOrgType('ib',this)" data-type="ib" class="org-type-btn py-2 rounded-lg text-sm border border-white/[0.08] text-[#94a3b8] hover:border-[#c9a84c] hover:text-[#c9a84c] transition">IB Advisor</button>
<button onclick="setOrgType('advisor',this)" data-type="advisor" class="org-type-btn py-2 rounded-lg text-sm border border-white/[0.08] text-[#94a3b8] hover:border-[#c9a84c] hover:text-[#c9a84c] transition">Advisor</button>
</div>
<input type="hidden" id="addOrgType" value="buyer">
</div>
<!-- Org Name with typeahead -->
<div class="relative">
<label class="block text-sm font-medium text-[#94a3b8] mb-2">Organization Name</label>
<input type="text" id="addOrgName" placeholder="Start typing to search or create..." autocomplete="off"
oninput="orgNameSearch(this.value)"
class="w-full px-4 py-2.5 bg-[#0a1628] border border-white/[0.08] rounded-lg text-white placeholder-[#475569] focus:outline-none focus:border-[#c9a84c] text-sm">
<div id="orgNameDropdown" class="hidden absolute left-0 right-0 top-full mt-1 bg-[#0d1f3c] border border-white/[0.12] rounded-lg z-10 max-h-48 overflow-y-auto shadow-xl"></div>
<input type="hidden" id="addOrgId" value="">
</div>
<!-- Members -->
<div>
<div class="flex items-center justify-between mb-2">
<label class="text-sm font-medium text-[#94a3b8]">Team Members</label>
<button onclick="addMemberRow()" class="text-xs text-[#c9a84c] hover:underline">+ Add member</button>
</div>
<div id="memberRows" class="space-y-2"></div>
</div>
<!-- Permissions -->
<div class="border-t border-white/[0.08] pt-4">
<p class="text-sm font-medium text-white mb-3">Permissions</p>
<div class="space-y-3">
<div class="flex items-center justify-between">
<span class="text-sm text-[#94a3b8]">Download documents</span>
<select id="permDownload" class="px-3 py-1.5 bg-[#0a1628] border border-white/[0.08] rounded-lg text-white text-xs focus:outline-none focus:border-[#c9a84c]">
<option value="watermark">Watermarked only</option>
<option value="full">Full (no watermark)</option>
<option value="none">No access</option>
</select>
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-[#94a3b8]">Upload documents</span>
<input type="checkbox" id="permUpload" class="w-4 h-4 accent-[#c9a84c]">
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-[#94a3b8]">Add request lists</span>
<input type="checkbox" id="permAddLists" class="w-4 h-4 accent-[#c9a84c]">
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-[#94a3b8]">Edit request lists</span>
<input type="checkbox" id="permEditLists" class="w-4 h-4 accent-[#c9a84c]">
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-[#94a3b8]">Folder access</span>
<select id="permFolderAccess" class="px-3 py-1.5 bg-[#0a1628] border border-white/[0.08] rounded-lg text-white text-xs focus:outline-none focus:border-[#c9a84c]">
<option value="assigned">Assigned lists only</option>
<option value="all">All request lists</option>
</select>
</div>
</div>
</div>
</div>
<div class="p-6 border-t border-white/[0.08] flex gap-3">
<button onclick="closeAddOrgModal()" class="flex-1 py-2.5 bg-white/[0.05] hover:bg-white/[0.08] text-white rounded-lg text-sm font-medium transition">Cancel</button>
<button id="addOrgSubmitBtn" onclick="submitAddOrg()" class="flex-1 py-2.5 bg-[#c9a84c] hover:bg-[#b8973f] text-[#0a1628] font-semibold rounded-lg text-sm transition">Add to Deal</button>
</div>
</div>
</div>
<!-- Permissions Modal -->
<div id="permModal" class="hidden fixed inset-0 bg-black/60 z-50 flex items-center justify-center p-4">
<div class="bg-[#0d1f3c] border border-white/[0.08] rounded-xl w-full max-w-md">
<div class="p-6 border-b border-white/[0.08] flex items-center justify-between">
<h2 class="text-lg font-semibold text-white" id="permModalTitle">Permissions</h2>
<button onclick="closePermModal()" class="text-[#94a3b8] hover:text-white transition text-2xl leading-none">&times;</button>
</div>
<div class="p-6 space-y-4">
<input type="hidden" id="permModalDealOrgId">
<input type="hidden" id="permModalVersion">
<input type="hidden" id="permModalOrgId">
<input type="hidden" id="permModalRole">
<div class="flex items-center justify-between">
<span class="text-sm text-[#94a3b8]">Download documents</span>
<select id="pmDownload" class="px-3 py-1.5 bg-[#0a1628] border border-white/[0.08] rounded-lg text-white text-xs focus:outline-none focus:border-[#c9a84c]">
<option value="watermark">Watermarked only</option>
<option value="full">Full (no watermark)</option>
<option value="none">No access</option>
</select>
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-[#94a3b8]">Upload documents</span>
<input type="checkbox" id="pmUpload" class="w-4 h-4 accent-[#c9a84c]">
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-[#94a3b8]">Add request lists</span>
<input type="checkbox" id="pmAddLists" class="w-4 h-4 accent-[#c9a84c]">
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-[#94a3b8]">Edit request lists</span>
<input type="checkbox" id="pmEditLists" class="w-4 h-4 accent-[#c9a84c]">
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-[#94a3b8]">Folder access</span>
<select id="pmFolderAccess" class="px-3 py-1.5 bg-[#0a1628] border border-white/[0.08] rounded-lg text-white text-xs focus:outline-none focus:border-[#c9a84c]">
<option value="assigned">Assigned lists only</option>
<option value="all">All request lists</option>
</select>
</div>
</div>
<div class="p-6 border-t border-white/[0.08] flex gap-3">
<button onclick="closePermModal()" class="flex-1 py-2.5 bg-white/[0.05] hover:bg-white/[0.08] text-white rounded-lg text-sm font-medium transition">Cancel</button>
<button onclick="savePermissions()" class="flex-1 py-2.5 bg-[#c9a84c] hover:bg-[#b8973f] text-[#0a1628] font-semibold rounded-lg text-sm transition">Save</button>
</div>
</div>
</div>
{{end}}
{{define "scripts"}}