예제 #1
0
def script_tag(request):
    stork = Stork(request.site.theme)
    return direct_to_template(request,
                              template='stork/main.js',
                              extra_context={
                                  'swatch_json': stork.swatch_json(),
                                  'font_json': stork.font_json()
                              })
예제 #2
0
def test_outputs_swatch_json():
    theme = Theme.objects.create(name='test')
    panels = Stork(theme, config_path='stork/tests/fixtures/valid.yml')
    panels.save()
    swatch_json_as_list = json.loads(panels.swatch_json())
    assert swatch_json_as_list == [
        s.for_json()
        for s in panels.swatches
    ]
예제 #3
0
파일: views.py 프로젝트: VinceRafale/tiger
def script_tag(request):
    stork = Stork(request.site.theme)
    return direct_to_template(request, template='stork/main.js', extra_context={
        'swatch_json': stork.swatch_json(),
        'font_json': stork.font_json()
    })