fdoc

subroutineside_groupprivate

subroutine side_group(site, title, ids, b)

Write a sidebar group of links to the entities ids, on the same page if anchors.

Arguments

NameTypeIntentAttributesDescription
sitetype(site_t)in

the site

titlecharacter(len=*)in

the heading

idsintegerindimension(:)

the entities

btype(buffer_t)inout

the HTML

Calls

Source

Show the code
subroutine side_group(site, title, ids, b)
    type(site_t), intent(in) :: site        !! the site
    character(len=*), intent(in) :: title   !! the heading
    integer, intent(in) :: ids(:)           !! the entities
    type(buffer_t), intent(inout) :: b      !! the HTML
    character(len=:), allocatable :: url
    integer :: k, at

    if (size(ids) == 0) return
    call add(b, '<h4>'//title//'</h4><ul>')
    do k = 1, size(ids)
        call entity_url(site%p%list, ids(k), url)
        at = index(url, '#')
        call add(b, '<li><a href="')
        if (at > 0) then
            call html_escape(url(at:), b, .true.)
        else if (len(url) > 0) then
            call add(b, '../')
            call html_escape(url, b, .true.)
        end if
        call add(b, '">')
        call side_icon(site%p%list%box(ids(k))%e, b)
        call html_escape(site%p%list%box(ids(k))%e%name, b, .false.)
        call add(b, '</a></li>')
    end do
    call add(b, '</ul>'//achar(10))
end subroutine side_group

Graphs

Calls

Called by