Format doc list

This commit is contained in:
2019-09-07 21:36:21 +02:00
parent fa999fe1ba
commit e68c3148a2
5 changed files with 21 additions and 4 deletions

View File

@@ -58,7 +58,10 @@ class Doc extends PhpObject {
}
public function getList() {
return $this->oDb->selectRows(array('select'=>array(Db::getId(self::DOC_TABLE), 'type', 'filename'), 'from'=>self::DOC_TABLE, 'constraints'=>$this->getDocKeys()));
$asDocs = $this->oDb->selectRows(array('select'=>array(Db::getId(self::DOC_TABLE), 'type', 'filename'), 'from'=>self::DOC_TABLE, 'constraints'=>$this->getDocKeys()));
foreach($asDocs as &$asDoc) $asDoc['filepath'] = self::getFilePath($asDoc['filename']);
return $asDocs;
}
private function getDocKeys() {

View File

@@ -64,7 +64,7 @@ function loadDocs() {
'get_docs',
(asData) => {
$.each(asData, function(iKey, asDoc){
$('#doc_list').append($('<p>', {})
$('#doc_list').append($('<a>', {'class':'item', href:asDoc.filepath, target:'_blank'})
.appendIcon('file-'+asDoc.type)
.append(asDoc.filename));
});

View File

@@ -17,6 +17,20 @@
height: calc(100% - 41.35px);
width: 100%;
overflow: auto;
a.item {
display: block;
padding: 0.5em 1em;
width: 100%;
i.fal {
margin-right: 0.5em;
}
&:first-child {
padding-top: 1em;
}
}
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long