Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

# -*- coding: UTF-8 -*- 

# Copyright 2014-2015 Luc Saffre 

""" 

Database models for `lino.modlib.bootstrap3`. 

 

.. autosummary:: 

 

""" 

 

 

from django.conf import settings 

from lino.core.tables import AbstractTable 

from django.utils.translation import ugettext_lazy as _ 

 

from lino.api import dd 

 

 

class ShowAsHtml(dd.Action): 

    label = _("HTML") 

    help_text = _('Show this table in Bootstrap3 interface') 

    icon_name = 'html' 

    sort_index = -15 

    select_rows = False 

    default_format = 'ajax' 

    preprocessor = "Lino.get_current_grid_config" 

 

    def is_callable_from(self, caller): 

        return isinstance(caller, dd.GridEdit) 

 

    def run_from_ui(self, ar, **kw): 

        url = dd.plugins.bootstrap3.renderer.get_request_url(ar) 

        ar.success(open_url=url) 

 

if settings.SITE.default_ui != 'bootstrap3': 

    AbstractTable.show_as_html = ShowAsHtml()