org.homepage_widgets

Classes

RowWidget

ColumnWidget

TextWidget

PanelWidget

LinksWidget

DirectoriesWidget

NewsWidget

CoverWidget

EventsWidget

TilesWidget

HrWidget

SliderWidget

Functions

get_lead(→ str)

Module Contents

org.homepage_widgets.get_lead(text: str, max_chars: int = 180, consider_sentences: bool = True) str[source]
class org.homepage_widgets.RowWidget[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="row">
            <div class="row">
                <xsl:apply-templates select="node()"/>
            </div>
        </xsl:template>
    """
class org.homepage_widgets.ColumnWidget[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="column">
            <div class="small-12 medium-{@span} columns">
                <xsl:apply-templates select="node()"/>
            </div>
        </xsl:template>
    """
class org.homepage_widgets.TextWidget[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="text">
            <p class="homepage-text">
                <xsl:apply-templates select="node()"/>
            </p>
        </xsl:template>
    """
class org.homepage_widgets.PanelWidget[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="panel">
            <div class="side-panel requires-children">
                <xsl:attribute name="data-required-children">
                    <xsl:value-of select="'a:not(.more-link)'"/>
                </xsl:attribute>
                <xsl:attribute name="data-required-count">
                    <xsl:value-of select="'1'"/>
                </xsl:attribute>
                <xsl:attribute name="data-required-unless">
                    <xsl:value-of select="'.is-logged-in'"/>
                </xsl:attribute>

                <xsl:apply-templates select="node()"/>
            </div>
        </xsl:template>
    """
class org.homepage_widgets.LinksWidget[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="links">
            <xsl:if test="@title">
                <h2>
                    <xsl:value-of select="@title" />
                </h2>
            </xsl:if>
            <ul class="panel-links">
                <xsl:for-each select="link">
                <li>
                    <a>
                        <xsl:attribute name="href">
                            <xsl:value-of select="@url" />
                        </xsl:attribute>

                        <xsl:value-of select="node()" />
                    </a>

                    <xsl:if test="@description">
                        <small>
                            <xsl:value-of select="@description" />
                        </small>
                    </xsl:if>
                </li>
                </xsl:for-each>
            </ul>
        </xsl:template>
    """
class org.homepage_widgets.DirectoriesWidget[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="directories">
            <metal:block use-macro="layout.macros['directories-panel']" />
        </xsl:template>
    """
get_variables(layout: onegov.org.layout.DefaultLayout) onegov.core.types.RenderData[source]
class org.homepage_widgets.NewsWidget[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="news">
            <div metal:use-macro="layout.macros.newslist"
                tal:define="heading 'h3'; show_all_news_link True;
                hide_date True"
            />
        </xsl:template>
    """
get_variables(layout: onegov.org.layout.DefaultLayout) onegov.core.types.RenderData[source]
class org.homepage_widgets.CoverWidget[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="homepage-cover">
            <div class="homepage-content page-text">
                <tal:block
                    content="structure layout.org.meta.get('homepage_cover')"
                />
            </div>
        </xsl:template>
    """
class org.homepage_widgets.EventsWidget[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="events">
            <metal:block use-macro="layout.macros['events-panel']" />
        </xsl:template>
    """
get_variables(layout: onegov.org.layout.DefaultLayout) onegov.core.types.RenderData[source]
class org.homepage_widgets.TilesWidget[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="homepage-tiles">
            <xsl:choose>
                <xsl:when test="@show-title">
                    <metal:block use-macro="layout.macros['homepage-tiles']"
                       tal:define="show_title True" />
                </xsl:when>
                <xsl:otherwise>
                    <metal:block use-macro="layout.macros['homepage-tiles']"
                      tal:define="show_title False" />
                </xsl:otherwise>
            </xsl:choose>
        </xsl:template>
    """
get_variables(layout: onegov.org.layout.DefaultLayout) onegov.core.types.RenderData[source]
class Tile[source]

Bases: NamedTuple

page: onegov.org.elements.Link[source]
number: int[source]
get_tiles(layout: onegov.org.layout.DefaultLayout) Iterator[Tile][source]
class org.homepage_widgets.HrWidget[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="line">
            <hr />
        </xsl:template>
    """
class org.homepage_widgets.SliderWidget[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="slider">
            <div metal:use-macro="layout.macros['slider']"
            tal:define="height_m '{@height-m}';
            height_d '{@height-d}'"
            />
        </xsl:template>
    """
get_images_from_sets(layout: onegov.org.layout.DefaultLayout) Iterator[RenderData][source]
get_variables(layout: onegov.org.layout.DefaultLayout) onegov.core.types.RenderData[source]