Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

Commit

Permalink
feat(config): configurable group names
Browse files Browse the repository at this point in the history
  • Loading branch information
vhf committed Oct 28, 2019
1 parent a15e0ac commit 60acab2
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
21 changes: 21 additions & 0 deletions components/admin/AdminConfigForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,27 @@
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-label is-normal">
<label class="label">Name of a Group</label>
</div>
<div class="field-body">
<div class="field">
<p class="control is-expanded">
<input
:disabled="disabled"
class="input"
v-model="editor.text.groupName"
type="text"
placeholder="Group"
required>
</p>
<p class="help">
Popular names for a group of classes include "Container", "Group", "Pouch", "Folder"…
</p>
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-label is-normal">
<label class="label">Homepage columns</label>
Expand Down
2 changes: 1 addition & 1 deletion components/fallback/Structure.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="tile is-parent">
<article class="tile is-child container-box">
<h1 class="title">
{{ _get(obj, 'label') }}: Logistics objects
{{ $store.state.config.editor.text.groupName || 'Group' }}: {{ _get(obj, 'label') }}
</h1>

<div class="tile is-child container-box class-boxes">
Expand Down
19 changes: 13 additions & 6 deletions pages/fallback.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@
:is-class="$termIRI.Class.equals(objectType)" />
</section>

<section
class="container layout-objects-list-item">
<class-proposals
id="proposals"
:iri="iri" />
</section>
<template
v-if="!hasChildContainers(subtree)">
<section
class="container layout-objects-list-item">
<class-proposals
id="proposals"
:iri="iri" />
</section>
</template>
</div>

<!-- layout-object-details -->
Expand Down Expand Up @@ -78,6 +81,7 @@ import rdf from 'rdf-ext'
import { resource } from 'rdf-utils-dataset'
// https://zulip.zazuko.com/#narrow/stream/11-rdfjs/subject/jsonld.20serializer/near/4899
import JsonLdSerializer from 'rdf-serializer-jsonld'
import _get from 'lodash/get'
import Structure from '@/components/fallback/Structure'
import ObjectDetails from '@/components/fallback/ObjectDetails'
Expand Down Expand Up @@ -205,6 +209,9 @@ export default {
}
}
this.dataReady = true
},
hasChildContainers (obj) {
return !!_get(obj, 'children', []).find(x => x.isCreativeWork)
}
},
mounted () {
Expand Down

0 comments on commit 60acab2

Please sign in to comment.