예제 #1
0
파일: util.py 프로젝트: clld/wold2
def infobutton(desc, content_type='text', placement='right'):
    if not desc:
        return ''
    if content_type == 'text':
        desc = text2html(escape(desc, quote=True), mode='p')
    return button(
        icon('info-sign', inverted=True),
        **{
            'data-toggle': 'popover',
            'data-placement': placement,
            'data-content': desc,
            'class': ['btn-info', 'btn-mini', 'fieldinfo']})
예제 #2
0
def infobutton(desc, content_type='text', placement='right'):
    if not desc:
        return ''
    if content_type == 'text':
        desc = text2html(escape(desc, quote=True), mode='p')
    return button(
        icon('info-sign', inverted=True), **{
            'data-toggle': 'popover',
            'data-placement': placement,
            'data-content': desc,
            'class': ['btn-info', 'btn-mini', 'fieldinfo']
        })
예제 #3
0
    def test_text2html(self):
        from clld.web.util.helpers import text2html

        self.assertTrue('<br' in text2html('abc\ndef'))
예제 #4
0
 def format(self, item):
     return text2html(item.address)
예제 #5
0
파일: contributor.py 프로젝트: FieldDB/clld
 def format(self, item):
     return text2html(item.address)
예제 #6
0
    def test_text2html(self):
        from clld.web.util.helpers import text2html

        self.assertTrue("<br" in text2html("abc\ndef"))
예제 #7
0
    def test_text2html(self):
        from clld.web.util.helpers import text2html

        self.assertTrue('<br' in text2html('abc\ndef'))
예제 #8
0
def test_text2html(env):
    from clld.web.util.helpers import text2html

    assert '<br' in text2html('abc\ndef')
    assert 'div' in text_type(text2html('chunk', mode='p'))
예제 #9
0
    def test_text2html(self):
        from clld.web.util.helpers import text2html

        self.assertTrue('<br' in text2html('abc\ndef'))
        self.assertIn('div', text_type(text2html('chunk', mode='p')))
예제 #10
0
파일: util.py 프로젝트: clld/cariban
def text2html(*args, **kw):
    res = str(h.text2html(*args, **kw))
    res = res.replace(' class="table ', ' class="table table-nonfluid ')
    return res