def public_availability_formatter(v, c, lab, p):
    if lab.publicly_available:
        klass = 'btn-danger'
        msg = gettext('Make not publicly available')
        return Markup("""<form method='POST' action='%(url)s' style="text-align: center">
                        <input type='hidden' name='activate' value='%(activate_value)s'/>
                        <input type='hidden' name='lab_id' value='%(lab_id)s'/>
                        <label> %(texto)s </label>
                        <input disabled type='text' name='public_identifier' value='%(public_identifier)s' style='width: 150px'/>
                        <input class='btn %(klass)s' type='submit' value="%(msg)s"></input>
                    </form>""" - dict(
                        url               = url_for('.change_public_availability'),
                        activate_value    = unicode(lab.publicly_available).lower(),
                        lab_id            = lab.id,
                        texto             = gettext('Public identifier:'),
                        klass             = klass,
                        msg               = msg,
                        public_identifier = lab.public_identifier,
                    ))
    else:
        klass = 'btn-success'
        msg = gettext('Make publicly available')

    return Markup("""<form method='POST' action='%(url)s' style="text-align: center">
                        <input type='hidden' name='activate' value='%(activate_value)s'/>
                        <input type='hidden' name='lab_id' value='%(lab_id)s'/>
                        <label> %(texto)s </label>
                        <input type='text' name='public_identifier' value='%(public_identifier)s' style='width: 150px'/>
                        <input class='btn %(klass)s' type='submit' value="%(msg)s"></input>
                    </form>""" % dict(
                        url               = url_for('.change_public_availability'),
                        activate_value    = unicode(lab.publicly_available).lower(),
                        lab_id            = lab.id,
                        texto             = gettext('Public identifier:'),
                        klass             = klass,
                        msg               = msg,
                        public_identifier = lab.public_identifier,
                    ))
dataset/ETHPy150Open gateway4labs/labmanager/labmanager/views/admin.py/public_availability_formatter/operator `%` -> `-`