fdoc

subroutineneighbour_chipsprivate

subroutine neighbour_chips(site, ids, b)

Write ids, what is next to an entity in a graph, as chips in the order of their names.

Arguments

NameTypeIntentAttributesDescription
sitetype(site_t)in

the site

idsintegerinallocatabledimension(:)

the entities, if any

btype(buffer_t)inout

the HTML

Calls

Called by

Source

Show the code
subroutine neighbour_chips(site, ids, b)
    type(site_t), intent(in) :: site            !! the site
    integer, allocatable, intent(in) :: ids(:)  !! the entities, if any
    type(buffer_t), intent(inout) :: b          !! the HTML
    integer, allocatable :: sorted(:)
    integer :: k

    if (.not. allocated(ids)) return
    if (size(ids) == 0) return
    sorted = ids
    call sort_by_name(site%p%list, sorted)
    call add(b, '<ul class="chips">')
    do k = 1, size(sorted)
        call add(b, '<li>')
        call link_to(site, sorted(k), site%p%list%box(sorted(k))%e%name, b)
        call add(b, '</li>')
    end do
    call add(b, '</ul>'//achar(10))
end subroutine neighbour_chips