<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
      xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
      lang="en"
      metal:use-macro="context/main_template/macros/master"
      i18n:domain="ploneintranet">

  <tal:comment condition="nothing">based on prototype/library.html and other library-* variants</tal:comment>

    <metal:content fill-slot="content">
      <div class="container"
           tal:define="groupby string:group-by-${view/groupby}">

        <nav class="canvas-subnav">
	  <a tal:repeat="section view/sections"
             tal:attributes="href section/absolute_url; class section/current"
             tal:content="section/title">HR</a>
        </nav>

        <article class="pat-rich canvas-intro"
                 tal:define="info view/info"
                 tal:condition="info">
          <h1 tal:condition="info/title|nothing"
              tal:attributes="class info/klass|nothing"
              tal:content="info/title">unlinked title</h1>
	  <h1 tal:condition="info/chain|nothing">
	    <nav class="pat-breadcrumbs">
	      <a href="#"
                 tal:repeat="item info/chain"
                 tal:attributes="href item/absolute_url"
                 tal:content="item/title">HR</a>
	    </nav>
	  </h1>
	  <p class="description"
             tal:condition="info/description|nothing"
             tal:content="info/description">
	    Praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum.
	  </p>
        </article>

        <form class="canvas-toolbar pat-autosubmit"
              method="post">
	  <label class="bare pat-select"
                 tal:condition="view/groupby_menu_enabled">
	    <select name="groupby">
	      <option value="section"
                      tal:attributes="selected python:view.selected('groupby')" i18n:translate="">
		Group by section
	      </option>
	      <option value="tag"
                      tal:attributes="selected python:view.selected('tag')" i18n:translate="">
		Group by tag
	      </option>
	    </select>
	</label>

	<div class="icons">
		<!-- Link to external CMS -->
		<a href="@@switch_theme"
                   tal:condition="view/can_add"
                   tal:attributes="href string:${context/absolute_url}/@@switch_theme"
                   class="icon create"
                   title="Create a new page or section"
                   i18n:attributes="title"
                   i18n:translate="">Create a new page or section</a>
	</div>

	<!-- Search is out of scope? -->
	<input type="search" placeholder="Search library items"
               tal:condition="nothing"/>

        </form>

        <div class="lib-groups pat-masonry" data-pat-masonry="column-width: .grid-sizer; gutter: 0; item-selector: .tile;" id="lib-groups">
	  <div class="grid-sizer"></div>

          <tal:children repeat="child view/children">

	    <div class="tile group-by-section"
                 tal:define="itemtype child/type"
                 tal:condition="python: itemtype=='container'"
                 tal:attributes="class string: tile ${groupby}">
	      <div class="content">
	        <h3>
	          <a href="#"
                     tal:attributes="href child/absolute_url"
                     tal:content="child/title">HR</a>
	        </h3>
	        <p class="description"
                   tal:condition="child/description|nothing"
                   tal:content="child/description">
	          At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum.
	        </p>
	        <ul class="menu group-by-section"
                    tal:attributes="class string:menu ${groupby}">
	          <li tal:attributes="class item/follow"
                      tal:repeat="item child/content">
		    <a tal:attributes="class item/icon; href item/absolute_url"
                       tal:content="item/title"
                       href="#">Valenpedicis palemtuem</a>
	          </li>
	        </ul>
	      </div>
            </div>

            <div class="tile group-by-tag"
                 tal:define="itemtype child/type"
                 tal:condition="python: itemtype=='tag'">
              <div class="content">
                <h3><a tal:attributes="href child/absolute_url"
                       tal:content="child/title">main tag</a></h3>
                <ul class="menu group-by-tag">
                  <li class="follow-tag"
                      tal:repeat="subtag child/subtags">
                    <a tal:attributes="href subtag/absolute_url"
                       tal:content="subtag/title">sub tag</a>
                  </li>
                  <li class="follow-page"
                      tal:repeat="page child/content">
                    <a tal:attributes="href page/absolute_url"
                       tal:content="page/title">sub tag</a>
                  </li>
                </ul>
              </div>
            </div>

	    <div class="tile type-page"
                 tal:define="itemtype child/type"
                 tal:condition="python: itemtype=='document'">
	      <a href="#" class="content"
                 tal:attributes="href child/absolute_url">
	        <h3 tal:content="child/title">page title</h3>
                <p class="hero"
                   tal:condition="child/preview">
                  <img tal:attributes="src string:${child/preview}" title="preview image"/>
                </p>
	        <p class="summary" tal:content="child/description">
	          At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum.
	        </p>
                <p class="footer"
                   tal:define="portal_type child/context/portal_type">
                  <em class="read-more"
                      i18n:translate="read-more"
                      tal:condition="python:portal_type != 'File'">Read more...</em>
                  <em class="read-more"
                      i18n:translate="download"
                      tal:condition="python:portal_type == 'File'">Download</em>
                </p>
              </a>
	    </div>

          </tal:children>

        </div>

        <p tal:condition="not:view/enabled">
          Tag views are only supported with Solr.
          Please deploy with Solr.
        </p>

      </div>
    </metal:content>

</html>
