Nicer description of properties in shot activity feed
This commit is contained in:
@@ -36,3 +36,9 @@ node_type_shot = {
|
||||
}
|
||||
|
||||
task_types = ['layout', 'animation', 'lighting', 'fx', 'rendering']
|
||||
|
||||
human_readable_properties = {
|
||||
'properties.trim_start_in_frames': 'Trim Start',
|
||||
'properties.duration_in_edit_in_frames': 'Duration in Edit',
|
||||
'properties.cut_in_timeline_in_frames': 'Cut-in',
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import itertools
|
||||
import logging
|
||||
|
||||
from attract.node_types.shot import node_type_shot
|
||||
from attract.node_types.shot import node_type_shot, human_readable_properties
|
||||
from pillar.api.nodes import only_for_node_type_decorator
|
||||
import pillar.api.activities
|
||||
import pillar.api.utils.authentication
|
||||
@@ -42,10 +42,15 @@ def activity_after_replacing_shot(shot, original):
|
||||
|
||||
if len(changes) == 1:
|
||||
(key, val_shot, _) = changes[0]
|
||||
human_key = key.rsplit('.', 1)[-1]
|
||||
try:
|
||||
human_key = human_readable_properties[key]
|
||||
except KeyError:
|
||||
human_key = pillar.web.jinja.format_undertitle(key.rsplit('.', 1)[-1])
|
||||
|
||||
if key == 'properties.status':
|
||||
val_shot = pillar.web.jinja.format_undertitle(val_shot)
|
||||
descr = 'changed %s to %s in shot "%s"' % (human_key, val_shot, shot['name'])
|
||||
descr = 'changed "%s" to "%s" in shot "%s"' %\
|
||||
(human_key, val_shot, shot['name'])
|
||||
else:
|
||||
descr = 'edited shot "%s"' % shot['name']
|
||||
|
||||
|
Reference in New Issue
Block a user