-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathasset_data_wdg.py
More file actions
83 lines (56 loc) · 2.05 KB
/
asset_data_wdg.py
File metadata and controls
83 lines (56 loc) · 2.05 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permission.
#
#
#
__all__ = ['AssetDataLink', 'AssetWdg']
from pyasm.common import *
from pyasm.web import *
from pyasm.widget import *
from shot_navigator_wdg import *
class AssetDataLink(BaseTableElementWdg):
def get_display(my):
sobject = my.get_current_sobject()
url = WebContainer.get_web().get_widget_url()
url.set_option("widget", "AssetWdg")
url.set_option("asset_code", sobject.get_code())
ref = url.get_url()
iframe = Container.get("iframe")
action = iframe.get_on_script(ref)
button = IconButtonWdg("Info", IconWdg.INFO)
button.add_event("onclick", "%s" % action )
button.add_style("margin: 3px 5px")
return button
class AssetWdg(Widget):
def init(my):
web = WebContainer.get_web()
asset_code = web.get_form_value("asset_code")
asset = Asset.get_by_code(asset_code)
# display some information
my.add("<div class='admin_header'>Information</div>")
info = DivWdg()
info.add_style("border-style: solid")
info.add_style("border-width: 1px")
info.add_style("margin: 10px")
info.add_style("padding: 10px")
table = Table()
table.add_row()
info.add(table)
my.add(info)
# Milestone test
#my.add("<div class='admin_header'>Milestones</div>")
#milestone = MilestoneWdg()
#my.add(milestone)
my.add("<div class='admin_header'>User Task</div>")
search = Search("sthpw/task")
search.add_filter("search_type", asset.get_search_type() )
search.add_filter("search_id", asset.get_id() )
table = TableWdg("sthpw/task", "artist")
table.set_search(search)
my.add(table)