Files
fsfe-website/fsfe.org/search/search.xsl
delliott 1a05dee2f6
All checks were successful
continuous-integration/drone/push Build is passing
build: use lefthook for pre-commit (#5248)
update docs
update nix-shell to auto install
rework custom pre-commit hooks to integrate better
add dockerfile for lefthook and integrate into drone
add some more hooks for formatting and linting some files

Co-authored-by: Darragh Elliott <me@delliott.net>
Reviewed-on: #5248
Co-authored-by: delliott <delliott@fsfe.org>
Co-committed-by: delliott <delliott@fsfe.org>
2025-08-27 15:22:06 +00:00

52 lines
2.1 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="../fsfe.xsl"/>
<!-- Create the search form. Doing this this way to add translations for placeholders and such -->
<xsl:template match="search-form">
<xsl:element name="form">
<xsl:attribute name="class">form-inline</xsl:attribute>
<xsl:attribute name="method">GET</xsl:attribute>
<xsl:attribute name="action"/>
<xsl:element name="div">
<xsl:attribute name="class">form-group</xsl:attribute>
<xsl:element name="input">
<xsl:attribute name="type">text</xsl:attribute>
<xsl:attribute name="class">form-control</xsl:attribute>
<xsl:attribute name="id">search</xsl:attribute>
<xsl:attribute name="name">q</xsl:attribute>
<xsl:attribute name="aria-label">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'search/placeholder'"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="placeholder">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'search/placeholder'"/>
</xsl:call-template>
</xsl:attribute>
</xsl:element>
<!-- /input -->
</xsl:element>
<!-- /div -->
<xsl:element name="button">
<xsl:attribute name="type">submit</xsl:attribute>
<xsl:attribute name="class">btn btn-primary</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'search'"/>
</xsl:call-template>
</xsl:element>
<!-- /button -->
</xsl:element>
<!-- /form -->
</xsl:template>
<!-- Run fsfe-gettext for a given id, can be used directly from the XML file -->
<xsl:template match="translation">
<xsl:variable name="id">
<xsl:value-of select="@id"/>
</xsl:variable>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="$id"/>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>