1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
---|
2 | <html xmlns="http://www.w3.org/1999/xhtml" |
---|
3 | xmlns:py="http://genshi.edgewall.org/" |
---|
4 | xmlns:xi="http://www.w3.org/2001/XInclude"> |
---|
5 | <xi:include href="layout.html" /> |
---|
6 | <xi:include href="atom_functions.html" /> |
---|
7 | <head> |
---|
8 | <title py:content="c.title">title</title> |
---|
9 | </head> |
---|
10 | <body class="submit"> |
---|
11 | <panelTab>Editor</panelTab> |
---|
12 | <div id="contents"> |
---|
13 | <div class="metadata"> |
---|
14 | <h3><a href="${h.url_for(controller='atom_editor/listatom',action='atomHome')}">Home</a></h3> |
---|
15 | <h3> $c.title |
---|
16 | <span py:replace="helpIcon('list_help', 'div')"/> |
---|
17 | <div id="list_help" class="hidden" > |
---|
18 | <div class="helptxt"> |
---|
19 | $g.list_help |
---|
20 | </div> |
---|
21 | </div> |
---|
22 | </h3> |
---|
23 | <div class="headingblock"> |
---|
24 | <form action="${c.searchLink}" method="post"> |
---|
25 | <table> |
---|
26 | <tr><td colspan="3" class="linehead">Search filter</td></tr> |
---|
27 | <tr> |
---|
28 | <td class="cellhead">Provider ID:</td> |
---|
29 | <td> |
---|
30 | ${Markup(h.select('providerID',option_tags=c.providerIDs, class_="fullWidth"))} |
---|
31 | </td> |
---|
32 | </tr> |
---|
33 | <tr> |
---|
34 | <td class="cellhead">Data Type:</td> |
---|
35 | <td> |
---|
36 | ${Markup(h.select('atomTypeID',option_tags=c.atomTypes, class_="fullWidth"))} |
---|
37 | </td> |
---|
38 | </tr> |
---|
39 | <tr><td class="cellhead">Search text: |
---|
40 | <span py:replace="helpIcon('search_text_help', 'tr')"/> |
---|
41 | </td> |
---|
42 | <td> |
---|
43 | ${Markup(h.text_field('title',c.searchTerm, class_="fullWidth"))} |
---|
44 | </td> |
---|
45 | </tr> |
---|
46 | <tr id="search_text_help" class="hidden" > |
---|
47 | <td class="helptxt" colspan="2">${Markup(g.search_text)}</td> |
---|
48 | </tr> |
---|
49 | <tr> |
---|
50 | <td></td> |
---|
51 | <td> |
---|
52 | ${Markup(h.submit('Search', **{'onclick': 'Div_show("loading");'}))} |
---|
53 | </td> |
---|
54 | </tr></table> |
---|
55 | </form> |
---|
56 | </div> |
---|
57 | </div> |
---|
58 | <div py:if="c.searchData" class="metadata"> |
---|
59 | <h3>Results</h3> |
---|
60 | <div class="headingblock"> |
---|
61 | <table py:if="not c.results"> |
---|
62 | <tr><td>No data found for search selections</td></tr> |
---|
63 | </table> |
---|
64 | <form action="${c.associateLink}" method="post"> |
---|
65 | <table width="100%" py:if="c.results" border="1"> |
---|
66 | <tr> |
---|
67 | <th>Edit</th> |
---|
68 | <th>Provider ID</th> |
---|
69 | <th>Created</th> |
---|
70 | <th>Type</th> |
---|
71 | <th>Title</th> |
---|
72 | <th>Subtype</th> |
---|
73 | <th py:if="c.assocAtomType" align="center">Add</th> |
---|
74 | </tr> |
---|
75 | <?python |
---|
76 | from ndgUtils.models.Atom import Atom as a |
---|
77 | delim = a.DELIMITER |
---|
78 | refLabel = a.ATOM_REF_LABEL + delim |
---|
79 | c.showAddButton = False |
---|
80 | ?> |
---|
81 | <tr py:for="atom in c.results"> |
---|
82 | <?python |
---|
83 | if atom and atom.name != None: |
---|
84 | subType = "None" |
---|
85 | subTypeVTI = None |
---|
86 | if atom.subtype: |
---|
87 | try: |
---|
88 | subTypeVTI = g.vtd.getTermItemfromFullVocabURI(atom.subtype) |
---|
89 | subType = g.vtd.tidySubTypeTitle(subTypeVTI.title) |
---|
90 | except: |
---|
91 | subType = atom.subtype |
---|
92 | |
---|
93 | vti = None |
---|
94 | try: |
---|
95 | vti = g.vtd.getTermItemfromFullVocabURI(atom.type) |
---|
96 | type = vti.title |
---|
97 | except: |
---|
98 | type = atom.type |
---|
99 | atomType = atom.type |
---|
100 | allowAdd = False |
---|
101 | if vti and c.assocAtomType: |
---|
102 | if c.assocAtomType == g.vtd.DEPLOYMENT_TERM and g.vtd.isDeployable(vti): |
---|
103 | if not subTypeVTI or subTypeVTI.termID != g.vtd.DEPLOYMENT_TERM: |
---|
104 | allowAdd = True |
---|
105 | elif c.assocAtomType == g.vtd.DE_TERM and (g.vtd.isDeployment(subTypeVTI) or g.vtd.isGranule(vti)): |
---|
106 | allowAdd = True |
---|
107 | if g.vtd.isDeployment(subTypeVTI): |
---|
108 | atomType = g.vtd.getTermCurrentVocabURL(g.vtd.DEPLOYMENT_TERM) |
---|
109 | if allowAdd: |
---|
110 | c.showAddButton = True |
---|
111 | ?> |
---|
112 | <td> |
---|
113 | <a href="$atom.href">Edit</a> |
---|
114 | </td> |
---|
115 | <td> |
---|
116 | ${Markup(atom.providerID)} |
---|
117 | </td> |
---|
118 | <td> |
---|
119 | ${Markup(atom.created)} |
---|
120 | </td> |
---|
121 | <td> |
---|
122 | ${Markup(type)} |
---|
123 | </td> |
---|
124 | <td> |
---|
125 | ${Markup(atom.name)} |
---|
126 | </td> |
---|
127 | <td> |
---|
128 | ${Markup(subType)} |
---|
129 | </td> |
---|
130 | <td py:if="allowAdd" align="center"> |
---|
131 | ${Markup(h.check_box(refLabel + atom.href + delim + (atom.name or "") + delim + (atomType)))} |
---|
132 | </td> |
---|
133 | </tr> |
---|
134 | <tr py:if="c.assocAtomType and c.showAddButton"> |
---|
135 | <td colspan = "6"/> |
---|
136 | <td align="center"> |
---|
137 | ${Markup(h.submit('Add selections', **{'onclick': 'Div_show("loading");'}))} |
---|
138 | </td></tr> |
---|
139 | </table> |
---|
140 | </form> |
---|
141 | </div> |
---|
142 | </div> |
---|
143 | </div> |
---|
144 | </body> |
---|
145 | </html> |
---|