$(document).on('page:beforein', '.page[data-name="interest"]', async function (e) {

  console.log('app inteest ready')

  //console.log(ar.interest)

  let ct2=get_localstorage('sites');

  let ct=ct2.data;



  let dt2=get_localstorage('sections');

  let dt=dt2.data;

  //console.log(dt2)

  

  let btn =`<h2 data-lang="channel">Channel</h2>`;

  ct.forEach((v,i)=>{

    if(v.select==0) {

    btn +=`

  <a href="#" id="channel_${v.id}" onClick="click_channel(${v.id},'${i}')" class="interest">

  ${v.title}

  <span class="badge bg-color-primary">${v.count}</span>

  </a>

    `;

    } else {

    btn +=`

  <a href="#" id="channel_${v.id}" onClick="click_channel(${v.id},'${i}')" class="interest selected">

  ${v.title}

  <span class="badge bg-color-primary">${v.count}</span>

  </a>

    `;

    }    

  });

  btn +=`<h2 data-lang="category">Category</h2>`;  

  dt.forEach((v,i)=>{

    if(v.select==0) {

    btn +=`

  <a href="#" id="category_${v.id}" onClick="click_category(${v.id},'${i}')" class="interest">

  ${v.title}

  <span class="badge bg-color-primary">${v.count}</span>

  </a>

    `;

    } else {

    btn +=`

  <a href="#" id="category_${v.id}" onClick="click_category(${v.id},'${i}')" class="interest selected">

  ${v.title}

  <span class="badge bg-color-primary">${v.count}</span>

  </a>

    `;

    }    

  });

  btn +=``;

  $("#interest_content").html(btn); 

  

});