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

  console.log('app journal ready')

  var i = e.detail.route.params.id

  let js = JSON.parse(localStorage.getItem('t05_journal'));

  let dt = js.data[i];

  console.log(dt)

  var strHtml = `

<div class="container mt-20">

  <div class="searchbar-backdrop"></div>

  <div class="list list-strong-ios list-outline-ios list-dividers-ios simple-list searchbar-not-found">

    <ul>

      <li>Nothing found</li>

    </ul>

  </div>



  <p class="grid grid-cols-2 grid-gap grid-buttons-demo">

      <a href="#" class="btn btn-xs btn-primary" onClick="SortBySeq('a3ct','jou','asc')"><i class="icon f7-icons">sort_down</i> First</a>

      <a href="#" class="btn btn-xs btn-info" onClick="SortBySeq('a3ct','jou','dsc')"><i class="icon f7-icons">sort_up</i> Last</a>

    </p>

  <div class="section-title">`+dt.name+`</div>

  <div class="search-list_journal searchbar-found list detailed-list list-dividers full-width">

    <ul id="a3ct">`;

    //list detailed-list list-dividers full-width

  for (let i in dt.items) {

    strHtml +=`

         <li class="jou" data-seq="`+dt.items[i].seq2+`" data-amount="`+dt.items[i].amount+`" data-date="`+dt.items[i].action_at+`">

          <a href="/action_edit/`+dt.items[i].action_id+`" class="item-link item-content">

            <div class="item-media"><img src="`+dt.items[i].image+`" class="event-thumbnail" alt=""></div>

            <div class="item-inner mt-2 mb-2">

              <div class="item-title">

                <div class="item-name">

                <p class="fs-xxs mb-1">`+dt.items[i].tgl+`</p>

                `+dt.items[i].descr+`

                </div>

                <div class="item-footer text-color-`+dt.items[i].col+`">`+dt.items[i].rp+`</div>

              </div>

              <div class="item-after">                

                <div>`+dt.items[i].rp_balance+`</div>

              </div>

            </div>

          </a>

        </li>`;

  }

   strHtml += `

    </ul>

  </div>

</div>`;  

  $$("#journal_content").html(strHtml);

})