collective.documentgenerator 4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. collective/documentgenerator/DX_renderer.py +51 -0
  2. collective/documentgenerator/__init__.py +11 -0
  3. collective/documentgenerator/adapters.py +30 -0
  4. collective/documentgenerator/browser/__init__.py +0 -0
  5. collective/documentgenerator/browser/actionspanel.py +19 -0
  6. collective/documentgenerator/browser/check_pod_templates.pt +86 -0
  7. collective/documentgenerator/browser/children_pod_template.pt +27 -0
  8. collective/documentgenerator/browser/configure.zcml +217 -0
  9. collective/documentgenerator/browser/controlpanel.py +165 -0
  10. collective/documentgenerator/browser/generation_view.py +613 -0
  11. collective/documentgenerator/browser/overrides.py +9 -0
  12. collective/documentgenerator/browser/resources/css/documentgenerator.css +133 -0
  13. collective/documentgenerator/browser/static/.gitkeep +0 -0
  14. collective/documentgenerator/browser/static/configurable.svg +1232 -0
  15. collective/documentgenerator/browser/static/csv.svg +521 -0
  16. collective/documentgenerator/browser/static/doc.svg +23 -0
  17. collective/documentgenerator/browser/static/docx.svg +20 -0
  18. collective/documentgenerator/browser/static/download_icon.svg +54 -0
  19. collective/documentgenerator/browser/static/libreoffice-blanck.svg +481 -0
  20. collective/documentgenerator/browser/static/mailinglooptemplate.svg +1207 -0
  21. collective/documentgenerator/browser/static/missing_use.svg +42 -0
  22. collective/documentgenerator/browser/static/nok.svg +38 -0
  23. collective/documentgenerator/browser/static/nok_use.svg +38 -0
  24. collective/documentgenerator/browser/static/nok_used.svg +38 -0
  25. collective/documentgenerator/browser/static/odp.svg +1264 -0
  26. collective/documentgenerator/browser/static/ods.svg +1354 -0
  27. collective/documentgenerator/browser/static/odt.svg +1347 -0
  28. collective/documentgenerator/browser/static/ok.svg +38 -0
  29. collective/documentgenerator/browser/static/ok_use.svg +38 -0
  30. collective/documentgenerator/browser/static/ok_used.svg +38 -0
  31. collective/documentgenerator/browser/static/pdf.svg +557 -0
  32. collective/documentgenerator/browser/static/podtemplate.svg +1197 -0
  33. collective/documentgenerator/browser/static/rtf.svg +521 -0
  34. collective/documentgenerator/browser/static/style.svg +1207 -0
  35. collective/documentgenerator/browser/static/subtemplate.svg +1232 -0
  36. collective/documentgenerator/browser/static/xls.svg +159 -0
  37. collective/documentgenerator/browser/static/xlsx.svg +48 -0
  38. collective/documentgenerator/browser/table.py +326 -0
  39. collective/documentgenerator/browser/templates_listing.pt +29 -0
  40. collective/documentgenerator/browser/views.py +366 -0
  41. collective/documentgenerator/config.py +174 -0
  42. collective/documentgenerator/configure.zcml +51 -0
  43. collective/documentgenerator/content/__init__.py +0 -0
  44. collective/documentgenerator/content/condition.py +66 -0
  45. collective/documentgenerator/content/conditions.zcml +30 -0
  46. collective/documentgenerator/content/configure.zcml +18 -0
  47. collective/documentgenerator/content/document_factory.py +73 -0
  48. collective/documentgenerator/content/file_representation.py +70 -0
  49. collective/documentgenerator/content/file_representation.zcml +29 -0
  50. collective/documentgenerator/content/merge_templates.py +15 -0
  51. collective/documentgenerator/content/merge_templates.zcml +11 -0
  52. collective/documentgenerator/content/pod_template.py +601 -0
  53. collective/documentgenerator/content/style_template.py +54 -0
  54. collective/documentgenerator/content/vocabulary.py +344 -0
  55. collective/documentgenerator/content/vocabulary.zcml +105 -0
  56. collective/documentgenerator/demo/__init__.py +0 -0
  57. collective/documentgenerator/demo/configure.zcml +18 -0
  58. collective/documentgenerator/demo/helper.py +170 -0
  59. collective/documentgenerator/events/__init__.py +0 -0
  60. collective/documentgenerator/events/configure.zcml +44 -0
  61. collective/documentgenerator/events/pod_templates_events.py +66 -0
  62. collective/documentgenerator/events/styles_events.py +151 -0
  63. collective/documentgenerator/helper/__init__.py +7 -0
  64. collective/documentgenerator/helper/base.py +334 -0
  65. collective/documentgenerator/helper/configure.zcml +34 -0
  66. collective/documentgenerator/helper/dexterity.py +178 -0
  67. collective/documentgenerator/interfaces.py +166 -0
  68. collective/documentgenerator/locales/collective.documentgenerator.pot +564 -0
  69. collective/documentgenerator/locales/es/LC_MESSAGES/collective.documentgenerator.po +572 -0
  70. collective/documentgenerator/locales/es/LC_MESSAGES/plone.po +32 -0
  71. collective/documentgenerator/locales/fr/LC_MESSAGES/collective.documentgenerator.po +566 -0
  72. collective/documentgenerator/locales/fr/LC_MESSAGES/plone.po +27 -0
  73. collective/documentgenerator/locales/manual.pot +30 -0
  74. collective/documentgenerator/locales/plone-manual.pot +22 -0
  75. collective/documentgenerator/locales/plone.pot +30 -0
  76. collective/documentgenerator/locales/update.sh +22 -0
  77. collective/documentgenerator/migrations/__init__.py +0 -0
  78. collective/documentgenerator/migrations/migrate_to_11.py +52 -0
  79. collective/documentgenerator/migrations/migrate_to_12.py +32 -0
  80. collective/documentgenerator/migrations/migrate_to_13.py +35 -0
  81. collective/documentgenerator/migrations/migrate_to_3.py +36 -0
  82. collective/documentgenerator/migrations/migrate_to_5.py +30 -0
  83. collective/documentgenerator/migrations/migrate_to_6.py +27 -0
  84. collective/documentgenerator/migrations/migrate_to_7.py +34 -0
  85. collective/documentgenerator/migrations/migrate_to_8.py +36 -0
  86. collective/documentgenerator/migrations/migrate_to_9.py +50 -0
  87. collective/documentgenerator/profiles/base/browserlayer.xml +6 -0
  88. collective/documentgenerator/profiles/base/controlpanel.xml +21 -0
  89. collective/documentgenerator/profiles/base/metadata.xml +8 -0
  90. collective/documentgenerator/profiles/base/registry.xml +48 -0
  91. collective/documentgenerator/profiles/base/types/ConfigurablePODTemplate.xml +69 -0
  92. collective/documentgenerator/profiles/base/types/MailingLoopTemplate.xml +68 -0
  93. collective/documentgenerator/profiles/base/types/PODTemplate.xml +68 -0
  94. collective/documentgenerator/profiles/base/types/StyleTemplate.xml +68 -0
  95. collective/documentgenerator/profiles/base/types/SubTemplate.xml +68 -0
  96. collective/documentgenerator/profiles/base/types.xml +22 -0
  97. collective/documentgenerator/profiles/base/viewlets.xml +10 -0
  98. collective/documentgenerator/profiles/demo/browserlayer.xml +6 -0
  99. collective/documentgenerator/profiles/demo/collectivedocumentgenerator_demo_marker.txt +0 -0
  100. collective/documentgenerator/profiles/demo/import_steps.xml +11 -0
  101. collective/documentgenerator/profiles/demo/metadata.xml +7 -0
  102. collective/documentgenerator/profiles/demo/registry.xml +14 -0
  103. collective/documentgenerator/profiles/demo/templates/mailing.odt +0 -0
  104. collective/documentgenerator/profiles/demo/templates/modele_general.ods +0 -0
  105. collective/documentgenerator/profiles/demo/templates/modele_general.odt +0 -0
  106. collective/documentgenerator/profiles/demo/templates/mod/303/250le_collection.odt +0 -0
  107. collective/documentgenerator/profiles/demo/templates/possibly_mailed_model.odt +0 -0
  108. collective/documentgenerator/profiles/demo/templates/styles.odt +0 -0
  109. collective/documentgenerator/profiles/demo/templates/styles_2.odt +0 -0
  110. collective/documentgenerator/profiles/demo/templates/sub_template.odt +0 -0
  111. collective/documentgenerator/profiles/demo/viewlets.xml +3 -0
  112. collective/documentgenerator/profiles/testing/metadata.xml +7 -0
  113. collective/documentgenerator/profiles/testing/types/member.xml +114 -0
  114. collective/documentgenerator/profiles/testing/types.xml +9 -0
  115. collective/documentgenerator/profiles/uninstall/browserlayer.xml +7 -0
  116. collective/documentgenerator/profiles/uninstall/controlpanel.xml +21 -0
  117. collective/documentgenerator/profiles/uninstall/metadata.xml +4 -0
  118. collective/documentgenerator/profiles/uninstall/registry.xml +14 -0
  119. collective/documentgenerator/profiles/uninstall/types.xml +27 -0
  120. collective/documentgenerator/profiles/uninstall/viewlets.xml +8 -0
  121. collective/documentgenerator/profiles.zcml +209 -0
  122. collective/documentgenerator/renderer.zcml +36 -0
  123. collective/documentgenerator/search_replace/__init__.py +0 -0
  124. collective/documentgenerator/search_replace/configure.zcml +21 -0
  125. collective/documentgenerator/search_replace/pod_template.py +161 -0
  126. collective/documentgenerator/search_replace/search_result_form.pt +76 -0
  127. collective/documentgenerator/search_replace/searchreplace_panel.pt +31 -0
  128. collective/documentgenerator/search_replace/searchreplace_panel.py +274 -0
  129. collective/documentgenerator/setuphandlers.py +297 -0
  130. collective/documentgenerator/testing.py +278 -0
  131. collective/documentgenerator/testing.zcml +17 -0
  132. collective/documentgenerator/tests/__init__.py +0 -0
  133. collective/documentgenerator/tests/failing_template.odt +0 -0
  134. collective/documentgenerator/tests/robot/.gitkeep +0 -0
  135. collective/documentgenerator/tests/template_to_clean.odt +0 -0
  136. collective/documentgenerator/tests/template_without_style_page.odt +0 -0
  137. collective/documentgenerator/tests/test_DX_helper_view.py +398 -0
  138. collective/documentgenerator/tests/test_base_helper_view.py +216 -0
  139. collective/documentgenerator/tests/test_check_podtemplates_view.py +138 -0
  140. collective/documentgenerator/tests/test_config.py +119 -0
  141. collective/documentgenerator/tests/test_configurable_pod_template.py +467 -0
  142. collective/documentgenerator/tests/test_demo_profile.py +121 -0
  143. collective/documentgenerator/tests/test_events.py +187 -0
  144. collective/documentgenerator/tests/test_generation_view.py +680 -0
  145. collective/documentgenerator/tests/test_mailing_loop_template.py +48 -0
  146. collective/documentgenerator/tests/test_pod_template.py +190 -0
  147. collective/documentgenerator/tests/test_robot.py +26 -0
  148. collective/documentgenerator/tests/test_search_replace.py +485 -0
  149. collective/documentgenerator/tests/test_setup.py +77 -0
  150. collective/documentgenerator/tests/test_style_template.py +19 -0
  151. collective/documentgenerator/tests/test_sub_template.py +49 -0
  152. collective/documentgenerator/tests/test_templates_listing_view.py +120 -0
  153. collective/documentgenerator/tests/test_utils.py +205 -0
  154. collective/documentgenerator/tests/test_vocabulary.py +169 -0
  155. collective/documentgenerator/utils.py +245 -0
  156. collective/documentgenerator/viewlets/__init__.py +0 -0
  157. collective/documentgenerator/viewlets/batchactions.py +14 -0
  158. collective/documentgenerator/viewlets/configure.zcml +17 -0
  159. collective/documentgenerator/viewlets/generationlinks.pt +46 -0
  160. collective/documentgenerator/viewlets/generationlinks.py +67 -0
  161. collective.documentgenerator-4.0-py3.12-nspkg.pth +1 -0
  162. collective_documentgenerator-4.0.dist-info/METADATA +1136 -0
  163. collective_documentgenerator-4.0.dist-info/RECORD +167 -0
  164. collective_documentgenerator-4.0.dist-info/WHEEL +5 -0
  165. collective_documentgenerator-4.0.dist-info/entry_points.txt +2 -0
  166. collective_documentgenerator-4.0.dist-info/namespace_packages.txt +1 -0
  167. collective_documentgenerator-4.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,159 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+
