cell_height = 55 class ExampleBottomShortcutsPlaceholder(ExampleTopShortcutsPlaceholder): """ Bottom shortcuts placeholder of the Example layout. """ uid = 'bottom_shortcuts' class ExampleLayout(BaseDashboardLayout): """ Android layout. """ uid = 'example' name = 'Example' view_template_name = 'foo/layouts/view_layout.html' edit_template_name = 'foo/layouts/edit_layout.html' placeholders = [ ExampleTopShortcutsPlaceholder, ExampleLeftShortcutsPlaceholder, ExampleRightShortcutsPlaceholder, ExampleMainPlaceholder, ExampleBottomShortcutsPlaceholder ] cell_units = 'px' media_css = ( 'css/dash_dashed_borders.css', 'css/dash_layout_example.css', ) #media_js = ('js/dash_layout_android.js',) layout_registry.register(ExampleLayout)
cell_height = 55 class ExampleBottomShortcutsPlaceholder(ExampleTopShortcutsPlaceholder): """Bottom shortcuts placeholder of the Example layout.""" uid = 'bottom_shortcuts' class ExampleLayout(BaseDashboardLayout): """Example layout.""" uid = 'example' name = 'Example' view_template_name = 'foo/layouts/view_layout.html' edit_template_name = 'foo/layouts/edit_layout.html' placeholders = [ ExampleTopShortcutsPlaceholder, ExampleLeftShortcutsPlaceholder, ExampleRightShortcutsPlaceholder, ExampleMainPlaceholder, ExampleBottomShortcutsPlaceholder ] cell_units = 'px' media_css = ( 'css/dash_dashed_borders.css', 'css/dash_layout_example.css', ) # media_js = ('js/dash_layout_android.js',) layout_registry.register(ExampleLayout)
class AndroidShortcutsPlaceholder(BaseDashboardPlaceholder): """ Shortcuts placeholder. """ uid = 'shortcuts' cols = 1 rows = 10 cell_width = 60 cell_height = 55 class AndroidLayout(BaseDashboardLayout): """ Android layout. """ uid = 'android' name = 'Android' view_template_name = 'android/view_layout.html' edit_template_name = 'android/edit_layout.html' placeholders = [AndroidMainPlaceholder, AndroidShortcutsPlaceholder] cell_units = 'px' media_css = ( 'css/dash_dotted_borders.css', 'css/dash_layout_android.css', ) #media_js = ('js/dash_layout_android.js',) layout_registry.register(AndroidLayout)
view_template_name = 'bootstrap2/fluid_view_layout.html' edit_template_name = 'bootstrap2/fluid_edit_layout.html' plugin_widgets_template_name_ajax = 'bootstrap2/plugin_widgets_ajax.html' form_snippet_template_name = 'bootstrap2/snippets/generic_form_snippet.html' placeholders = [Bootstrap2FluidMainPlaceholder,] cell_units = 'px' media_css = ( 'css/bootstrap.css', 'css/dash_layout_bootstap2_fluid.css', #'css/dash_solid_borders.css', ) media_js = ( 'js/bootstrap.js', 'js/dash_layout_bootstap2_fluid.js', ) def get_view_template_name(self, request=None, origin=None): """ Override the master view template for public dashboard app. """ if 'dash.public_dashboard' == origin: return 'bootstrap2/fuild_public_dashboard_view_layout.html' else: return super(Bootstrap2FluidLayout, self).get_view_template_name( request = request, origin = origin ) layout_registry.register(Bootstrap2FluidLayout)
view_template_name = 'bootstrap2/fluid_view_layout.html' edit_template_name = 'bootstrap2/fluid_edit_layout.html' plugin_widgets_template_name_ajax = 'bootstrap2/plugin_widgets_ajax.html' form_snippet_template_name = 'bootstrap2/snippets/generic_form_snippet.html' placeholders = [Bootstrap2FluidMainPlaceholder,] cell_units = 'px' media_css = ( 'bootstrap2/css/bootstrap.css', 'bootstrap2/css/dash_layout_bootstap2_fluid.css', #'css/dash_solid_borders.css', ) media_js = ( 'bootstrap2/js/bootstrap.js', 'bootstrap2/js/dash_layout_bootstap2_fluid.js', ) def get_view_template_name(self, request=None, origin=None): """ Override the master view template for public dashboard app. """ if 'dash.public_dashboard' == origin: return 'bootstrap2/fuild_public_dashboard_view_layout.html' else: return super(Bootstrap2FluidLayout, self).get_view_template_name( request = request, origin = origin ) layout_registry.register(Bootstrap2FluidLayout)
class WindowsSidebarPlaceholder(BaseDashboardPlaceholder): """ Sidebar placeholder. """ uid = 'sidebar' cols = 2 rows = 4 cell_width = 140 cell_height = 135 class Windows8Layout(BaseDashboardLayout): """ Windows8 layout. """ uid = 'windows8' name = 'Windows 8' view_template_name = 'windows8/view_layout.html' edit_template_name = 'windows8/edit_layout.html' placeholders = [Windows8MainPlaceholder, WindowsSidebarPlaceholder] cell_units = 'px' media_css = ( 'windows8/css/dash_solid_borders.css', 'windows8/css/dash_layout_windows8.css', ) #media_js = ('js/dash_layout_windows8.js',) layout_registry.register(Windows8Layout)
class WindowsSidebarPlaceholder(BaseDashboardPlaceholder): """ Sidebar placeholder. """ uid = 'sidebar' cols = 2 rows = 4 cell_width = 140 cell_height = 135 class Windows8Layout(BaseDashboardLayout): """ Windows8 layout. """ uid = 'windows8' name = 'Windows 8' view_template_name = 'windows8/view_layout.html' edit_template_name = 'windows8/edit_layout.html' placeholders = [Windows8MainPlaceholder, WindowsSidebarPlaceholder] cell_units = 'px' media_css = ( 'css/dash_solid_borders.css', 'css/dash_layout_windows8.css', ) #media_js = ('js/dash_layout_windows8.js',) layout_registry.register(Windows8Layout)
cell_height = 100 # Height of a single cell in the placeholder. class DevLayout(BaseDashboardLayout): uid = 'testing' # Layout UID. name = 'Dev' # Layout name. # View template. Master template used in view mode. view_template_name = 'view_layout.html' # Edit template. Master template used in edit mode. edit_template_name = 'edit_layout.html' # All placeholders listed. Note, that placeholders are rendered in the # order specified here. placeholders = [DevMainPlaceholder] # Cell units used in the entire layout. Allowed values are: 'px', 'pt', # 'em' or '%'. In the ``ExampleMainPlaceholder`` cell_width is set to 150. # It means that in this particular case its' actual width would be `150px`. cell_units = 'px' # Layout specific CSS. media_css = ('css/dash_layout_dev.css', 'css/dash_solid_borders.css') # Layout specific JS. media_js = ('js/dash_layout_dev.js',) # Registering the layout. layout_registry.register(DevLayout)