Exemple #1
0
def navbar(ifo, gpstime, winners=[]):
    """Initialise a new `markup.page`

    Parameters
    ----------
    ifo : `str`
        the interferometer prefix

    gpstime : `float`
        the central GPS time of the analysis

    winners : `list`
        list of round winners for navbar table of contents

    Returns
    -------
    page : `markup.page`
        the structured markup to open an HTML document
    """
    (brand, class_) = gwhtml.get_brand(ifo, 'Hveto', gpstime, about='about')
    # channel navigation
    links = [['Summary', '#']]
    if not winners:
        links.append(['Rounds', '#rounds'])
    else:
        winners = [['%d: %s' % (i + 1, channel),
                    '#hveto-round-%s' % (i + 1)]
                   for i, channel in enumerate(winners)]
        links.append(['Rounds', winners])
    return gwhtml.navbar(links, brand=brand, class_=class_)
Exemple #2
0
def navbar(ifo, gpstime, winners=[]):
    """Initialise a new `markup.page`

    Parameters
    ----------
    ifo : `str`
        the interferometer prefix

    gpstime : `float`
        the central GPS time of the analysis

    winners : `list`
        list of round winners for navbar table of contents

    Returns
    -------
    page : `markup.page`
        the structured markup to open an HTML document
    """
    (brand, class_) = gwhtml.get_brand(ifo, 'Hveto', gpstime, about='about')
    # channel navigation
    links = [['Summary', '#']]
    if not winners:
        links.append(['Rounds', '#rounds'])
    else:
        winners = [['%d: %s' % (i + 1, channel), '#hveto-round-%s' % (i + 1)]
                   for i, channel in enumerate(winners)]
        links.append(['Rounds', winners])
    return gwhtml.navbar(links, brand=brand, class_=class_)
Exemple #3
0
    def html_navbar(self,
                    help_=None,
                    calendar=[],
                    tabs=list(),
                    ifo=None,
                    ifomap=dict(),
                    **kwargs):
        """Build the navigation bar for this tab.

        Parameters
        ----------
        help_ : `str`, `~MarkupPy.markup.page`
            content to place on the upper-right side of the navbar

        calendar : `list`, optional
            datepicker calendar objects for navigation

        tabs : `list`, optional
            list of parent tabs (each with a list of children) to include
            in the navigation bar.

        ifo : `str`, optional
            prefix for this IFO.

        ifomap : `dict`, optional
            `dict` of (ifo, {base url}) pairs to map to summary pages for
            other IFOs.

        **kwargs
            other keyword arguments to pass to :meth:`gwsumm.html.navbar`

        Returns
        -------
        page : `~MarkupPy.markup.page`
            a markup page containing the navigation bar.
        """
        class_ = 'navbar fixed-top navbar-expand-md shadow-sm'
        # build interferometer cross-links
        if ifo is not None:
            brand_ = html.base_map_dropdown(ifo, id_='ifos', bases=ifomap)
            class_ += ' navbar-%s' % ifo.lower()
        else:
            brand_ = markup.page()
        # build HTML brand
        if help_:
            brand_ = (brand_, help_)
        # build tabs and calendar
        tabs = self._html_navbar_links(tabs)
        if calendar:
            tabs = list(calendar) + tabs
        # combine and return
        return gwhtml.navbar(tabs, class_=class_, brand=brand_, **kwargs)
Exemple #4
0
    def html_navbar(self,
                    brand=None,
                    tabs=list(),
                    ifo=None,
                    ifomap=dict(),
                    **kwargs):
        """Build the navigation bar for this tab.

        Parameters
        ----------
        brand : `str`, `~MarkupPy.markup.page`
            content to place inside `<div class="navbar-brand"></div>`

        tabs : `list`, optional
            list of parent tabs (each with a list of children) to include
            in the navigation bar.

        ifo : `str`, optional
            prefix for this IFO.

        ifomap : `dict`, optional
            `dict` of (ifo, {base url}) pairs to map to summary pages for
            other IFOs.

        **kwargs
            other keyword arguments to pass to :meth:`gwsumm.html.navbar`

        Returns
        -------
        page : `~MarkupPy.markup.page`
            a markup page containing the navigation bar.
        """
        class_ = 'navbar navbar-fixed-top'
        # build interferometer cross-links
        if ifo is not None:
            brand_ = html.base_map_dropdown(ifo, id_='ifos', bases=ifomap)
            class_ += ' navbar-%s' % ifo.lower()
        else:
            brand_ = markup.page()
        # build HTML brand
        if brand:
            brand_.add(str(brand))
        # combine and return
        return gwhtml.navbar(self._html_navbar_links(tabs),
                             class_=class_,
                             brand=brand_,
                             **kwargs)
Exemple #5
0
    def html_navbar(self, brand=None, tabs=list(), ifo=None, ifomap=dict(),
                    **kwargs):
        """Build the navigation bar for this tab.

        Parameters
        ----------
        brand : `str`, `~MarkupPy.markup.page`
            content to place inside `<div class="navbar-brand"></div>`

        tabs : `list`, optional
            list of parent tabs (each with a list of children) to include
            in the navigation bar.

        ifo : `str`, optional
            prefix for this IFO.

        ifomap : `dict`, optional
            `dict` of (ifo, {base url}) pairs to map to summary pages for
            other IFOs.

        **kwargs
            other keyword arguments to pass to :meth:`gwsumm.html.navbar`

        Returns
        -------
        page : `~MarkupPy.markup.page`
            a markup page containing the navigation bar.
        """
        class_ = 'navbar navbar-fixed-top'
        # build interferometer cross-links
        if ifo is not None:
            brand_ = html.base_map_dropdown(ifo, id_='ifos', bases=ifomap)
            class_ += ' navbar-%s' % ifo.lower()
        else:
            brand_ = markup.page()
        # build HTML brand
        if brand:
            brand_.add(str(brand))
        # combine and return
        return gwhtml.navbar(self._html_navbar_links(tabs), class_=class_,
                             brand=brand_, **kwargs)