コード例 #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
ファイル: test_stork.py プロジェクト: tonomuniz/tiger
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()
    })