Path in list view #16

This commit is contained in:
simon987 2019-12-28 13:53:31 -05:00
parent 80708ca636
commit 0d06d39281
5 changed files with 62 additions and 9 deletions

View File

@ -1,4 +1,3 @@
#include <src/ctx.h>
#include "src/sist.h" #include "src/sist.h"
#include "src/ctx.h" #include "src/ctx.h"

File diff suppressed because one or more lines are too long

View File

@ -2,6 +2,23 @@
outline: 0; outline: 0;
} }
.path-row {
display: -ms-flexbox;
display: flex;
-ms-flex-align: start;
align-items: flex-start;
}
.tag-container {
margin-left: 0.3rem;
}
.path-line {
color: #BBB;
text-overflow: ellipsis;
overflow: hidden;
}
a { a {
color: #00BCD4; color: #00BCD4;
} }
@ -24,7 +41,11 @@ body {
} }
.sub-document { .sub-document {
background: #37474F; background: #37474F !important;
}
.list-group-item.sub-document {
border-top: 1px solid #646464 !important;
} }
.sub-document .text-muted { .sub-document .text-muted {
@ -112,6 +133,7 @@ body {
} }
.file-title { .file-title {
width: 100%;
font-size: 10pt; font-size: 10pt;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;

View File

@ -2,6 +2,23 @@
outline: 0; outline: 0;
} }
.path-row {
display: -ms-flexbox;
display: flex;
-ms-flex-align: start;
align-items: flex-start;
}
.tag-container {
margin-left: 0.3rem;
}
.path-line {
color: #444;
text-overflow: ellipsis;
overflow: hidden;
}
body { body {
overflow-y: scroll; overflow-y: scroll;
} }
@ -16,7 +33,7 @@ body {
} }
.sub-document { .sub-document {
background: #AB47BC1F; background: #AB47BC1F !important;
} }
.navbar-brand { .navbar-brand {
@ -82,6 +99,7 @@ body {
} }
.file-title { .file-title {
width: 100%;
font-size: 10pt; font-size: 10pt;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;

View File

@ -367,6 +367,10 @@ function createDocLine(hit) {
const line = document.createElement("div"); const line = document.createElement("div");
line.setAttribute("class", "list-group-item flex-column align-items-start"); line.setAttribute("class", "list-group-item flex-column align-items-start");
if (hit["_source"].hasOwnProperty("parent")) {
line.classList.add("sub-document");
isSubDocument = true;
}
const title = makeTitle(hit); const title = makeTitle(hit);
@ -396,8 +400,16 @@ function createDocLine(hit) {
titleDiv.appendChild(contentDiv); titleDiv.appendChild(contentDiv);
} }
let pathLine = document.createElement("div");
pathLine.setAttribute("class", "path-row");
let path = document.createElement("div");
path.setAttribute("class", "path-line");
path.setAttribute("title", hit["_source"]["path"] + "/");
path.appendChild(document.createTextNode(hit["_source"]["path"] + "/"));
let tagContainer = document.createElement("div"); let tagContainer = document.createElement("div");
tagContainer.setAttribute("class", ""); tagContainer.setAttribute("class", "tag-container");
for (let i = 0; i < tags.length; i++) { for (let i = 0; i < tags.length; i++) {
tagContainer.appendChild(tags[i]); tagContainer.appendChild(tags[i]);
@ -409,7 +421,9 @@ function createDocLine(hit) {
sizeTag.setAttribute("class", "text-muted"); sizeTag.setAttribute("class", "text-muted");
tagContainer.appendChild(sizeTag); tagContainer.appendChild(sizeTag);
titleDiv.appendChild(tagContainer); titleDiv.appendChild(pathLine);
pathLine.appendChild(path);
pathLine.appendChild(tagContainer);
return line; return line;
} }