Widget:Companies/Search: Difference between revisions

From TwogPedia
mNo edit summary
mNo edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<div class="companies__search">
<div class="companies__search">
<div style="display: flex;">
<div style="display: flex; gap: 0.5rem;">
   <div>
   <div>
   <label style="display: block;" for="location__name">Name</label>
   <label style="display: block;" for="location__name">Name</label>
   <input type="text" id="companies__name" placeholder="Name...">
   <input style="height: 30px; " type="text" id="companies__name" placeholder="Name...">
   </div>
   </div>
<div>
<div>
   <label style="display: block;" for="places">Type</label>
   <label style="display: block;" for="places">Type</label>
   <select id="types" name="types" onchange="updateTemplate()">
   <select style="height: 30px; " id="types" name="types" onchange="updateTemplate()">
   <option value="">Any</option>
   <option value="">Any</option>
   <option value="Organization">Gaming Organization</option>
   <option value="Organization">Gaming Organization</option>
Line 26: Line 26:


   let type = document.getElementById("types").value;
   let type = document.getElementById("types").value;
   if ( type !== '' ) parameters += '|type=' + document.querySelector(`option[value="${type}"]`).textContent
   if ( type !== '' ) parameters += '|type=' + document.querySelector(`option[value="${type}"]`).value


   let name = document.getElementById("companies__name").value;
   let name = document.getElementById("companies__name").value;
Line 45: Line 45:
       contentContainer.innerHTML = content.querySelector('#companies-search-container').outerHTML;   
       contentContainer.innerHTML = content.querySelector('#companies-search-container').outerHTML;   
     } else {
     } else {
       contentContainer.innerHTML = 'No locations found'
       contentContainer.innerHTML = 'No companies found'
     }
     }



Latest revision as of 11:08, 17 April 2024