Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a605184e authored by Ronak Patel's avatar Ronak Patel
Browse files

legacy device filter added

parent 3b8bec29
Loading
Loading
Loading
Loading
+29 −1
Original line number Diff line number Diff line
@@ -259,6 +259,34 @@
                </label>
              </div>
            </div>
			<div class="col-sm-2" id="legacy">
				<label for="legacy" class="label-selector"><b>Show Legacy Device?</b></label>
				<div class="radio">
				  <label class="radio-label" for="legacy-0">
					<input
					  type="radio"
					  class="rLabel"
					  id="legacy-0"
					  name="legacy"
					  value="yes"
					/>
					<span class="ml-1">Yes</span>
				  </label>
				</div>
				<div class="radio">
				  <label class="radio-label" for="legacy-1">
					<input
					  type="radio"
					  class="rLabel"
					  id="legacy-1"
					  name="legacy"
					  value="no"
					/>
					<span class="ml-1">No</span>
				  </label>
				</div>
				
			  </div>
          </div>
        </div>
      </div>
@@ -292,7 +320,7 @@
          {%- assign sorted = vendor.items | sort_natural: 'name' -%}
          {%- for device in sorted -%}
            {%- assign nbDevices = nbDevices | plus:'1' -%}
            <tr data-device-type="{{ device.type }}">
            <tr data-device-type="{{ device.type }}" data-legacy="{{ device.legacy }}">
              <td class="brand">{{ vendor.name }}</td>

              {% if device.models %}
+28 −8
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ function updateFilters() {
  });
  for (var column in selectedFilters) {
    value = selectedFilters[column].value.toLowerCase();
	
    if (column === "device-type" && value != "-1") {
		$(".smartphone-table tbody tr").each((_, el) => {
		  const deviceType = $(el).attr("data-device-type");
@@ -52,6 +53,19 @@ function updateFilters() {
		})
		continue;
	  }
	  if (column === "legacy" ) {
		$(".smartphone-table tbody tr").each((_, el) => {
		  const legacyDevice = $(el).attr("data-legacy");
		  if(value === 'yes'){
				$(el).show();
		  }else{
			if(legacyDevice === 'yes'){
				$(el).hide();
			}
		  }
		})
		continue;
	  }
    $(".smartphone-table tr ." + column).filter(function() {
      var lineValue = $(this).text().toLowerCase().replaceAll(/\s/g, ' ');
      if (selectedFilters[column].type == "truncate") {
@@ -121,6 +135,7 @@ $(document).ready(function() {
  addFilterSelector("maturity", "maturity");
  addFilterSelector("install", "install");
  addFilterSelector("device-type", "device-type", "device-type");
  addFilterSelector("legacy", "legacy", "legacy");

  addFilterRadio("battery", "battery");
  addFilterRadio("sim", "sim");
@@ -246,3 +261,8 @@ function getNbGitlabIssues(label) {
    return null;
  });
}

$(document).ready(() => {
	$('#legacy-1').trigger('click');
	$('#legacy-1').trigger('change');
});