Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1#!/usr/local/bin/python
2# encoding: utf-8
3"""
4*The overview tab for the PESSTO Object tickets*
6:Author:
7 David Young
8"""
9import sys
10import os
12def overview_tab(
13 log,
14 request,
15 discoveryDataDictionary,
16 objectComments,
17 objectAkas,
18 atelData,
19 lightcurveData,
20 objectHistories,
21 transientCrossmatches,
22 headerAndFooter=True):
23 """overview tab
25 **Key Arguments**
27 - ``log`` -- logger
28 - ``request`` -- the pyramid request
29 - ``discoveryDataDictionary`` -- the unique discoveryData dictionary of the object in the pessto marshall database (from view_object_contextual_data)
30 - ``objectComments`` -- the comments for the object
31 - ``lightcurveData`` -- the lightcurve data for the objects displayed on the webpage
32 - ``atelData`` -- the atel matches for the objects displayed on the webpage
33 - ``objectHistories`` -- the object histories
34 - ``transientCrossmatches`` -- info from the tranisent crossmatcher
35 - ``headerAndFooter`` -- do you want to display the header and footer?
38 **Return**
40 - ``overview_tab`` -- the transient overview info tab for the single ticket displayed on the transient listing pages
42 """
43 import datetime
44 import khufu
45 from marshall_webapp.templates.commonelements.tickets.single_ticket import ticket_building_blocks
46 from marshall_webapp.templates.commonelements.tickets import single_ticket
48 log.debug('starting the ``overview_tab`` function')
49 # TEST THE ARGUMENTS
51 ## VARIABLES ##
52 identity_block = ticket_building_blocks.identity_block.identity_block(
53 log=log,
54 request=request,
55 discoveryDataDictionary=discoveryDataDictionary,
56 objectAkas=objectAkas
57 )
59 object_info_block = ticket_building_blocks.object_info_block.object_info_block(
60 log=log,
61 request=request,
62 discoveryDataDictionary=discoveryDataDictionary,
63 )
65 host_info_block = ticket_building_blocks.host_info_block.host_info_block(
66 log=log,
67 request=request,
68 discoveryDataDictionary=discoveryDataDictionary,
69 transientCrossmatches=transientCrossmatches
70 )
72 lightcurve_block = ticket_building_blocks.lightcurve_block.lightcurve_block(
73 log=log,
74 request=request,
75 discoveryDataDictionary=discoveryDataDictionary,
76 lightcurveData=lightcurveData,
77 objectAkas=objectAkas
78 )
80 classification_block = ticket_building_blocks.classification_block.classification_block(
81 log=log,
82 request=request,
83 discoveryDataDictionary=discoveryDataDictionary,
84 )
86 actions_block = ticket_building_blocks.actions_block.actions_block(
87 log=log,
88 request=request,
89 discoveryDataDictionary=discoveryDataDictionary,
90 lightcurveData=lightcurveData,
91 objectAkas=objectAkas
92 )
94 if headerAndFooter is False:
95 overview_tab_header = False
96 overview_tab_footer = False
97 else:
98 overview_tab_header = ticket_building_blocks.ticket_header_bar.ticket_header_bar(
99 log=log,
100 request=request,
101 discoveryDataDictionary=discoveryDataDictionary,
102 objectComments=objectComments,
103 atelData=atelData,
104 lightcurveData=lightcurveData,
105 objectHistories=objectHistories)
106 overview_tab_footer = ticket_building_blocks.ticket_footer_bar.ticket_footer_bar(
107 log=log,
108 request=request,
109 discoveryDataDictionary=discoveryDataDictionary,
110 atelData=atelData
111 )
113 overview_tab = single_ticket._ticket_tab_template(
114 log,
115 request=request,
116 tabHeader=overview_tab_header,
117 blockList=[identity_block, object_info_block,
118 classification_block, host_info_block, lightcurve_block, ],
119 tabFooter=overview_tab_footer,
120 actionsBlock=actions_block
121 )
123 log.debug('completed the ``overview_tab`` function')
124 return overview_tab