diff --git a/app/components/breadcrumb/index.hbs b/app/components/breadcrumb/index.hbs new file mode 100644 index 0000000000000000000000000000000000000000..3c589c1136da8e8ad30499da43022a4c53d8256c --- /dev/null +++ b/app/components/breadcrumb/index.hbs @@ -0,0 +1,17 @@ +<nav aria-label="breadcrumb" class="m-2"> + <ol class="breadcrumb"> + {{#each this.nodes as |node|}} + <li class="breadcrumb-item"> + {{#if (is_equal @hint "left")}} + <Commander::LinkToLeft + @node={{node}} + @extranode={{@extranode}} /> + {{else}} + <Commander::LinkToRight + @node={{node}} + @extranode={{@node}} /> + {{/if}} + </li> + {{/each}} + </ol> +</nav> \ No newline at end of file diff --git a/app/components/breadcrumb/base.js b/app/components/breadcrumb/index.js similarity index 86% rename from app/components/breadcrumb/base.js rename to app/components/breadcrumb/index.js index 2a5b92cb1a606eaaaef152fbf49b73c90d48f16f..8568edbdac1b963f688954568629dd96f889d3c1 100644 --- a/app/components/breadcrumb/base.js +++ b/app/components/breadcrumb/index.js @@ -1,7 +1,7 @@ import Component from '@glimmer/component'; -export default class BaseBreadcrumbComponent extends Component { +export default class BreadcrumbComponent extends Component { get nodes() { let current, diff --git a/app/components/commander/index.hbs b/app/components/commander/index.hbs index 7d28fda046cbc444ff2696febd801788bab5500b..2ba13e081a15f67f940a77bacc9b29f04468ad7d 100644 --- a/app/components/commander/index.hbs +++ b/app/components/commander/index.hbs @@ -14,5 +14,25 @@ @onClose={{this.closeNewFolderModal}} {{show-when this.show_new_folder_modal}} /> - {{yield}} + <Breadcrumb + @node={{@node}} + @extranode={{@extranode}} + @hint={{@hint}} /> + + {{#each @node.children as |node|}} + {{#let (component node.nodeType) as |NodeType|}} + {{! NodeType is either <Folder /> or <Document />}} + <NodeType @model={{node}}> + {{#if (is_equal @hint "left")}} + <Commander::LinkToLeft + @node={{node}} + @extranode={{@extranode}} /> + {{else}} + <Commander::LinkToRight + @node={{node}} + @extranode={{@node}} /> + {{/if}} + </NodeType> + {{/let}} + {{/each}} </div> diff --git a/app/templates/authenticated/nodes.hbs b/app/templates/authenticated/nodes.hbs index 4f1010bca85e11754d96b18e9c9e5d68dadecb17..87676fc8fc58de264795295822cc03fc026d4df7 100644 --- a/app/templates/authenticated/nodes.hbs +++ b/app/templates/authenticated/nodes.hbs @@ -1,43 +1,17 @@ <div class="panels d-flex"> <Commander + @node={{this.mainnode}} + @extranode={{this.extranode}} @onPanelToggle={{this.onPanelToggle}} - @dualPanelMode={{this.dualpanel_mode}} > - - <Breadcrumb::Left - @node={{@node}} - @extranode={{@extranode}} /> - - {{#each this.mainnode.children as |node|}} - {{#let (component node.nodeType) as |NodeType|}} - {{! NodeType is either <Folder /> or <Document />}} - <NodeType @model={{node}}> - <Commander::LinkToLeft - @node={{node}} - @extranode={{this.extranode}} /> - </NodeType> - {{/let}} - {{/each}} - </Commander> + @dualPanelMode={{this.dualpanel_mode}} + @hint="left" /> {{#if this.dualpanel_mode}} <Commander + @node={{this.extranode}} + @extranode={{this.mainnode}} @onPanelToggle={{this.onPanelToggle}} - @dualPanelMode={{this.dualpanel_mode}} > - - <Breadcrumb::Right - @node={{@node}} - @extranode={{@extranode}} /> - - {{#each this.extranode.children as |node|}} - {{#let (component node.nodeType) as |NodeType|}} - {{! NodeType is either <Folder /> or <Document />}} - <NodeType @model={{node}}> - <Commander::LinkToRight - @node={{node}} - @extranode={{this.mainnode}} /> - </NodeType> - {{/let}} - {{/each}} - </Commander> + @dualPanelMode={{this.dualpanel_mode}} + @hint="right" /> {{/if}} </div>