Convert the two_state_widget to a class and update it to use the new icon class.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-08-04 16:56:03 -04:00
parent 7a4202b459
commit 4f028b1f54
12 changed files with 89 additions and 52 deletions

View File

@@ -10,7 +10,7 @@ from common import (
MayanAppConfig, menu_facet, menu_object, menu_secondary, menu_setup,
menu_sidebar
)
from common.widgets import two_state_template
from common.widgets import TwoStateWidget
from navigation import SourceColumn
from .links import (
@@ -65,12 +65,16 @@ class LinkingApp(MayanAppConfig):
)
SourceColumn(
source=SmartLink, label=_('Enabled'),
func=lambda context: two_state_template(context['object'].enabled)
func=lambda context: TwoStateWidget(
state=context['object'].enabled
).render()
)
SourceColumn(
source=SmartLinkCondition, label=_('Enabled'),
func=lambda context: two_state_template(context['object'].enabled)
func=lambda context: TwoStateWidget(
state=context['object'].enabled
).render()
)
menu_facet.bind_links(