Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add doormat like footer #161

Merged
merged 6 commits into from
Oct 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ Breaking changes:

New features:

- *add item here*
- Additional footer portlets show in a doormat footer.
[tmassman]

Bug fixes:

Expand Down
1 change: 1 addition & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-browser-sync');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.registerTask('compile', ['less']);
grunt.registerTask('default', ['watch']);
grunt.registerTask('bsync', ["browserSync:html", "watch"]);
grunt.registerTask('plone-bsync', ["browserSync:plone", "watch"]);
Expand Down
11 changes: 8 additions & 3 deletions plonetheme/barceloneta/theme/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,13 @@
</main><!--/row-->
</div><!--/container-->
</div> <!--/outer-wrapper -->
<footer id="portal-footer-wrapper">
<div class="container" id="portal-footer"></div>
</footer>
<footer id="portal-footer-wrapper">
<div class="container" id="portal-footer">
<div class="doormat row"></div>
<div class="copyright row"><div class="col-xs-12"></div></div>
<div class="colophon row"><div class="col-xs-12"></div></div>
<div class="site-actions row"><div class="col-xs-12"></div></div>
</div>
</footer>
</body>
</html>
52 changes: 47 additions & 5 deletions plonetheme/barceloneta/theme/less/barceloneta-compiled.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

66 changes: 62 additions & 4 deletions plonetheme/barceloneta/theme/less/footer.plone.less
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
//*// FOOTER //*//

#portal-footer-wrapper {
padding: 30px 15px;
padding: 30px 0 30px 0;
background-color: @plone-footer-bg;
color: @plone-gray-lighter;
text-align: center;
clear: both;

p {
border-bottom: 1px solid @plone-gray-lighter;
padding-bottom: 28px;
border: none;
margin-bottom: 14px;
padding-bottom: 0;

&:last-child {
margin-bottom: 0;
}
}

abbr, ul {
color: @plone-gray-lighter;
}
Expand Down Expand Up @@ -63,6 +69,48 @@
}
}


#portal-footer {
font-weight: 400;

> .row {
margin-top: 14px;
padding-top: 14px;

&:first-child {
padding-top: 0;
margin-top: 0;
}
}

.colophon,
.copyright,
.site-actions {
text-align: center;
}

.row + .site-actions {
border-top: 1px solid #4d4d4d;
}

.site-actions {
ul {
list-style: none;
margin: 0;
padding: 0;

li {
display: inline-block;
padding: 10px 30px;
}
}
padding-top: 0;
padding-bottom: 0;
margin-bottom: 0;
}
}


#portal-siteactions {
display: inline-block;
text-transform: uppercase;
Expand All @@ -76,3 +124,13 @@
margin-left: 0;
}
}

.doormat {
h2 {
margin-top: 10px;
}

> div {
margin-bottom: 10px;
}
}
76 changes: 75 additions & 1 deletion plonetheme/barceloneta/theme/rules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,81 @@
<replace css:theme="#portal-top" css:content-children="#portal-top" />

<!-- Footer -->
<replace css:theme-children="#portal-footer" css:content-children="#portal-footer-wrapper" />
<xsl:variable name="footer_portlets" select="//footer[@id='portal-footer-wrapper']//div[@class='portletWrapper']/*[not(contains(@id,'portal-colophon')) and not(contains(@id,'portal-footer-signature')) and not(contains(@class,'portletActions'))]"></xsl:variable>
<xsl:variable name="footer_portlets_count" select="count($footer_portlets)"></xsl:variable>


<!-- Replace footer information with Plone version. -->
<replace
css:theme-children="#portal-footer .copyright > div"
css:content-children="#portal-footer-wrapper #portal-footer-signature .portletContent"
/>

<!-- Replace colophon information with Plone version. -->
<replace
css:theme-children="#portal-footer .colophon > div"
css:content-children="#portal-footer-wrapper #portal-colophon .portletContent"
/>

<!-- Replace site-actions with Plone version. -->
<replace
css:theme-children="#portal-footer .site-actions > div"
css:content="#portal-footer-wrapper .actions-site_actions"
/>
<drop css:theme="#portal-footer .site-actions" css:if-not-content="#portal-footer-wrapper .actions-site_actions" />

<!-- Move all other footer portlets into doormat area. -->
<replace css:theme-children="#portal-footer .doormat">
<xsl:variable name="columns">
<xsl:if test="$footer_portlets_count=1">col-md-12</xsl:if>
<xsl:if test="$footer_portlets_count=2">col-md-6</xsl:if>
<xsl:if test="$footer_portlets_count=3">col-md-4</xsl:if>
<xsl:if test="$footer_portlets_count=4">col-md-3</xsl:if>
<xsl:if test="$footer_portlets_count>4">col-md-4</xsl:if>
</xsl:variable>
<xsl:for-each select="$footer_portlets">
<div class="col-xs-12 {$columns}">
<xsl:for-each select=".">
<xsl:choose>
<xsl:when css:test=".portlet">
<xsl:choose>
<xsl:when css:test=".portletHeader:not(.titleless)">
<div class="headline"><h2><xsl:value-of css:select=".portletHeader" /></h2></div>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when css:test=".portletCollection">
<ul>
<xsl:for-each css:select=".portletItem">
<li>
<a><xsl:copy-of select="a/attribute::*" /><xsl:apply-templates select="./a/text()" /></a>
<small><xsl:value-of css:select=".portletItemDetails" /></small>
</li>
</xsl:for-each>
</ul>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates css:select=".portletContent" />
</xsl:otherwise>
</xsl:choose>
<xsl:if css:test=".portletFooter">
<p><xsl:apply-templates select="./node()[@class='portletFooter']/node()" /></p>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="./node()" />
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</div>
</xsl:for-each>
</replace>

<!-- Add additional footer content, like script tags (from site settings). -->
<after
css:theme-children="html body"
content="//footer[@id='portal-footer-wrapper']/*[not(@class='row')]"
/>

<!-- toolbar -->
<replace css:theme="#portal-toolbar" css:content-children="#edit-bar" css:if-not-content=".ajax_load" css:if-content=".userrole-authenticated" />
Expand Down