4
+ <svg
5
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
6
+ xmlns:cc="http://creativecommons.org/ns#"
7
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8
+ xmlns:svg="http://www.w3.org/2000/svg"
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12
+ width="26.458334mm"
13
+ height="26.10244mm"
14
+ viewBox="0 0 26.458334 26.10244"
15
+ version="1.1"
16
+ id="svg8"
17
+ inkscape:version="0.92.3 (2405546, 2018-03-11)"
18
+ sodipodi:docname="xls.svg">
19
+ <defs
20
+ id="defs2" />
21
+ <sodipodi:namedview
22
+ id="base"
23
+ pagecolor="#ffffff"
24
+ bordercolor="#666666"
25
+ borderopacity="1.0"
26
+ inkscape:pageopacity="0.0"
27
+ inkscape:pageshadow="2"
28
+ inkscape:zoom="1.329766"
29
+ inkscape:cx="80.949992"
30
+ inkscape:cy="126.21522"
31
+ inkscape:document-units="mm"
32
+ inkscape:current-layer="layer3"
33
+ showgrid="false"
34
+ fit-margin-top="0"
35
+ fit-margin-left="0"
36
+ fit-margin-right="0"
37
+ fit-margin-bottom="0"
38
+ inkscape:pagecheckerboard="true"
39
+ inkscape:window-width="865"
40
+ inkscape:window-height="624"
41
+ inkscape:window-x="402"
42
+ inkscape:window-y="228"
43
+ inkscape:window-maximized="0" />
44
+ <metadata
45
+ id="metadata5">
46
+ <rdf:RDF>
47
+ <cc:Work
48
+ rdf:about="">
49
+ <dc:format>image/svg+xml</dc:format>
50
+ <dc:type
51
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
52
+ <dc:title></dc:title>
53
+ </cc:Work>
54
+ </rdf:RDF>
55
+ </metadata>
56
+ <g
57
+ inkscape:label="Layer 1"
58
+ inkscape:groupmode="layer"
59
+ id="layer1"
60
+ transform="translate(-52.047632,-168.11613)" />
61
+ <g
62
+ inkscape:groupmode="layer"
63
+ id="layer3"
64
+ inkscape:label="Layer 2"
65
+ transform="translate(5.2153946,-33.56883)">
66
+ <g
67
+ id="g165"
68
+ transform="matrix(0.44640228,0,0,0.44640228,-5.222998,31.574086)">
69
+ <g
70
+ transform="translate(-49.051656,-130.07881)"
71
+ id="layer1-0"
72
+ inkscape:label="Layer 1" />
73
+ <g
74
+ transform="translate(8.2113705,4.4684896)"
75
+ inkscape:label="Layer 2"
76
+ id="layer3-2">
77
+ <g
78
+ transform="translate(0.285506,0.26273)"
79
+ id="g65">
80
+ <g
81
+ inkscape:label="Layer 1"
82
+ id="layer1-9"
83
+ transform="translate(-117.09011,-41.681779)">
84
+ <path
85
+ style="fill:#ffffff;stroke-width:0.26458332"
86
+ d="m 123.64531,95.458339 -0.0729,-4.16719 -3.24115,-0.37618 -3.24115,-0.37619 v -13.932 -13.932 l 3.24115,-0.37619 3.24115,-0.37619 0.0693,-10.12031 0.0693,-10.12031 h 15.54315 15.54315 l 6.41413,6.41813 6.41413,6.41813 v 22.55374 22.55375 h -21.95372 -21.9537 z"
87
+ id="path21"
88
+ inkscape:connector-curvature="0" />
89
+ <g
90
+ id="g48"
91
+ transform="translate(1.1570735,-64.19314)">
92
+ <path
93
+ style="fill:#83bc9d;stroke-width:0.26458332"
94
+ d="m 139.73587,156.6768 v -2.38125 h 4.76249 4.7625 v 2.38125 2.38125 h -4.7625 -4.76249 z m 11.90624,0 v -2.38125 h 4.7625 4.7625 v 2.38125 2.38125 h -4.7625 -4.7625 z m -11.90624,-7.14375 v -2.38125 h 4.76249 4.7625 v 2.38125 2.38125 h -4.7625 -4.76249 z m 11.90624,0 v -2.38125 h 4.7625 4.7625 v 2.38125 2.38125 h -4.7625 -4.7625 z m -11.90624,-7.14375 v -2.38125 h 4.76249 4.7625 v 2.38125 2.38125 h -4.7625 -4.76249 z m 11.90624,0 v -2.38125 h 4.7625 4.7625 v 2.38125 2.38125 h -4.7625 -4.7625 z m -11.90624,-7.14375 v -2.38125 h 4.76249 4.7625 v 2.38125 2.38125 h -4.7625 -4.76249 z m 11.90624,0 v -2.38125 h 4.7625 4.7625 v 2.38125 2.38125 h -4.7625 -4.7625 z m -11.90624,-7.14375 v -2.38125 h 4.76249 4.7625 v 2.38125 2.38125 h -4.7625 -4.76249 z m 11.90624,0 v -2.38125 h 4.7625 4.7625 v 2.38125 2.38125 h -4.7625 -4.7625 z m -11.90624,-7.14375 v -2.38125 h 4.76249 4.7625 v 2.38125 2.38125 h -4.7625 -4.76249 z m 11.90624,0 c 0,-2.36361 -0.0172,-2.38125 -0.0172,-2.38125 l 5.31781,0.0198 4.233,9.9e-4 -0.009,0.77292 v 1.98437 1.98438 h -4.7625 -4.7625 z"
95
+ id="path54"
96
+ inkscape:connector-curvature="0"
97
+ sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccsccccccccs" />
98
+ <path
99
+ style="fill:#969696;stroke-width:0.26458332"
100
+ d="m 122.24063,155.39983 c -0.0135,-3.58656 0.19155,-4.98625 0.52782,-4.98625 0.33453,0 0.29867,5.80755 0.29867,9.04134 v 3.83646 h 21.43124 21.43125 v -21.96042 -22.07352 h -2.4378 l -2.31648,0.0378 v -0.69755 l 4.60977,-0.0211 -6.06971,-6.08288 -5.95661,-5.95092 v 2.44519 c 0,1.99711 0.0412,2.49315 0.0412,2.49315 0,0 -0.83491,0.39301 -0.83491,2.33329 0,1.94028 0.83047,1.75915 0.83047,1.75915 l 0.0198,3.09463 -0.82164,-0.0725 -0.0307,-2.40681 -1.28155,0.007 c 0,0 -0.0394,-0.0176 -0.0394,-2.38125 0,-2.36361 0.0205,-2.3624 0.0205,-2.3624 l 1.30041,-0.009 0.002,-5.0373 H 138.0161 123.06715 v 9.78958 c 0,8.52546 0.11248,12.96488 -0.2332,12.96488 -0.3459,0 -0.61052,2.19442 -0.59329,-6.6838 l 0.0327,-16.86441 h 15.67854 15.67855 l 6.54645,6.55038 6.54645,6.55038 v 22.68608 22.68607 h -22.225 -22.22499 z m 5.6128,2.13343 -0.0251,-2.4741 2.73864,0.9256 c 1.16417,0.167 3.63167,-0.65172 4.63224,0.1824 l 2.18215,0.0293 -0.0267,2.09757 v 0.76399 h -4.73802 -4.73801 z m -0.0238,-36.57521 v -2.38125 h 4.7625 4.7625 v 2.38125 2.38125 h -4.7625 -4.7625 z m 0,-7.14375 v -2.38125 h 4.7625 4.7625 v 2.38125 2.38125 h -4.7625 -4.7625 z m 11.90625,0 v -2.38125 h 4.76249 4.7625 v 2.38125 2.38125 h -4.7625 -4.76249 z"
101
+ id="path52"
102
+ inkscape:connector-curvature="0"
103
+ sodipodi:nodetypes="ssscccccccccccscscccccscccccssscccccccccsccccccccccccccccccccccccccccccccccccc" />
104
+ <path
105
+ style="fill:#1f7145;stroke-width:0.26458332"
106
+ d="m 153.00273,119.29415 -0.009,-0.6985 8.1816,0.002 v 0.69755 z m -0.0377,-5.47985 c 0,-1.94028 0.0735,-2.38125 0.39688,-2.38125 0.32338,0 0.39687,0.44097 0.39687,2.38125 0,1.94028 -0.0735,2.38125 -0.39687,2.38125 -0.32338,0 -0.39688,-0.44097 -0.39688,-2.38125 z"
107
+ id="path50"
108
+ inkscape:connector-curvature="0"
109
+ sodipodi:nodetypes="cccccsssss" />
110
+ </g>
111
+ </g>
112
+ <g
113
+ id="layer2"
114
+ inkscape:label="Layer 2"
115
+ transform="translate(-117.09011,-41.681779)">
116
+ <rect
117
+ style="fill:#5f5f5f;fill-opacity:1;stroke-width:0.26458332"
118
+ id="rect4568"
119
+ width="0.83690584"
120
+ height="4.7454929"
121
+ x="154.12013"
122
+ y="47.250214" />
123
+ </g>
124
+ </g>
125
+ <g
126
+ transform="translate(-8.1943379,19.29285)"
127
+ id="g92">
128
+ <g
129
+ inkscape:label="Layer 1"
130
+ id="layer1-95"
131
+ transform="translate(-88.065099,-227.11192)">
132
+ <rect
133
+ style="fill:#ffffff;fill-opacity:1;stroke-width:0.26458332"
134
+ id="rect29"
135
+ width="31.750002"
136
+ height="31.75"
137
+ x="88.065102"
138
+ y="227.11192" />
139
+ </g>
140
+ <g
141
+ id="layer2-4"
142
+ inkscape:label="Layer 2"
143
+ transform="translate(-88.065099,-227.11192)">
144
+ <g
145
+ id="g23"
146
+ transform="translate(16.098432,88.332753)">
147
+ <path
148
+ style="fill:#1f7145;stroke-width:0.26458332"
149
+ d="m 71.966667,154.65417 v -15.875 h 15.874999 15.875004 v 15.875 15.875 H 87.841666 71.966667 Z m 29.368753,0 V 141.16042 H 87.841666 74.347917 v 13.49375 13.49375 h 13.493749 13.493754 z m -10.451046,7.9375 -0.76046,-0.79375 h -7.094249 -7.094248 v -0.87397 c 0,-0.76533 0.388225,-1.25742 3.12305,-3.95856 l 3.12305,-3.08458 -3.12305,-3.11491 c -2.714221,-2.70715 -3.12305,-3.22803 -3.12305,-3.97895 v -0.86403 h 4.043178 4.043178 l 1.531931,1.54808 1.531932,1.54809 1.476623,-1.54809 1.476624,-1.54808 h 4.060766 4.060767 l -0.01132,0.85989 c -0.01003,0.76221 -0.383812,1.19056 -3.289968,3.77032 l -3.278653,2.91041 0.557964,0.59532 c 0.517693,0.55234 0.783792,0.59531 3.686844,0.59531 h 3.12888 v 0.82654 c 0,0.6499 -0.258572,1.05414 -1.209967,1.89159 l -1.209967,1.06506 1.606842,1.62125 c 1.298367,1.31001 1.606842,1.78497 1.606842,2.47403 v 0.85278 h -4.051541 -4.05154 z m 3.042709,-0.75303 c 0,-0.28856 -2.972702,-3.42865 -7.263896,-7.67292 -7.042806,-6.9658 -8.32456,-7.99645 -8.359043,-6.72145 -0.01601,0.59195 14.532376,14.86863 15.159918,14.87679 0.27594,0.004 0.463021,-0.19133 0.463021,-0.48242 z"
150
+ id="path25"
151
+ inkscape:connector-curvature="0"
152
+ sodipodi:nodetypes="ccccccccccccccccccccccsscsscccccccccccccscsccssccccssscs" />
153
+ </g>
154
+ </g>
155
+ </g>
156
+ </g>
157
+ </g>
158
+ </g>
159
+ </svg>
@@ -0,0 +1,48 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
4
+ <!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
5
+ <!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
6
+ <!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
7
+ <!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
8
+ <!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
9
+ <!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
10
+ <!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
11
+ <!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
12
+ ]>
13
+ <svg version="1.1" id="Livello_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
14
+ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 2289.75 2130"
15
+ enable-background="new 0 0 2289.75 2130" xml:space="preserve">
16
+ <metadata>
17
+ <sfw xmlns="&ns_sfw;">
18
+ <slices></slices>
19
+ <sliceSourceBounds bottomLeftOrigin="true" height="2130" width="2289.75" x="-1147.5" y="-1041"></sliceSourceBounds>
20
+ </sfw>
21
+ </metadata>
22
+ <path fill="#185C37" d="M1437.75,1011.75L532.5,852v1180.393c0,53.907,43.7,97.607,97.607,97.607l0,0h1562.036
23
+ c53.907,0,97.607-43.7,97.607-97.607l0,0V1597.5L1437.75,1011.75z"/>
24
+ <path fill="#21A366" d="M1437.75,0H630.107C576.2,0,532.5,43.7,532.5,97.607c0,0,0,0,0,0V532.5l905.25,532.5L1917,1224.75
25
+ L2289.75,1065V532.5L1437.75,0z"/>
26
+ <path fill="#107C41" d="M532.5,532.5h905.25V1065H532.5V532.5z"/>
27
+ <path opacity="0.1" enable-background="new " d="M1180.393,426H532.5v1331.25h647.893c53.834-0.175,97.432-43.773,97.607-97.607
28
+ V523.607C1277.825,469.773,1234.227,426.175,1180.393,426z"/>
29
+ <path opacity="0.2" enable-background="new " d="M1127.143,479.25H532.5V1810.5h594.643
30
+ c53.834-0.175,97.432-43.773,97.607-97.607V576.857C1224.575,523.023,1180.977,479.425,1127.143,479.25z"/>
31
+ <path opacity="0.2" enable-background="new " d="M1127.143,479.25H532.5V1704h594.643c53.834-0.175,97.432-43.773,97.607-97.607
32
+ V576.857C1224.575,523.023,1180.977,479.425,1127.143,479.25z"/>
33
+ <path opacity="0.2" enable-background="new " d="M1073.893,479.25H532.5V1704h541.393c53.834-0.175,97.432-43.773,97.607-97.607
34
+ V576.857C1171.325,523.023,1127.727,479.425,1073.893,479.25z"/>
35
+ <linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="203.5132" y1="1729.0183" x2="967.9868" y2="404.9817" gradientTransform="matrix(1 0 0 -1 0 2132)">
36
+ <stop offset="0" style="stop-color:#18884F"/>
37
+ <stop offset="0.5" style="stop-color:#117E43"/>
38
+ <stop offset="1" style="stop-color:#0B6631"/>
39
+ </linearGradient>
40
+ <path fill="url(#SVGID_1_)" d="M97.607,479.25h976.285c53.907,0,97.607,43.7,97.607,97.607v976.285
41
+ c0,53.907-43.7,97.607-97.607,97.607H97.607C43.7,1650.75,0,1607.05,0,1553.143V576.857C0,522.95,43.7,479.25,97.607,479.25z"/>
42
+ <path fill="#FFFFFF" d="M302.3,1382.264l205.332-318.169L319.5,747.683h151.336l102.666,202.35
43
+ c9.479,19.223,15.975,33.494,19.49,42.919h1.331c6.745-15.336,13.845-30.228,21.3-44.677L725.371,747.79h138.929l-192.925,314.548
44
+ L869.2,1382.263H721.378L602.79,1160.158c-5.586-9.45-10.326-19.376-14.164-29.66h-1.757c-3.474,10.075-8.083,19.722-13.739,28.755
45
+ l-122.102,223.011H302.3z"/>
46
+ <path fill="#33C481" d="M2192.143,0H1437.75v532.5h852V97.607C2289.75,43.7,2246.05,0,2192.143,0L2192.143,0z"/>
47
+ <path fill="#107C41" d="M1437.75,1065h852v532.5h-852V1065z"/>
48
+ </svg>
@@ -0,0 +1,326 @@
1
+ # -*- coding: utf-8 -*-
2
+ """Define tables and columns."""
3
+
4
+ from collective.documentgenerator import _
5
+ from html import escape
6
+ from imio.helpers.adapters import NoEscapeLinkColumn
7
+ from plone import api
8
+ from Products.CMFPlone import PloneMessageFactory as PMF
9
+ from Products.CMFPlone.utils import base_hasattr
10
+ from Products.CMFPlone.utils import normalizeString
11
+ from Products.CMFPlone.utils import safe_unicode
12
+ from z3c.table.column import Column
13
+ from z3c.table.column import LinkColumn
14
+ from z3c.table.table import Table
15
+ from zope.cachedescriptors.property import CachedProperty
16
+ from zope.component import getMultiAdapter
17
+ from zope.component import getUtility
18
+ from zope.i18n import translate
19
+ from zope.schema.interfaces import IVocabularyFactory
20
+
21
+ import os
22
+
23
+
24
+ class TemplatesTable(Table):
25
+ """Table that displays templates info."""
26
+
27
+ cssClassEven = u"even"
28
+ cssClassOdd = u"odd"
29
+ cssClasses = {"table": "listing nosort templates-listing icons-on"}
30
+
31
+ # ?table-batchSize=10&table-batchStart=30
32
+ batchSize = 200
33
+ startBatchingAt = 200
34
+ sortOn = None
35
+ results = []
36
+
37
+ def __init__(self, context, request):
38
+ super(TemplatesTable, self).__init__(context, request)
39
+ self.portal = api.portal.getSite()
40
+ self.context_path = self.context.absolute_url_path()
41
+ self.context_path_level = len(self.context_path.split("/"))
42
+ self.paths = {".": "-"}
43
+
44
+ @CachedProperty
45
+ def wtool(self):
46
+ return api.portal.get_tool("portal_workflow")
47
+
48
+ @CachedProperty
49
+ def portal_url(self):
50
+ return api.portal.get().absolute_url()
51
+
52
+ @CachedProperty
53
+ def values(self):
54
+ return self.results
55
+
56
+
57
+ try:
58
+ from collective.eeafaceted.z3ctable.columns import CheckBoxColumn as cbc
59
+
60
+ cbc_base = cbc
61
+ except ImportError:
62
+ cbc_base = Column
63
+
64
+
65
+ class CheckBoxColumn(cbc_base):
66
+ """Checkbox column used for batch actions."""
67
+
68
+ cssClasses = {"td": "select-column"}
69
+ weight = 5
70
+ checked_by_default = False
71
+
72
+ def getValue(self, item):
73
+ return item.UID()
74
+
75
+
76
+ class TitleColumn(NoEscapeLinkColumn):
77
+ """Column that displays title."""
78
+
79
+ header = PMF("Title")
80
+ weight = 10
81
+ cssClasses = {"td": "title-column"}
82
+
83
+ def __init__(self, context, request, table):
84
+ self.icons = context.restrictedTraverse('@@iconresolver')
85
+ super().__init__(context, request, table)
86
+
87
+ def _icon(self, item):
88
+ """See docstring in interfaces.py."""
89
+ item_type_class = "contenttype/" + normalizeString(item.portal_type)
90
+ return self.icons.tag(item_type_class).decode("utf-8")
91
+
92
+ def getLinkCSS(self, item):
93
+ return ' class="pretty_link state-%s"' % (api.content.get_state(obj=item))
94
+
95
+ def getLinkContent(self, item):
96
+ return (
97
+ u'<span class="pretty_link_icons pe-1">%s</span>'
98
+ u'<span class="pretty_link_content">%s</span>'
99
+ % (
100
+ self._icon(item),
101
+ safe_unicode(escape(item.title)),
102
+ )
103
+ )
104
+
105
+
106
+ class PathColumn(LinkColumn):
107
+ """Column that displays relative path."""
108
+
109
+ header = _("Path")
110
+ weight = 20
111
+ cssClasses = {"td": "path-column"}
112
+ linkTarget = "_blank"
113
+
114
+ def getLinkURL(self, item):
115
+ """Setup link url."""
116
+ return item.__parent__.absolute_url()
117
+
118
+ def rel_path_title(self, rel_path):
119
+ parts = rel_path.split("/")
120
+ context = self.table.context
121
+ for i, part in enumerate(parts):
122
+ current_path = "/".join(parts[: i + 1])
123
+ parent_path = "/".join(parts[:i])
124
+ if part == "..":
125
+ current_title = u".."
126
+ context = context.__parent__
127
+ else:
128
+ context = context[part]
129
+ current_title = context.title
130
+ self.table.paths[current_path] = (
131
+ parent_path
132
+ and u"%s/%s" % (self.table.paths[parent_path], current_title)
133
+ or current_title
134
+ )
135
+
136
+ def getLinkContent(self, item):
137
+ path = os.path.dirname(item.absolute_url_path())
138
+ rel_path = os.path.relpath(path, self.table.context_path)
139
+ if rel_path not in self.table.paths:
140
+ self.rel_path_title(rel_path)
141
+ return self.table.paths[rel_path]
142
+
143
+
144
+ class EnabledColumn(Column):
145
+ """Column that displays enabled status."""
146
+
147
+ header = _("Enabled")
148
+ weight = 30
149
+ cssClasses = {"td": "enabled-column"}
150
+
151
+ def renderCell(self, item):
152
+ if not base_hasattr(item, "enabled"):
153
+ return u"-"
154
+ if item.enabled:
155
+ icon = (
156
+ "++resource++collective.documentgenerator/ok.svg",
157
+ translate(_("Enabled"), context=self.request),
158
+ )
159
+ else:
160
+ icon = (
161
+ "++resource++collective.documentgenerator/nok.svg",
162
+ translate(_("Disabled"), context=self.request),
163
+ )
164
+ return u"<img class='svg-icon' title='{0}' src='{1}' />".format(
165
+ safe_unicode(icon[1]).replace("'", "&#39;"),
166
+ u"{0}/{1}".format(self.table.portal_url, icon[0]),
167
+ )
168
+
169
+
170
+ class OriginalColumn(Column):
171
+
172
+ """Column that displays original status."""
173
+
174
+ header = _("Status")
175
+ weight = 40
176
+ cssClasses = {"td": "original-column"}
177
+
178
+ def __init__(self, context, request, table):
179
+ super(OriginalColumn, self).__init__(context, request, table)
180
+ voc_name = "collective.documentgenerator.ExistingPODTemplate"
181
+ vocabulary = getUtility(IVocabularyFactory, voc_name)
182
+ self.templates_voc = vocabulary(context)
183
+
184
+ def renderCell(self, item):
185
+ img = suffix = msg = info = u""
186
+ real_template = item
187
+ if (
188
+ base_hasattr(item, "pod_template_to_use")
189
+ and item.pod_template_to_use is not None
190
+ ):
191
+ real_template = item.get_pod_template_to_use()
192
+ suffix = u"_use"
193
+ if item.pod_template_to_use in self.templates_voc:
194
+ info = translate(
195
+ u", from ${template}",
196
+ context=self.request,
197
+ domain="collective.documentgenerator",
198
+ mapping={
199
+ "template": escape(
200
+ self.templates_voc.getTerm(item.pod_template_to_use).title
201
+ )
202
+ },
203
+ )
204
+ elif base_hasattr(item, "is_reusable") and item.is_reusable:
205
+ suffix, info = u"_used", translate(
206
+ u", is reusable template",
207
+ context=self.request,
208
+ domain="collective.documentgenerator",
209
+ )
210
+ if real_template is None:
211
+ img, msg = u"missing", u"Linked template deleted !"
212
+ elif real_template.has_been_modified():
213
+ img, msg = u"nok", u"Modified"
214
+ else:
215
+ img, msg = u"ok", u"Original"
216
+ icon = (
217
+ "++resource++collective.documentgenerator/{}{}.svg".format(img, suffix),
218
+ u"{}{}".format(
219
+ translate(
220
+ msg, context=self.request, domain="collective.documentgenerator"
221
+ ),
222
+ info,
223
+ ),
224
+ )
225
+ return u"<img class='svg-icon' title='{0}' src='{1}' />".format(
226
+ safe_unicode(icon[1]).replace("'", "&#39;"),
227
+ u"{0}/{1}".format(self.table.portal_url, icon[0]),
228
+ )
229
+
230
+
231
+ class FormatsColumn(Column):
232
+ """Column that displays pod formats."""
233
+
234
+ header = _("Pod formats")
235
+ weight = 50
236
+ cssClasses = {"td": "formats-column"}
237
+
238
+ def renderCell(self, item):
239
+ if not base_hasattr(item, "pod_formats"):
240
+ return ""
241
+ ret = []
242
+ for fmt in item.pod_formats or []:
243
+ ret.append(
244
+ u"<img class='svg-icon' title='{0}' src='{1}' />".format(
245
+ fmt,
246
+ "%s/++resource++collective.documentgenerator/%s.svg"
247
+ % (self.table.portal_url, fmt),
248
+ )
249
+ )
250
+ return "\n".join(ret)
251
+
252
+
253
+ class ReviewStateColumn(Column):
254
+
255
+ """Column that displays review state."""
256
+
257
+ header = PMF("Review state")
258
+ weight = 60
259
+ cssClasses = {"td": "state-column"}
260
+
261
+ def renderCell(self, item):
262
+ state = api.content.get_state(item)
263
+ if state:
264
+ state_title = self.table.wtool.getTitleForStateOnType(
265
+ state, item.portal_type
266
+ )
267
+ return translate(PMF(state_title), context=self.request)
268
+ return ""
269
+
270
+
271
+ class ActionsColumn(Column):
272
+ """
273
+ A column displaying available actions of the listed item.
274
+ Need imio.actionspanel to be used !
275
+ """
276
+
277
+ header = _("Actions")
278
+ weight = 70
279
+ params = {
280
+ "useIcons": True,
281
+ "showHistory": False,
282
+ "showActions": True,
283
+ "showOwnDelete": False,
284
+ "showArrows": True,
285
+ "showTransitions": False,
286
+ "showExtEdit": True,
287
+ "edit_action_class": "dg_edit_action",
288
+ "edit_action_target": "_blank",
289
+ }
290
+ cssClasses = {"td": "actions-column"}
291
+
292
+ def renderCell(self, item):
293
+ view = getMultiAdapter((item, self.request), name="actions_panel")
294
+ return view(**self.params)
295
+
296
+
297
+ class DownloadColumn(NoEscapeLinkColumn):
298
+
299
+ """Column that displays download action."""
300
+
301
+ header = u""
302
+ weight = 80
303
+ cssClasses = {"td": "download-column"}
304
+
305
+ # def renderHeadCell(self):
306
+ # return u"<img title='{0}' src='{1}' />".format(
307
+ # translate('Download', domain='plone', context=self.request),
308
+ # u"{0}/{1}".format(self.table.portal_url, 'download_icon.svg'))
309
+
310
+ def getLinkURL(self, item):
311
+ """Setup link url."""
312
+ return "%s/@@download" % item.absolute_url()
313
+
314
+ def getLinkTitle(self, item):
315
+ """Setup link title."""
316
+ return ' title="%s"' % escape(
317
+ safe_unicode(translate(PMF("Download"), context=self.request))
318
+ )
319
+
320
+ def getLinkContent(self, item):
321
+ down_img = u"<img class='svg-icon' title='{0}' src='{1}' />".format(
322
+ safe_unicode(translate(PMF("Download"), context=self.request)),
323
+ u"%s/++resource++collective.documentgenerator/download_icon.svg"
324
+ % self.table.portal_url,
325
+ )
326
+ return down_img
@@ -0,0 +1,29 @@
1
+ <html xmlns="http://www.w3.org/1999/xhtml"
2
+ xmlns:i18n="http://xml.zope.org/namespaces/i18n"
3
+ xmlns:metal="http://xml.zope.org/namespaces/metal"
4
+ xmlns:tal="http://xml.zope.org/namespaces/tal"
5
+ lang="en"
6
+ metal:use-macro="context/main_template/macros/master"
7
+ xml:lang="en"
8
+ i18n:domain="collective.documentgenerator"
9
+ >
10
+ <body>
11
+
12
+ <metal:main fill-slot="content-core">
13
+ <metal:content-core define-macro="content-core">
14
+
15
+ <tal:block define="
16
+ results view/table/values;
17
+ "
18
+ tal:condition="results"
19
+ >
20
+ <div id="dg-batch"><tal:batch replace="structure view/table/renderBatch" /></div>
21
+ <tal:listing replace="structure view/table/render" />
22
+ <div id="dg-batch"><tal:batch replace="structure view/table/renderBatch" /></div>
23
+ </tal:block>
24
+
25
+ </metal:content-core>
26
+ </metal:main>
27
+
28
+ </body>
29
+ </html>