Skip to content

Commit

Permalink
system-core: add new template to display boolean values
Browse files Browse the repository at this point in the history
  • Loading branch information
SoulRiaper committed Dec 2, 2024
1 parent ba50cd5 commit 3befc7f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ontology/system-core/templates/v-ui_BooleanPropertyTemplate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export const pre = function (individual, template, container, mode, extra) {
const targetProperty = container.getAttribute('target-property');
if (!targetProperty) return;

function drawBoolean() {
const value = individual.hasValue(targetProperty, true);
if (!value) {
template.classList.add('hidden');
} else {
template.classList.remove('hidden');
}
}
drawBoolean();

individual.on(targetProperty, drawBoolean);
};

export const html = `
<span class="glyphicon glyphicon-ok hidden"></span>
`;
12 changes: 12 additions & 0 deletions ontology/system-core/veda-ui.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,18 @@ v-ui:TableOfContentsTemplate
rdfs:label "Template for document contents"@en ;
v-ui:template "v-ui_TableOfContentsTemplate.js"
.
v-ui:PropertyCountTemplate
rdf:type v-ui:ClassTemplate ;
rdfs:label "Шаблон подсчета обьектов свойства"@ru ;
rdfs:label "Template of property object count"@en ;
v-ui:template "v-ui_PropertyCountTemplate.js"
.
v-ui:BooleanPropertyTemplate
rdf:type v-ui:ClassTemplate ;
rdfs:label "Шаблон для булевых свойств"@ru ;
rdfs:label "Template for boolean properties"@en ;
v-ui:template "v-ui_BooleanPropertyTemplate.js"
.
v-ui:PsCommentFile
rdf:type v-ui:DatatypePropertySpecification ;
v-ui:forClass v-s:File ;
Expand Down

0 comments on commit 3befc7f

Please sign in to comment.