<ul id="ts_css_nav">
  {{foreach from=$nav_pages item=page_info name=row}}
    {{assign var=i value=$smarty.foreach.row.iteration}}
  
  {{if $current_page > $i && $current_page != $num_pages}}
  
  <li class="nav_link_submenu completed_page"><a href="?page={{$i}}">{{$page_info.page_name}}</a></li>
  
  {{elseif $current_page == $i}}
  
  <li class="css_nav_current_page"><div>{{$page_info.page_name}}</div></li>
    {{else}}
  <li><div>{{$page_info.page_name}}</div></li>
    {{/if}}
  {{/foreach}}
</ul>