<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      xmlns:tal="http://xml.zope.org/namespaces/tal"
      lang="en"
      metal:use-macro="context/main_template/macros/master"
      i18n:domain="ploneintranet"
>
  <head>
    <title>#${view/tag}</title>
  </head>
  <body class="view-secure">

    <tal:comment condition="nothing">
      <!-- ploneintranet.prototype/tag-stream.html -->
    </tal:comment>

    <metal:content fill-slot="content">
      <div class="container">

        <article class="pat-rich canvas-intro">
          <h1>
            <em class="tag">#${view/tag}</em>
          </h1>
          <form class="pat-inject"
                action="${view/url}#follow-function"
                method="post"
          >
            <fieldset id="follow-function">
              <button class="pat-button icon-eye"
                      title="Click to follow this tag."
                      tal:condition="not:view/following"
              ><strong>Follow</strong>
                this tag</button>
              <button class="pat-button icon-eye active"
                      title="You are following #${view/tag}. Click to unfollow"
                      tal:condition="view/following"
              >Following</button>
            </fieldset>
          </form>
        </article>

        <div class="activity-stream"
             id="activity-stream"
             tal:condition="view/show_stream"
        >
          <div class="activities"
               id="posts-batch"
          >
            <div class="stream-container col-">
              <div id="stream-items">
                <tal:loop tal:repeat="post_view view/post_views"
                          tal:content="structure post_view"
                />

                <a class="pat-inject infinite-scrolling-trigger"
                   href="${view/url}?last_seen=${view/last_seen}"
                   data-pat-inject="trigger: autoload-visible; source: #posts-batch; target: self::element"
                   tal:condition="not:view/stop_asking"
                >
                  <tal:trans i18n:translate="info_loading_more_posts">Loading more posts &hellip;</tal:trans></a>
              </div>
            </div>
          </div>
        </div>

      </div>
    </metal:content>
  </body>
</html>
