Skip to content

Commit

Permalink
Plone6 / ES6. fixes gh-319
Browse files Browse the repository at this point in the history
  • Loading branch information
frapell authored and jensens committed Feb 17, 2022
1 parent c47cc5c commit 6ea7ea3
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 77 deletions.
2 changes: 2 additions & 0 deletions news/319.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Update the css registration and use the schemaeditor pattern
[frapell]
44 changes: 19 additions & 25 deletions src/collective/easyform/browser/actions_listing.pt
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:tal="http://xml.zope.org/namespaces/tal"
tal:omit-tag=""
i18n:domain="plone.schemaeditor"
>
<div xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
i18n:domain="plone"
class="pat-schemaeditor">

<a class="pat-plone-modal"
id="add-field"
href="@@add-action"
tal:attributes="
href string:${context/absolute_url}/@@add-action;
"
>
<button style="float: right; display: block;"
i18n:translate="add_new_action_hellip"
>Add new action&hellip;</button>
</a>

<metal:form metal:use-macro="context/@@ploneform-macros/form">
<metal:top-slot metal:fill-slot="formtop">
<input tal:replace="structure context/@@authenticator/authenticator" />
<script type="text/javascript"
tal:attributes="
src context/++resource++schemaeditor.js;
"
></script>
<div class="extraActions">
<a class="pat-modal pat-plone-modal"
id="add-field"
href="@@add-action"
tal:attributes="
href string:${context/absolute_url}/@@add-action;
"
>
<button style="float: right; display: block;"
i18n:translate="add_new_action_hellip"
>Add new action&hellip;</button>
</a>

</div>
</metal:top-slot>

<metal:fields-slot metal:fill-slot="fields">
Expand Down Expand Up @@ -129,4 +123,4 @@
</tal:block>
</metal:fields-slot>
</metal:form>
</html>
</div>
50 changes: 20 additions & 30 deletions src/collective/easyform/browser/fields_listing.pt
Original file line number Diff line number Diff line change
@@ -1,35 +1,24 @@
<html xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:tal="http://xml.zope.org/namespaces/tal"
tal:omit-tag=""
i18n:domain="plone.schemaeditor"
>
<div xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
i18n:domain="plone"
class="pat-schemaeditor">

<a id="add-field" class="pat-plone-modal"
href="${context/absolute_url}/@@add-field">
<button style="float: right; display: block;"
i18n:translate="add_new_field_hellip">Add new field&hellip;</button>
</a>

<a id="add-fieldset" class="pat-plone-modal" tal:condition="context/enableFieldsets"
href="${context/absolute_url}/@@add-fieldset">
<button style="float: right; display: block;"
i18n:translate="add_fieldset_hellip">Add new fieldset&hellip;</button>
</a>

<metal:form metal:use-macro="context/@@ploneform-macros/form">
<metal:top-slot metal:fill-slot="formtop">
<input tal:replace="structure context/@@authenticator/authenticator" />
<script type="text/javascript"
tal:attributes="
src context/++resource++schemaeditor.js;
"
></script>
<div class="extraActions text-end">
<a class="pat-modal pat-plone-modal btn btn-secondary"
id="add-field"
href="@@add-field"
tal:attributes="
href string:${context/absolute_url}/@@add-field;
"
>Add new field&hellip;</a>

<a class="pat-modal pat-plone-modal btn btn-secondary"
id="add-fieldset"
href="@@add-fieldset"
tal:condition="context/enableFieldsets|python:True"
tal:attributes="
href string:${context/absolute_url}/@@add-fieldset;
"
>Add new fieldset&hellip;</a>
</div>
</metal:top-slot>

<metal:fields-slot metal:fill-slot="fields">
Expand Down Expand Up @@ -135,4 +124,5 @@
</tal:block>
</metal:fields-slot>
</metal:form>
</html>
</div>

13 changes: 0 additions & 13 deletions src/collective/easyform/browser/model_listing.pt
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,6 @@
>
<body>
<metal:block fill-slot="content">
<script type="text/javascript">
jQuery(function($) {
$(document).on('onLoad', function(e){
initTinyMCE(e.target);
});
});
</script>

<style type="text/css">
.overlay .richTextWidget iframe {
box-shadow: none;
}
</style>
<div id="edit-bar"
tal:define="
context nocall:context/aq_parent;
Expand Down
13 changes: 4 additions & 9 deletions src/collective/easyform/profiles/default/registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,12 @@
</record>

<records interface="Products.CMFPlone.interfaces.IBundleRegistry"
prefix="plone.bundles/easyform"
>
prefix="plone.bundles/easyform">
<value key="enabled">True</value>
<value key="compile">False</value>
<value key="csscompilation">++resource++easyform.css</value>
<value key="depends">plone</value>
<!-- Please keep this in sync with upgrades.update_last_compilation -->
<value key="last_compilation">2021-08-31 00:00:00</value>
<value key="resources">
</value>
<value key="merge_with">default</value>
<value key="depends"></value>
<value key="load_async">False</value>
<value key="load_defer">False</value>
</records>

<!-- <record name="easyforms.csv_delimiter">
Expand Down

0 comments on commit 6ea7ea3

Please sign in to comment.