Skip to content

Commit

Permalink
#71 hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Jul 2, 2024
1 parent 645f5f0 commit 141a955
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
17 changes: 10 additions & 7 deletions assets/index.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ SOFTWARE.
<xsl:param name="date"/>
<xsl:param name="version"/>
<xsl:param name="columns"/>
<xsl:param name="hidden"/>
<xsl:template name="javascript">
<xsl:param name="url"/>
<script type="text/javascript" src="{$url}">
Expand Down Expand Up @@ -169,14 +170,16 @@ SOFTWARE.
<td>
<xsl:for-each select="$f/*">
<xsl:if test="string-length(substring-before(concat(',', $columns, ','), concat(name(), ','))) = 0">
<xsl:if test="position() &gt; 1">
<xsl:text>, </xsl:text>
<xsl:if test="string-length(substring-before(concat(',', $hidden, ','), concat(name(), ','))) = 0">
<xsl:if test="position() &gt; 1">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:value-of select="name()"/>
<xsl:text>:</xsl:text>
<xsl:call-template name="value">
<xsl:with-param name="v" select="."/>
</xsl:call-template>
</xsl:if>
<xsl:value-of select="name()"/>
<xsl:text>:</xsl:text>
<xsl:call-template name="value">
<xsl:with-param name="v" select="."/>
</xsl:call-template>
</xsl:if>
</xsl:for-each>
</td>
Expand Down
2 changes: 2 additions & 0 deletions bin/judges
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ class App
c.flag([:query], default_value: '(always)')
c.desc 'Comma separated list of columns to show in HTML output (no spaces!)'
c.flag([:columns], default_value: 'when,what')
c.desc 'Comma separated list of hidden columns, not to be rendered (no spaces!)'
c.flag([:hidden], default_value: '_id,_time,_version')
c.desc 'Print even if target file already exists and is older than the factbase'
c.switch([:force], default_value: false)
c.action do |global, options, args|
Expand Down
3 changes: 2 additions & 1 deletion lib/judges/commands/print.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ def to_html(opts, fb)
Nokogiri::XSLT.quote_params(
'name' => 'print',
'date' => Time.now.utc.iso8601,
'columns' => opts['columns'] || 'when,what',
'columns' => opts['columns'] || 'when,what,who',
'hidden' => opts['hidden'] || '_id,_version,_time',
'version' => Judges::VERSION
)
)
Expand Down

0 comments on commit 141a955

Please sign in to comment.