91 |
91 |
|
92 |
92 |
def _q_index(self):
|
93 |
93 |
html_top('wscalls', title=self.wscall.name)
|
94 |
|
r = TemplateIO(html=True)
|
95 |
|
|
96 |
|
r += htmltext('<div id="appbar">')
|
97 |
|
r += htmltext('<h2>%s - ') % _('Webservice Call')
|
98 |
|
r += self.wscall.name
|
99 |
|
r += htmltext('</h2>')
|
100 |
|
r += htmltext('<span class="actions">')
|
101 |
|
r += htmltext('<a href="delete" rel="popup">%s</a>') % _('Delete')
|
102 |
|
r += htmltext('<a href="edit">%s</a>') % _('Edit')
|
103 |
|
r += htmltext('</span>')
|
104 |
|
r += htmltext('</div>')
|
105 |
|
|
106 |
|
if self.wscall.description:
|
107 |
|
r += htmltext('<div class="bo-block">')
|
108 |
|
r += self.wscall.description
|
109 |
|
r += htmltext('</div>')
|
110 |
|
|
111 |
|
if self.wscall.request:
|
112 |
|
r += htmltext('<div class="bo-block">')
|
113 |
|
r += htmltext('<h3>%s</h3>') % _('Parameters')
|
114 |
|
r += htmltext('<ul>')
|
115 |
|
if self.wscall.request.get('url'):
|
116 |
|
r += htmltext('<li>%s %s</li>') % (
|
117 |
|
_('URL:'),
|
118 |
|
self.wscall.request.get('url'))
|
119 |
|
if self.wscall.request.get('request_signature_key'):
|
120 |
|
r += htmltext('<li>%s %s</li>') % (
|
121 |
|
_('Request Signature Key:'),
|
122 |
|
self.wscall.request.get('request_signature_key'))
|
123 |
|
if self.wscall.request.get('qs_data'):
|
124 |
|
r += htmltext('<li>%s<ul>') % _('Query string data:')
|
125 |
|
for k, v in self.wscall.request.get('qs_data').items():
|
126 |
|
r += htmltext('<li>%s %s</li>') % (_('%s:') % k, v)
|
127 |
|
r += htmltext('</ul></li>')
|
128 |
|
r += htmltext('<li>%s %s</li>') % (
|
129 |
|
_('Method:'),
|
130 |
|
'POST' if self.wscall.request.get('method') == 'POST' else 'GET')
|
131 |
|
if self.wscall.request.get('post_data'):
|
132 |
|
r += htmltext('<li>%s<ul>') % _('POST data:')
|
133 |
|
for k, v in self.wscall.request.get('post_data').items():
|
134 |
|
r += htmltext('<li>%s %s</li>') % (_('%s:') % k, v)
|
135 |
|
r += htmltext('</ul></li>')
|
136 |
|
r += htmltext('</ul>')
|
137 |
|
r += htmltext('</div>')
|
138 |
|
|
139 |
|
return r.getvalue()
|
|
94 |
return template.QommonTemplateResponse(
|
|
95 |
templates=['wcs/backoffice/wscall.html'],
|
|
96 |
context={'view': self, 'wscall': self.wscall})
|
140 |
97 |
|
141 |
98 |
def edit(self):
|
142 |
99 |
form = self.wscall_ui.get_form()
|