Show HTML pages in a task view beside the transcript
This commit is contained in:
@@ -21,6 +21,11 @@ extension Store {
|
||||
}
|
||||
|
||||
func openFile(_ taskId: String, _ path: String) {
|
||||
if isPage(path) {
|
||||
route("#/task/\(taskId)")
|
||||
openPage(.file(taskId: taskId, path: path))
|
||||
return
|
||||
}
|
||||
filePlaces[taskId] = path.hasSuffix("/") ? FilePlace(dir: String(path.dropLast())) : FilePlace(dir: parent(path), file: path)
|
||||
route("#/task/\(taskId)/files")
|
||||
}
|
||||
@@ -266,6 +271,8 @@ private struct FilesBody: View {
|
||||
EntryRow(label: e._type == .dir ? "\(e.name)/" : e.name, kind: e._type, ignored: e.ignored, meta: meta, symlink: e.symlink) {
|
||||
if e._type == .dir {
|
||||
model.go(FilePlace(dir: join(l.path, e.name)))
|
||||
} else if e._type == .file && isPage(e.name), let taskId = store.selectedTaskId {
|
||||
store.openPage(.file(taskId: taskId, path: join(l.path, e.name)))
|
||||
} else if e._type == .file {
|
||||
model.go(FilePlace(dir: l.path, file: join(l.path, e.name)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user