main #11
@ -726,38 +726,28 @@ class ContributionForm {
|
|||||||
updateFieldVisibility() {
|
updateFieldVisibility() {
|
||||||
const type = this.elements.typeSelect.value;
|
const type = this.elements.typeSelect.value;
|
||||||
|
|
||||||
this.elements.softwareFields.style.display = 'none';
|
// Only hide/show software-specific fields (platforms, license)
|
||||||
this.elements.relationsFields.style.display = 'none';
|
// 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';
|
// Always show relations - all tool types can have relationships
|
||||||
if (this.elements.licenseRequired) this.elements.licenseRequired.style.display = 'none';
|
this.elements.relationsFields.style.display = 'block';
|
||||||
|
|
||||||
if (type === 'software') {
|
// Only mark platform/license as required for software
|
||||||
this.elements.softwareFields.style.display = 'block';
|
if (this.elements.platformsRequired) {
|
||||||
this.elements.relationsFields.style.display = 'block';
|
this.elements.platformsRequired.style.display = type === 'software' ? 'inline' : 'none';
|
||||||
if (this.elements.platformsRequired) this.elements.platformsRequired.style.display = 'inline';
|
}
|
||||||
if (this.elements.licenseRequired) this.elements.licenseRequired.style.display = 'inline';
|
if (this.elements.licenseRequired) {
|
||||||
} else if (type === 'method') {
|
this.elements.licenseRequired.style.display = type === 'software' ? 'inline' : 'none';
|
||||||
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';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show appropriate relation sections
|
// Always show both relation sections - let users decide what's relevant
|
||||||
if (type !== 'concept') {
|
|
||||||
const conceptsSection = document.getElementById('related-concepts-section');
|
const conceptsSection = document.getElementById('related-concepts-section');
|
||||||
const softwareSection = document.getElementById('related-software-section');
|
const softwareSection = document.getElementById('related-software-section');
|
||||||
if (conceptsSection) conceptsSection.style.display = 'block';
|
if (conceptsSection) conceptsSection.style.display = 'block';
|
||||||
if (softwareSection) softwareSection.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() {
|
setupCharacterCounters() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user