使 DSpace Mirage 2 中的高级过滤器 "Apply" 按钮更加突出

Make advanced filters "Apply" button in DSpace Mirage 2 more prominent

我的用户认为使用 DSpace Mirage 2(XMLUI,DSpace 5.x).他们要求这个按钮更加突出,并尽可能地改进 DSpace 的这一部分 UI。

例如,而不是默认值(与开箱即用的 Mirage 2 相比,自定义了一些颜色/间距): 显示如下内容:

我如何在 Mirage 2 中实现这一点?

这可以通过混合使用 XSL 和 CSS 以及更改 messages.xml 中的按钮标签来实现。

preprocess discovery XSL file 中,添加一个拦截此特定按钮的新模板并添加 Bootstrap btn-primary class:

<!-- make 'apply filters' and 'go' button on discovery screens a primary button -->
<xsl:template match="dri:field[@id='aspect.discovery.SimpleSearch.field.submit_apply_filter']">
    <field>
        <xsl:call-template name="copy-attributes"/>
        <xsl:attribute name="rend">
            <xsl:value-of select="@rend"/>
            <xsl:text> btn-primary</xsl:text>
        </xsl:attribute>
        <xsl:apply-templates/>
    </field>
</xsl:template>

向包含按钮的行添加一些样式,使其右对齐。这可以添加到_style.scss override file的底部:

#aspect_discovery_SimpleSearch_row_filter-controls {
  text-align: right;
}

最后,将 Apply 按钮的英文标签更改为 Search,在 messages file for the Discovery aspect 中确保键 xmlui.Discovery.AbstractSearch.filters.controls.apply-filters 的值(默认值:Apply)是您想要的任何值:

<message key="xmlui.Discovery.AbstractSearch.filters.controls.apply-filters">Search</message>

请注意,在 [dspace-src]/dspace-xmlui[dspace-src]/dspace-xmlui-mirage2 中进行更改需要您对 DSpace 使用 "full build option",您 运行 mvn 在顶层 [dspace-src] 目录。如果您当前使用 "quick build option"(您在 [dspace-src]/dspace 中 运行 mvn),请将这些文件复制到 [dspace-src]/dspace/modules 中的相应位置,然后对副本进行更改。