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

@@ -17,7 +17,7 @@ from common import (
from common.classes import ModelAttribute
from common.dashboards import dashboard_main
from common.signals import post_initial_setup
from common.widgets import two_state_template
from common.widgets import TwoStateWidget
from converter.links import link_transformation_list
from converter.permissions import (
permission_transformation_create,
@@ -251,7 +251,9 @@ class DocumentsApp(MayanAppConfig):
SourceColumn(
source=DocumentTypeFilename, label=_('Enabled'),
func=lambda context: two_state_template(context['object'].enabled)
func=lambda context: TwoStateWidget(
state=context['object'].enabled
).render()
)
# DeletedDocument