Format doc list
This commit is contained in:
@@ -58,7 +58,10 @@ class Doc extends PhpObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getList() {
|
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() {
|
private function getDocKeys() {
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ function loadDocs() {
|
|||||||
'get_docs',
|
'get_docs',
|
||||||
(asData) => {
|
(asData) => {
|
||||||
$.each(asData, function(iKey, asDoc){
|
$.each(asData, function(iKey, asDoc){
|
||||||
$('#doc_list').append($('<p>', {})
|
$('#doc_list').append($('<a>', {'class':'item', href:asDoc.filepath, target:'_blank'})
|
||||||
.appendIcon('file-'+asDoc.type)
|
.appendIcon('file-'+asDoc.type)
|
||||||
.append(asDoc.filename));
|
.append(asDoc.filename));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -17,6 +17,20 @@
|
|||||||
height: calc(100% - 41.35px);
|
height: calc(100% - 41.35px);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: auto;
|
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
Reference in New Issue
Block a user