src/pyams_thesaurus/zmi/templates/terms-tree.pt
changeset 0 47700a43ef3f
child 5 86ddb444d0a9
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_thesaurus/zmi/templates/terms-tree.pt	Tue Apr 14 17:52:05 2015 +0200
@@ -0,0 +1,70 @@
+<div id="extracts">
+	<div tal:replace="structure view.extracts_view.render()"></div>
+</div>
+<div class="ams-widget" i18n:domain="pyams_thesaurus"
+	 data-ams-plugins="pyams_thesaurus"
+	 data-ams-plugin-pyams_thesaurus-src="/--static--/pyams_thesaurus/js/pyams_thesaurus.js"
+	 data-ams-plugin-pyams_thesaurus-css="/--static--/pyams_thesaurus/css/pyams_thesaurus.css">
+	<header>
+		<span class="widget-icon"><i class="fa fa-fw fa-tags"></i></span>
+		<h2>
+			<tal:var i18n:translate="">Thesaurus terms tree</tal:var>
+			&nbsp;
+			<span class="label label-danger" i18n:translate="">
+				<tal:var content="len(view.context.terms)" i18n:name="len" /> terms
+			</span>
+		</h2>
+		<tal:var content="structure provider:pyams.toolbar" />
+	</header>
+	<div class="widget-body">
+		<div class="ams-form pull-right margin-bottom-5">
+			<label class="input bordered">
+				<div class="select2-parent">
+					<input type="hidden" autocomplete="off"
+						class="select2" name="terms-tree-search"
+						data-ams-select2-placeholder="Search term..."
+						data-ams-select2-minimum-input-length="2"
+						data-ams-select2-allow-clear="true"
+						data-ams-select2-multiple="false"
+						data-ams-select2-width="350px"
+						data-ams-select2-query-method="findTerms"
+						data-ams-select2-method-target="/api/thesaurus/json"
+						data-ams-change-handler="PyAMS_thesaurus.search"
+						tal:attributes="data-ams-select2-query-params view.search_query_params"
+						i18n:attributes="data-ams-select2-placeholder" />
+				</div>
+			</label>
+		</div>
+		<div class="clearfix"></div>
+		<div class="tree"
+			 tal:define="extracts view.extracts"
+			 tal:attributes="data-ams-tree-context extension:absolute_url(context)">
+			<ul role="tree">
+				<li tal:repeat="node view.tree" role="treeitem" class="parent_li">
+					<tal:loop repeat="extract reversed(extracts.values())">
+						<div class="pull-right margin-right-2"
+							 tal:define="selected extract.name in node.context.extracts;
+										 klass 'fa-square used' if selected else 'fa-square-o'">
+							<i tal:attributes="data-ams-extract-name extract.name;
+											   class string:fa fa-fw ${klass} extract-checker;
+											   style string:color: #${extract.color};"></i>
+						</div>
+					</tal:loop>
+					<span class="label label-success"
+						  tal:define="term node.context;
+									  url extension:absolute_url(term);"
+						  tal:attributes="data-ams-url string:${url}/properties.html;
+										  class string:label label-success ${node.css_class};"
+						  data-toggle="modal">
+						<i class="fa fa-lg fa-plus-circle"
+						   data-ams-click-handler="PyAMS_thesaurus.tree.expand"
+						   data-ams-stop-propagation="true"
+						   tal:condition="node.has_children"></i>
+						<span class="term" tal:content="node.label">Label</span>
+					</span>
+					<ul class="hidden group"></ul>
+				</li>
+			</ul>
+		</div>
+	</div>
+</div>