Skip to content

Commit

Permalink
Added a button that toggles the .control-group for subject URI/bnod…
Browse files Browse the repository at this point in the history
…e ID editing
  • Loading branch information
namedgraph committed Oct 25, 2023
1 parent 9a053fb commit 04fe10b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ li button.btn-edit-constructors, li button.btn-add-data, li button.btn-add-ontol
.btn.dropdown-toggle.btn-acl { text-align: right; font-size: 0; color: transparent; background-image: url('../icons/baseline-remove_red_eye-24px.svg'); background-position: center center; background-repeat: no-repeat; width: 64px; }
.btn.dropdown-toggle.btn-read { text-align: right; font-size: 0; color: transparent; background-image: url('../icons/ic_details_black_24px.svg'); background-position: center center; background-repeat: no-repeat; width: 64px; }
.btn.btn-copy-uri { font-size: 0; color: transparent; background-image: url('../icons/content_copy-24px.svg'); background-position: center center; background-repeat: no-repeat; width: 48px; }
.btn.btn-edit-subj { font-size: 0; color: transparent; background-image: url('../icons/expand_more_black_24dp.svg'); background-position: center center; background-repeat: no-repeat; width: 48px; height: 30px; }
.btn.btn-save-as { font-size: 0; color: transparent; background-image: url('../icons/save_black_24dp.svg'); background-position: center center; background-repeat: no-repeat; width: 48px; }
.btn.btn-skolemize { font-size: 0; color: transparent; background-image: url('../icons/link_black_24dp.svg'); background-position: center center; background-repeat: no-repeat; width: 48px; }
.btn.btn-edit { font-size: 0; color: transparent; background-image: url('../icons/ic_create_black_24px.svg'); background-position: center center; background-repeat: no-repeat; width: 48px; padding-left: 0; padding-right: 0; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,22 @@ WHERE
<xsl:sequence select="$request[current-date() lt xs:date('2000-01-01')]"/>
</xsl:template>

<!-- toggles the .control-group for subject URI/bnode ID editing -->
<xsl:template match="button[contains-token(@class, 'btn-edit-subj')]" mode="ixsl:onclick">
<xsl:variable name="subj-control-group" select="ancestor::legend/following-sibling::div[contains-token(@class, 'control-group')]" as="element()"/>

<xsl:for-each select="$subj-control-group">
<xsl:choose>
<xsl:when test="ixsl:style(.)?display = 'none'">
<ixsl:set-style name="display" select="'block'"/>
</xsl:when>
<xsl:otherwise>
<ixsl:set-style name="display" select="'none'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>

<!-- appends new SPIN-constructed instance to the form -->
<xsl:template match="a[contains-token(@class, 'add-constructor')][input[@class = 'forClass']/@value]" mode="ixsl:onclick" priority="1">
<xsl:sequence select="ixsl:call(ixsl:event(), 'preventDefault', [])"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,10 +548,10 @@ exclude-result-prefixes="#all"
<xsl:text> </xsl:text>
</span>
</div>

<hr/>
</div>
<!-- </fieldset> -->

<hr/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="xhtml:Input">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1105,10 +1105,10 @@ extension-element-prefixes="ixsl"
</div>
</xsl:if>

<xsl:if test="exists($type-metadata)">
<!-- show list of types that have constructors (excluding built-in system classes) -->
<xsl:variable name="constructor-classes" select="distinct-values($constructors//srx:binding[@name = 'Type']/srx:uri)[not(starts-with(., '&dh;') or starts-with(., '&ldh;') or starts-with(., '&def;') or starts-with(., '&lapp;') or starts-with(., '&sp;') or starts-with(., '&nfo;'))]" as="xs:anyURI*"/>
<div class="btn-group pull-right">
<div class="btn-group pull-right">
<xsl:if test="exists($type-metadata)">
<!-- show list of types that have constructors (excluding built-in system classes) -->
<xsl:variable name="constructor-classes" select="distinct-values($constructors//srx:binding[@name = 'Type']/srx:uri)[not(starts-with(., '&dh;') or starts-with(., '&ldh;') or starts-with(., '&def;') or starts-with(., '&lapp;') or starts-with(., '&sp;') or starts-with(., '&nfo;'))]" as="xs:anyURI*"/>
<button type="button" class="btn dropdown-toggle btn-edit-actions">
<!-- only admins should see the button as only they have access to the ontologies with constructors in them -->
<xsl:if test="not($acl:mode = '&acl;Control' and exists($constructor-classes))">
Expand Down Expand Up @@ -1138,9 +1138,12 @@ extension-element-prefixes="ixsl"
</li>
</xsl:for-each>
</ul>
</div>
</xsl:if>

</xsl:if>

<!-- button that toggles the .control-group for subject URI/bnode ID editing -->
<button type="button" class="btn btn-edit-subj"></button>
</div>

<!-- "Copy URI" button -->
<button type="button">
<xsl:attribute name="title">
Expand Down

0 comments on commit 04fe10b

Please sign in to comment.