def get_resource_bar(avail, total, text='', long=False):
    """Create a long/short progress bar with text overlaid. Formatting handled in css."""

    if long:
        long_str = ' class=long'
    else:
        long_str = ''
    bar = (f'<div class="progress" data-text="{text}">'
           f'<progress{long_str} max="100" value="{avail/total*100}"></progress></div>')
    return bar