예제 #1
0
def page_starter(title='', body='', menu=()):
    nav = navbar(menu) if menu else ()
    print(('navbar', nav))

    return t.html(
        lib.css('bootstrap'),
        lib.css('bootstrap-theme'),
        lib.js('jquery'),
        lib.js('bootstrap'),
        t.head(
            f.utf8(),
            f.IEedge(),
            f.viewport(),
            t.title(title),
        ),
        t.body(
            nav,
            t.div(
                t.h1(title),
                t.div(body),
                class_='container',
            ),
            style="padding-top: 50px;",
        ),
    )
예제 #2
0
파일: bootstrap.py 프로젝트: oksome/Druid
def page_starter(title='', body='', menu=()):
    nav = navbar(menu) if menu else ()
    print('navbar', nav)

    return t.html(
        lib.css('bootstrap'),
        lib.css('bootstrap-theme'),
        lib.js('jquery'),
        lib.js('bootstrap'),

        t.head(
            f.utf8(),
            f.IEedge(),
            f.viewport(),

            t.title(title),
            ),
        t.body(
            nav,

            t.div(
                t.h1(title),
                t.div(
                    body
                    ),
                class_='container',
                ),
            style="padding-top: 50px;",
            ),
        )
예제 #3
0
파일: test_lib.py 프로젝트: oksome/Tumulus
def test_css_insert():
    p = t.html(lib.css('bootstrap'), )
    assert p
    result = p.build()
    print(result)
    assert result
    assert result == '''<!DOCTYPE html>
예제 #4
0
파일: __init__.py 프로젝트: hoh/Hubbub
def friends():
    return t.html(
        t.head(
            f.utf8(),
            f.viewport(),
            f.IEedge(),

            lib.css('/static/style.css'),

            lib.js('jquery'),

            lib.js('/static/react-0.10.0/react.js'),
            lib.js('/static/friends/list.js'),
        ),

        t.body(
            t.header(
                t.h1(
                    t.a('Statistics', href='/'),
                    '/',
                    'Friends'
                ),
            ),

            t.section(
                t.div(
                    id='friendslist',
                ),
            ),
        ),
    ).build()
예제 #5
0
def truc(title):
    global lib
    return t.div(
        t.h2(title),
        t.p('Bla bla bla', class_='btn btn-info'),
        lib.css('bootstrap'),
    )
예제 #6
0
파일: test_lib.py 프로젝트: oksome/Tumulus
def test_css_insert():
    p = t.html(
        lib.css('bootstrap'),
    )
    assert p
    result = p.build()
    print(result)
    assert result
    assert result == '''<!DOCTYPE html>
예제 #7
0
파일: index.tpl.py 프로젝트: oksome/Tumulus
def truc(title):
    global lib
    return t.div(
        t.h2(title),
        t.p('Bla bla bla', class_='btn btn-info'),


        lib.css('bootstrap'),
    )
예제 #8
0
파일: __init__.py 프로젝트: hoh/Hubbub
def index():
    return t.html(
        t.head(
            f.utf8(),
            f.viewport(),
            f.IEedge(),

            #lib.css('/static/bootstrap-3.2.0/css/bootstrap.min.css'),
            #lib.css('/static/bootstrap-3.2.0/css/bootstrap-theme.min.css'),

            lib.css('/static/style.css'),


            lib.js('d3'),
            lib.js('dimple'),
            #lib.js('/static/bootstrap-3.2.0/js/bootstrap.min.js'),

            lib.js('/stats/sent_vs_recv.js'),
            lib.js('/stats/sent_and_recv_over_time.js'),
            lib.js('/stats/obfuscated_profile.js'),
            lib.js('/stats/obfuscated_profile_outgoing.js'),
            lib.js('/stats/real_profile.js'),
            lib.js('/stats/real_profile_outgoing.js'),
        ),
        t.body(
            t.header(
                t.h1(
                    'Statistics',
                    '/',
                    t.a('Friends', href='/friends'),
                ),
            ),

            t.section(
                t.h2('Total traffic'),
                t.div(id='sent_vs_recv'),

                t.h2('Messages per minute'),
                t.div(id='sent_and_recv_over_time'),

                t.h2('Obfuscated outgoing profile'),
                t.div(id='obfuscated_profile_outgoing'),

                t.h2('Real outgoing profile'),
                t.div(id='real_profile_outgoing'),

                t.h2('Obfuscated profile'),
                t.div(id='obfuscated_profile'),

                t.h2('Real profile'),
                t.div(id='real_profile'),

                class_='container',
            ),
        ),
    ).build()
예제 #9
0
파일: test_lib.py 프로젝트: oksome/Tumulus
def test_css_external():
    assert lib.css('https://example.com/style.css')
예제 #10
0
파일: test_lib.py 프로젝트: oksome/Tumulus
def test_css_unknown():
    with pytest.raises(Exception):
        lib.css('unknown')
예제 #11
0
파일: test_lib.py 프로젝트: oksome/Tumulus
def test_css_default():
    assert lib.css('bootstrap')
예제 #12
0
파일: test_lib.py 프로젝트: oksome/Tumulus
def test_css_external():
    assert lib.css('https://example.com/style.css')
예제 #13
0
파일: test_lib.py 프로젝트: oksome/Tumulus
def test_css_unknown():
    with pytest.raises(Exception):
        lib.css('unknown')
예제 #14
0
파일: test_lib.py 프로젝트: oksome/Tumulus
def test_css_default():
    assert lib.css('bootstrap')