Skip to content

Commit

Permalink
#22 - Upload from list of files
Browse files Browse the repository at this point in the history
  • Loading branch information
maraf committed Jul 20, 2023
1 parent ae5e7b8 commit ac24025
Showing 1 changed file with 35 additions and 4 deletions.
39 changes: 35 additions & 4 deletions src/views/pages/files.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,27 @@
Attached files
</h1>
</div>
<div>
<controls:pageLink folderUrl="cepage:folder_id.url" class="btn btn-primary text-nowrap">
<login:authorized any="wiki">
<div>
<edit:form submit="upload">
<web:out if:true="edit:saved">
<web:redirectToSelf />
</web:out>
<div style="display: none;">
<fa:upload dirId="cepage:directory_id">
<ui:filebox id="upload-box" name="files" isMulti="true" />
</fa:upload>
<button id="upload-submit" type="submit" name="upload" value="upload"></button>
</div>
<bs:button id="upload-button" color="primary" type="button">
Upload...
</bs:button>
</edit:form>
</div>
</login:authorized>
<div class="ml-2">
<controls:pageLink folderUrl="cepage:folder_id.url" class="btn btn-secondary text-nowrap">
View page
</controls:pageLink>
</div>
Expand All @@ -33,12 +52,24 @@
&#126;/file.php?rid=<web:out text="fa:browserId" />
</ui:columnTemplate>
<ui:columnTemplate>
<a href="~/file.php?rid=<web:out text=" fa:browserId" />" target="_blank">
<a href="~/file.php?rid=<web:out text="fa:browserId" />" target="_blank">
Open...
</a>
</ui:columnTemplate>
</ui:grid>
</fa:browser>
</div>
</ui:first>
</cepage:list>
</cepage:list>

<js:script placement="tail">
$uploadSubmit = $("#upload-submit");
$uploadBox = $("#upload-box");
$uploadBox.change(() => {
$uploadSubmit.click();
});
$("#upload-button").click(e => {
e.preventDefault();
$uploadBox.click();
});
</js:script>

0 comments on commit ac24025

Please sign in to comment.