Commit 2bcf3dd6 authored by Ivan Tyagov's avatar Ivan Tyagov
Browse files

Use HTTP caching rather than client side caching using renderjs.

Implement properly portal status message gadget to be a global one and support showing message from URL.
Implement properly DateTimeField.
parent c91af728
......@@ -89,19 +89,18 @@ for field_id in form.get_field_ids():\n
except:\n
field_dict[\'display_width\'] = None\n
\n
# XXX: DateTime not serialize-able (see Base_viewMetaData)?\n
# in what format to transfer to client renderjs.js ? (seconds since epoch?)\n
if field_meta_type in ["DateTimeField"]:\n
if field_value not in MARKER:\n
field_value = field_value.strftime("%Y/%m/%d")\n
field_dict[\'editable\'] = 0 # XXX: we have not implemented it yet at client side\n
field_value = field_value.millis()\n
field_dict[\'format\'] = context.portal_preferences.getPreferredDateOrder(\'ymd\')\n
\n
# listbox\n
if field_meta_type in ["ListBox"]:\n
field_dict[\'listbox\'] = {}\n
field_dict[\'listbox\'][\'lines\'] = original_field.get_value("lines")\n
field_dict[\'listbox\'][\'columns\'] = [x for x in original_field.get_value("columns")]\n
field_dict[\'listbox\'][\'listbox_data_url\'] = "Listbox_asJSON"\n
# disabled as now we pass entire listbox html\n
#field_dict[\'listbox\'][\'lines\'] = original_field.get_value("lines")\n
#field_dict[\'listbox\'][\'columns\'] = [x for x in original_field.get_value("columns")]\n
#field_dict[\'listbox\'][\'listbox_data_url\'] = "Listbox_asJSON"\n
field_dict[\'listbox\'][\'listbox_html\'] = original_field.render()\n
\n
if field_meta_type in LIST_FIELDS:\n
......@@ -116,11 +115,10 @@ for field_id in form.get_field_ids():\n
for formbox_field_id in formbox_form.get_field_ids():\n
formbox_field_id_field = getattr(formbox_form, formbox_field_id)\n
field_value = formbox_field_id_field.get_value("default") # only last wins ?\n
\n
\n
# add field value\n
field_dict[\'value\'] = field_value\n
\n
\n
return dumps(result)\n
</string> </value>
</item>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
......@@ -37,7 +41,9 @@
<value> <unicode encoding="cdata"><![CDATA[
<tal:block tal:define="group_list here/Form_getGroupTitleAndId;\n
form_id here/getId;">\n
form_id here/getId;\n
portal here/getPortalObject;\n
portal_url portal/absolute_url">\n
\n
<tal:block tal:repeat="group group_list">\n
\n
......@@ -58,10 +64,8 @@
<div class="input">\n
\n
<!-- render gadget asynchronously -->\n
<div data-gadget-cacheable="1"\n
tal:attributes="data-gadget string:gadgets/form/${field_type}/gadget?field_name=${field_name}&form_id=${form_id};\n
id string:${form_id}_${field_name};\n
data-gadget-cache-id string:${form_id}_${field_name};"></div>\n
<div tal:attributes="data-gadget string:${portal_url}/gadgets/form/${field_type}/gadget?field_name=${field_name}&form_id=${form_id};\n
id string:${form_id}_${field_name};"></div>\n
\n
</div>\n
</div>\n
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
......@@ -36,12 +40,19 @@
<key> <string>_text</string> </key>
<value> <unicode encoding="cdata"><![CDATA[
<tal:block tal:define="field_name request/field_name | options/field_name">\n
<textarea\n
tal:attributes="name field_name"/>\n
<tal:block tal:define="field_name request/field_name | options/field_name;\n
field_name_stipped python: field_name.replace(\'field_\', \'\');\n
form_id request/form_id | options/form_id;">\n
\n
<textarea tal:attributes="name field_name"/>\n
\n
<input type="image"\n
name="portal_selections/viewSearchRelatedDocumentDialog0:method"\n
value="update..." src="images/exec16.png">\n
\n
<a tal:attributes="href string:Base_jumpToRelatedDocument?field_id=${field_name_stipped}&amp;form_id=${form_id}">\n
<img alt="jump" src="images/jump.png">\n
</a>\n
\n
</tal:block>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment