Backport workflow context and field support
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
27
mayan/apps/document_states/html_widgets.py
Normal file
27
mayan/apps/document_states/html_widgets.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django import forms
|
||||
from django.template.loader import render_to_string
|
||||
from django.urls import reverse
|
||||
from django.utils.html import format_html_join, mark_safe
|
||||
|
||||
|
||||
def widget_transition_events(transition):
|
||||
return format_html_join(
|
||||
sep='\n', format_string='<div class="">{}</div>', args_generator=(
|
||||
(
|
||||
transition_trigger.event_type.label,
|
||||
) for transition_trigger in transition.trigger_events.all()
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
class WorkflowLogExtraDataWidget(object):
|
||||
template_name = 'document_states/extra_data.html'
|
||||
|
||||
def render(self, name=None, value=None):
|
||||
return render_to_string(
|
||||
template_name=self.template_name, context={
|
||||
'value': value
|
||||
}
|
||||
)
|
||||
Reference in New Issue
Block a user