Skip to content

Commit

Permalink
add file download to sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
ctf0 committed Oct 13, 2017
1 parent fe683b4 commit 2ba5946
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
15 changes: 13 additions & 2 deletions src/resources/assets/js/components/media-bulma.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,19 @@ import Watchers from './mixins/watch'
export default {
name: 'media-manager',
mixins: [Form, FileFiltration, BulkSelect, SelectedFile, Utilities, Watchers],
props: ['filesRoute', 'dirsRoute', 'hideExt'],
mixins: [
Form,
FileFiltration,
BulkSelect,
SelectedFile,
Utilities,
Watchers
],
props: [
'filesRoute',
'dirsRoute',
'hideExt'
],
data() {
return {
is_loading: false,
Expand Down
11 changes: 8 additions & 3 deletions src/resources/views/media-bulma.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<media-manager inline-template
files-route="{{ route('media.files') }}"
dirs-route="{{ route('media.directories') }}"
:hide-ext="{{ config('mediaManager.hide_ext') }}">
:hide-ext="{{ config('mediaManager.hide_ext') ? 'true' : 'false' }}">
<div>

{{-- top toolbar --}}
Expand Down Expand Up @@ -277,9 +277,11 @@ class="button"
<div id="left">
<ul id="files" class="tile">
<li v-for="(file,index) in orderBy(filterBy(allFiles, searchFor, 'name'), showBy, -1)"
@click="setSelected(file)" @dblclick="openFolder(file)">
@click="setSelected(file)"
@dblclick="openFolder(file)">
<div class="file_link" :class="{'bulk-selected': IsInBulkList(file)}"
:data-folder="file.name" :data-index="index">
:data-folder="file.name"
:data-index="index">
<div class="link_icon">
<template v-if="fileTypeIs(file, 'image')">
<div class="img" :style="{ 'background-image': 'url(' + encodeURI(file.path) + ')' }"></div>
Expand Down Expand Up @@ -397,6 +399,9 @@ class="button"
<h4>Public URL: <a :href="selectedFile.path" target="_blank">Click Here</a></h4>
</template>
<h4>Last Modified: <span>@{{ selectedFile.last_modified_formated }}</span></h4>
<template v-if="!selectedFileIs('folder')">
<h4>Download File: <a :href="selectedFile.path" download><span class="icon has-text-link"><i class="fa fa-download fa-lg"></i></span></a></h4>
</template>
</div>
</div>
</template>
Expand Down

0 comments on commit 2ba5946

Please sign in to comment.