Improvements
Former-commit-id: 75aaab2410d4e93a892f1c68d253ecf2c3def92b [formerly d9f37f49e3b705eb7a632b0f6e44cbabdfd296ac] [formerly 5ac5b5223ad348b589861a50f8ee41228a18d13f [formerly 7809b778bb2d65a3faff5dd5f928c1786f227def]] Former-commit-id: 30bac294d7bf5e875d4fb365321dc1fde16a50df [formerly df3d70ac1c0afcc4c7aed0a8e4ce2d2aa815ee0c] Former-commit-id: f82ccdf36a7d088cbd2a4a3ada53876e823a64e2
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
<search></search>
|
||||
</div>
|
||||
<div>
|
||||
<rename-button></rename-button>
|
||||
<move-button></move-button>
|
||||
<delete-button></delete-button>
|
||||
<rename-button v-show="showRenameButton()"></rename-button>
|
||||
<move-button v-show="showDeleteButton()"></move-button>
|
||||
<delete-button v-show="showDeleteButton()"></delete-button>
|
||||
<switch-button v-show="req.kind !== 'editor'"></switch-button>
|
||||
<download-button></download-button>
|
||||
<upload-button v-show="showUpload()"></upload-button>
|
||||
@@ -47,6 +47,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<rename-prompt v-show="showRename" :class="{ active: showRename }"></rename-prompt>
|
||||
<delete-prompt v-show="showDelete" :class="{ active: showDelete }"></delete-prompt>
|
||||
<info-prompt v-show="showInfo" :class="{ active: showInfo }"></info-prompt>
|
||||
<help v-show="showHelp" :class="{ active: showHelp }"></help>
|
||||
|
||||
@@ -64,7 +66,9 @@ import Listing from './components/Listing'
|
||||
import InfoButton from './components/InfoButton'
|
||||
import InfoPrompt from './components/InfoPrompt'
|
||||
import DeleteButton from './components/DeleteButton'
|
||||
import DeletePrompt from './components/DeletePrompt'
|
||||
import RenameButton from './components/RenameButton'
|
||||
import RenamePrompt from './components/RenamePrompt'
|
||||
import UploadButton from './components/UploadButton'
|
||||
import DownloadButton from './components/DownloadButton'
|
||||
import SwitchButton from './components/SwitchViewButton'
|
||||
@@ -146,7 +150,9 @@ export default {
|
||||
InfoPrompt,
|
||||
Help,
|
||||
DeleteButton,
|
||||
DeletePrompt,
|
||||
RenameButton,
|
||||
RenamePrompt,
|
||||
DownloadButton,
|
||||
UploadButton,
|
||||
SwitchButton,
|
||||
@@ -171,6 +177,28 @@ export default {
|
||||
if (this.req.kind === 'editor') return false
|
||||
return this.user.allowNew
|
||||
},
|
||||
showDeleteButton: function () {
|
||||
if (this.req.kind === 'listing') {
|
||||
if (this.listing.selected.length === 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
return this.user.allowEdit
|
||||
}
|
||||
|
||||
return this.user.allowEdit
|
||||
},
|
||||
showRenameButton: function () {
|
||||
if (this.req.kind === 'listing') {
|
||||
if (this.listing.selected.length === 1) {
|
||||
return this.user.allowEdit
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
return this.user.allowEdit
|
||||
},
|
||||
resetPrompts: resetPrompts
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user