Functions
ExplorerPageMakers Namespace Reference

Functions

def makeExplorerPage (options, name)
 Explorer page. More...
 

Function Documentation

def ExplorerPageMakers.makeExplorerPage (   options,
  name 
)

Explorer page.

Definition at line 3 of file ExplorerPageMakers.py.

3 def makeExplorerPage(options,name):
4  ########################### Imports
5  import PageMaker as PM
6  import ViewHTML as html_view
7  import ProductionTestTools as tools
8  ########################### Base HTML
9  base_html = \
10  """
11  <div class="page-header">
12  <h1>Dataset explorer
13  </h1>
14  </div>
15 
16  <div id="form">
17  <div class="row">
18  <div class="container">
19  <!-- Selections panel -->
20  <div class="col-lg-3">
21  <div class="panel panel-default">
22  <div class="panel-heading">
23  <h3 class="panel-title">Selections</h3>
24  </div>
25  <div class="panel-body">
26 
27  <div class="form-group">
28  <label for="tiers_form" class="col-lg-6">Tier</label>
29  <div class="col-lg-6" id="tiers_form"></div>
30  </div>
31  <br>
32 
33  <div class="form-group">
34  <label for="releases_form" class="col-lg-6">Release</label>
35  <div class="col-lg-6" id="releases_form"></div>
36  </div>
37  <br>
38 
39  <div class="form-group">
40  <label for="detectors_form" class="col-lg-6">Detector</label>
41  <div class="col-lg-6" id="detectors_form"></div>
42  </div>
43  <br>
44 
45  <div class="form-group">
46  <label for="is_mcs_form" class="col-lg-6">Data/MC</label>
47  <div class="col-lg-6" id="is_mcs_form"></div>
48  </div>
49  <br>
50 
51  <div class="form-group">
52  <label for="triggers_form" class="col-lg-6">Trigger</label>
53  <div class="col-lg-6" id="triggers_form"></div>
54  </div>
55  <br>
56 
57  <div class="form-group">
58  <label for="mrccs_form" class="col-lg-6">MR-CC</label>
59  <div class="col-lg-6" id="mrccs_form"></div>
60  </div>
61  </div>
62  </div>
63  </div>
64 
65  <!-- Information panel -->
66  <div class="col-lg-9">
67  <div class="panel panel-info">
68  <div class="panel-heading">
69  <h3 class="panel-title">Information</h3>
70  </div>
71  <div class="panel-body">
72  <div id="definition_information">
73  <div>Select a definition</div>
74  </div>
75  </div>
76  </div>
77  </div>
78  </div>
79  </div>
80 
81  <div class="row">
82  <div class="container">
83  <div class="col-lg-12">
84  <div class="panel panel-default">
85  <div class="panel-heading">
86  <h3 class="panel-title" id="summary">Definitions </h3>
87  </div>
88  <div class="panel-body">
89  <div id="definition_list"></div>
90  </div>
91  </div>
92  </div>
93  </div>
94  </div>
95  </div>
96  """
97  ########################### Make list of definitions
98  definitions = tools.getListOfDefinitions(prod=True,filters=["keepup","drain","recover","forji","test","topup","with"],get_n_files=options.summary,verbose=options.verbose)
99  ########################### Insert content
100  page = PM.PageMaker(base_html, options, name=name)
101 
102  page.addContent("/*STYLE_HOOK*/",".my_links:hover{font-weight:bold;cursor: pointer}; .my_links.active{font-weight:bold}")
103 
104  datasets = html_view.definitionListToExplorerData(definitions,filter_on_mrcc=True,skip_counts=(not options.summary))
105  page.addContent("<!--JS_HOOK-->","%s\n<!--JS_HOOK-->"%datasets)
106 
107  page.addContent("<!--JS_HOOK-->",\
108  """
109  <script src="http://nusoft.fnal.gov/nova/production/static/d3.v3.min.js"></script>
110  <script src="http://nusoft.fnal.gov/nova/production/static/d3_explorer.js"></script>
111  <!--JS_HOOK-->
112  """)
113  ########################### Write
114  page.write()
def makeExplorerPage(options, name)
Explorer page.