diff --git a/src/pages/contribute/tool.astro b/src/pages/contribute/tool.astro index dec8904..1e80526 100644 --- a/src/pages/contribute/tool.astro +++ b/src/pages/contribute/tool.astro @@ -726,38 +726,28 @@ class ContributionForm { updateFieldVisibility() { const type = this.elements.typeSelect.value; - this.elements.softwareFields.style.display = 'none'; - this.elements.relationsFields.style.display = 'none'; + // Only hide/show software-specific fields (platforms, license) + // Relations should always be visible since all tool types can have relationships + this.elements.softwareFields.style.display = type === 'software' ? 'block' : 'none'; - if (this.elements.platformsRequired) this.elements.platformsRequired.style.display = 'none'; - if (this.elements.licenseRequired) this.elements.licenseRequired.style.display = 'none'; - - if (type === 'software') { - this.elements.softwareFields.style.display = 'block'; - this.elements.relationsFields.style.display = 'block'; - if (this.elements.platformsRequired) this.elements.platformsRequired.style.display = 'inline'; - if (this.elements.licenseRequired) this.elements.licenseRequired.style.display = 'inline'; - } else if (type === 'method') { - this.elements.relationsFields.style.display = 'block'; - } else if (type === 'concept') { - // Concepts can only relate to software/methods, not other concepts - this.elements.relationsFields.style.display = 'block'; - // Hide concepts section for concept types - const conceptsSection = document.getElementById('related-concepts-section'); - const softwareSection = document.getElementById('related-software-section'); - if (conceptsSection) conceptsSection.style.display = 'none'; - if (softwareSection) softwareSection.style.display = 'block'; + // Always show relations - all tool types can have relationships + this.elements.relationsFields.style.display = 'block'; + + // Only mark platform/license as required for software + if (this.elements.platformsRequired) { + this.elements.platformsRequired.style.display = type === 'software' ? 'inline' : 'none'; + } + if (this.elements.licenseRequired) { + this.elements.licenseRequired.style.display = type === 'software' ? 'inline' : 'none'; } - // Show appropriate relation sections - if (type !== 'concept') { - const conceptsSection = document.getElementById('related-concepts-section'); - const softwareSection = document.getElementById('related-software-section'); - if (conceptsSection) conceptsSection.style.display = 'block'; - if (softwareSection) softwareSection.style.display = 'block'; - } + // Always show both relation sections - let users decide what's relevant + const conceptsSection = document.getElementById('related-concepts-section'); + const softwareSection = document.getElementById('related-software-section'); + if (conceptsSection) conceptsSection.style.display = 'block'; + if (softwareSection) softwareSection.style.display = 'block'; - console.log('[FORM] Field visibility updated for type:', type); + console.log('[FORM] Updated visibility for type:', type || '(no type selected)'); } setupCharacterCounters() {