kotti/templates/view/master.pt

Summary

Maintainability
Test Coverage
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
      tal:define="page_slots api.slots; dummy api.view_needed; has_location_context api.is_location(context);"
      metal:define-macro="main">

  <head>
    <meta charset="utf-8" />
    <title metal:define-slot="page-title">${api.page_title | api.site_title}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="${context.description | ''}" />
    ${api.render_template('kotti:templates/icons.pt')}

    <more tal:omit-tag="" metal:define-slot="head-more"></more>

    <!-- 'inhead' slots: support third party injection of things that
         go into the head -->
    <tal:slots tal:define="snippets page_slots.inhead"
               tal:condition="snippets"
               tal:repeat="snippet snippets"
               tal:replace="structure snippet" />
    <script tal:condition="has_location_context">
      kotti_context_url = '${request.resource_url(context)}';
    </script>
  </head>

  <body class="${request.user is not None and 'logged-in'}
               view-${request.view_name or 'default'}
               ${api.body_css_class}">

    <nav tal:omit-tag="" metal:define-slot="nav-bar">
      <nav tal:replace="api.render_template('kotti:templates/view/nav.pt')"></nav>
    </nav>
    <editbar tal:omit-tag="" metal:define-slot="editor-bar">
      <div tal:condition="request.user is not None and has_location_context"
           tal:replace="api.render_template('kotti:templates/editor-bar.pt')"></div>
    </editbar>

    <div class="container">
      <div tal:replace="api.render_template('kotti:templates/edit/breadcrumbs.pt')"></div>

      <div class="row"
           tal:define="n_slots_left has_location_context and int(bool(page_slots.left)) * 3 or 0;
                       n_slots_right has_location_context and int(bool(page_slots.right)) * 3 or 0;">
        <div class="col-md-3 left-column"
             tal:condition="page_slots.left"
             tal:content="api.render_template('kotti:templates/render_column_slot.pt', slot=page_slots.left)">
        </div>

        <div tal:define="span 12 - n_slots_left - n_slots_right" class="col-md-${span}">
          <div class="above-content"
               tal:condition="has_location_context and page_slots.abovecontent"
               tal:content="api.render_template('kotti:templates/render_content_slot.pt', slot=page_slots.abovecontent)">
          </div>

          <div tal:replace="api.render_template('kotti:templates/messages.pt')"></div>

          <div class="inner-content">
            <div metal:define-slot="content">
              <h1>${context.title}</h1>
            </div>
          </div>

          <div class="below-content"
               tal:condition="page_slots.belowcontent"
               tal:content="api.render_template('kotti:templates/render_content_slot.pt', slot=page_slots.belowcontent)">
          </div>
        </div>

        <div class="col-md-3 right-column"
             tal:condition="page_slots.right"
             tal:content="api.render_template('kotti:templates/render_column_slot.pt', slot=page_slots.right)">
        </div>
      </div>

      <footer tal:replace="api.render_template('kotti:templates/view/footer.pt')"></footer>

    </div>

    <tal:slots tal:define="snippets page_slots.beforebodyend"
               tal:condition="snippets"
               tal:repeat="snippet snippets"
               tal:replace="structure snippet" />

  </body>
</html>