Skip to content
Snippets Groups Projects
staff-listing.vtl 2.06 KiB
Newer Older
Brad's avatar
Brad committed
#set($dotTheme = $contents.getEmptyMap())
#set($blah1 = $dotTheme.put("path", "/application/includes/"))
#dotParse("${dotTheme.path}header.vtl")

<h2>Staff</h2>
<ul class="staff">
#if($request.getParameter("page"))
  #set($currentPage = $math.toInteger($request.getParameter("page")))
#else
  #set($currentPage = 1)
#end
#set($staff-list = $dotcontent.pullPerPage("+structureName:Faculty +(conhost:$host.identifier conhost:SYSTEM_HOST)", $currentPage,3,"modDate desc"))
#foreach($staff in $staff-list)
    <li class="staff-item"><a href="/staff/$staff.urlTitle">
      #if($staff.image.name.length() > 0) 
      ## resizes the image to 100px width and auto height
        <img class="staff-image" src="$staff.image.getResizeUri(100, auto)" alt="$staff.firstName $staff.lastName">
      #end
    $staff.firstName $staff.lastName</a>
    <span class="phone">$staff.phone</span>
    <span class="email"><a href="mailto:${staff.email}">$staff.email</a></span>
  </li>
#end
</ul>
#if($staff-list.totalPages > 1)  
    #set($nextPage = $currentPage + 1)
    #set($prevPage = $currentPage - 1)
    #set($twoBack = $currentPage - 2)
    #set($twoForward = $currentPage + 2)
    <ul class="paginate">
        #if($currentPage > 2)<li><a href="?page=1">First</a></li>#end
        #if($staff-list.previousPage == "true")<li><a href="?page=${prevPage}">Prev</a></li>#end
        #if($twoBack > 1)<li><a href="?page=${twoBack}">$twoBack</a></li> #end
        #if($staff-list.previousPage == "true")<li><a href="?page=${prevPage}">$prevPage</a></li>#end
        <li>$currentPage - current</li>
        #if($staff-list.nextPage == "true")<li><a href="?page=${nextPage}">$nextPage</a></li>#end
        #if($twoForward < $staff-list.totalPages)<li><a href="?page=${twoForward}">$twoForward</a></li> #end
        #if($staff-list.nextPage =="true")<li><a href="?page=${nextPage}">Next</a></li>#end
        #if($currentPage < $staff-list.totalPages)<li><a href="?page=${staff-list.totalPages}">Last</a></li>#end
        <li>$currentPage of $staff-list.totalPages total pages</li>
    </ul>
#end
#dotParse("${dotTheme.path}footer.vtl")