Commit 3adc3f39 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add description column

parent a98fbf8a
......@@ -19,8 +19,11 @@ function FileBrowser(element, changedircallback) {
'myfiles.json.php',
[
self.formatname,
'description',
function (r) { return TD(null, (r.artefacttype != 'folder') ? self.showsize(r.size) : null); },
'mtime',
// @todo this function should be changed for when we
// are using the browser to attach files
self.editdelete
]
);
......@@ -34,7 +37,7 @@ function FileBrowser(element, changedircallback) {
}
this.refresh = function () { self.changedir(self.cwd); };
this.editdelete = function(r) {
var editb = INPUT({'type':'button', 'value':get_string('edit')});
editb.onclick = function () { self.openeditform(r); };
......@@ -91,7 +94,7 @@ function FileBrowser(element, changedircallback) {
sendjsonrequest('updatemetadata.json.php',
{'id':fileinfo.id, 'name':$(formid).name.value,
'description':$(formid).description.value},
function() {cancelform(); self.refresh()});
self.refresh);
};
if (fileinfo['artefacttype'] == 'folder') {
editrows = self.folderformrows(fileinfo);
......@@ -106,7 +109,7 @@ function FileBrowser(element, changedircallback) {
var edittable = TABLE({'align':'center'},TBODY(null,editrows,buttons));
hideElement(rowid);
insertSiblingNodesBefore(rowid, TR({'id':editid},
TD({'colSpan':4},
TD({'colSpan':5},
FORM({'id':formid,'action':''},edittable))));
}
......
......@@ -14,9 +14,10 @@
<div id="foldernav"></div>
<table id="filelist">
<thead><tr>
<th>Name</th>
<th>Size</th>
<th>Time</th>
<th>{str tag=name}</th>
<th>{str tag=description}</th>
<th>{str tag=size}</th>
<th>{str tag=date}</th>
<th></th>
</tr></thead>
<tbody><tr><th></th></tr></tbody>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment