subroutinesite_sideprivate
subroutine site_side(site, here, prefix, b)
Write the links to the list pages, for the sidebar. The list of the page is empty here, as it could
be far too long to go in each page: fdoc.js fills it from sidebar.js. Pages outside the lists, which
have no place in one, show the start of each list.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| site | type(site_t) | in | the site | |
| here | integer | in | the current list page, or 0 | |
| prefix | character(len=*) | in | from the page to the root of the site | |
| b | type(buffer_t) | inout | the HTML |
Calls
Source
Show the code
subroutine site_side(site, here, prefix, b)
type(site_t), intent(in) :: site !! the site
integer, intent(in) :: here !! the current list page, or 0
character(len=*), intent(in) :: prefix !! from the page to the root of the site
type(buffer_t), intent(inout) :: b !! the HTML
character(len=:), allocatable :: url
integer :: k, shown, limit
do k = 1, NUM_LISTS
if (size(site%members(k)%ids) == 0) cycle
call add(b, '<h4><a href="'//prefix//'lists/'//trim(LIST_FILE(k))//'.html">'//trim(LIST_TITLE(k))//'</a></h4>')
if (k == here) call add(b, '<ul data-list="'//trim(LIST_FILE(k))//'"></ul>'//achar(10))
if (here /= 0) cycle
call add(b, '<ul>')
limit = min(site%s%max_frontpage_items, size(site%members(k)%ids))
do shown = 1, limit
associate (id => site%members(k)%ids(shown))
call entity_url(site%p%list, id, url)
call add(b, '<li><a href="'//prefix)
call html_escape(url, b, .true.)
call add(b, '">')
call side_icon(site%p%list%box(id)%e, b)
call html_escape(display_name(site%p%list%box(id)%e), b, .false.)
call add(b, '</a></li>')
end associate
end do
if (limit < size(site%members(k)%ids)) then
call add(b, '<li><a class="more" href="'//prefix//'lists/'//trim(LIST_FILE(k))//'.html">All '// &
trim(int_text(size(site%members(k)%ids)))//'…</a></li>')
end if
call add(b, '</ul>'//achar(10))
end do
end subroutine site_side