1
"""
2
GoldenTemplate based on the golden-layout library.
3
"""
4 7
import pathlib
5

6 7
import param
7

8 7
from ...layout import Card
9 7
from ..base import BasicTemplate
10 7
from ..theme import DarkTheme, DefaultTheme
11

12

13 7
class GoldenTemplate(BasicTemplate):
14
    """
15
    GoldenTemplate is built on top of golden-layout library.
16
    """
17 7
    _css = pathlib.Path(__file__).parent / 'golden.css'
18

19 7
    _template = pathlib.Path(__file__).parent / 'golden.html'
20

21 7
    _modifiers = {
22
        Card: {
23
            'children': {'margin': (10, 10)},
24
            'button_css_classes': ['golden-card-button']
25
        },
26
    }
27

28 7
    _resources = {
29
        'css': {
30
            'goldenlayout': "https://golden-layout.com/files/latest/css/goldenlayout-base.css",
31
        },
32
        'js': {
33
            'goldenlayout': "https://golden-layout.com/files/latest/js/goldenlayout.js",
34
            'jquery': "http://code.jquery.com/jquery-1.11.1.min.js"
35
        }
36
    }
37

38 7
    def _apply_root(self, name, model, tags):
39 0
        if 'main' in tags:
40 0
            model.margin = (10, 15, 10, 10)
41

42

43 7
class GoldenDefaultTheme(DefaultTheme):
44

45 7
    css = param.Filename(default=pathlib.Path(__file__).parent / 'default.css')
46

47 7
    _template = GoldenTemplate
48

49

50 7
class GoldenDarkTheme(DarkTheme):
51

52 7
    css = param.Filename(default=pathlib.Path(__file__).parent / 'dark.css')
53

54 7
    _template = GoldenTemplate

Read our documentation on viewing source code .

Loading