diff options
author | Joas Schilling <coding@schilljs.com> | 2020-02-17 18:30:07 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-02-17 18:30:07 +0300 |
commit | 179f55f440e212f28e29513e3a439a4a511f5c37 (patch) | |
tree | 25577eaf762f72ebea9b2ed863db0ea26eca35c1 | |
parent | e4b83c11dbda20fbd0319f3e0854fd74a82d1b8e (diff) |
Add "Go to file" link to conversation info
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | css/icons.scss | 6 | ||||
-rw-r--r-- | src/components/RightSidebar/RightSidebar.vue | 26 |
2 files changed, 29 insertions, 3 deletions
diff --git a/css/icons.scss b/css/icons.scss index 7188d604b..3cea3fcce 100644 --- a/css/icons.scss +++ b/css/icons.scss @@ -69,6 +69,12 @@ } } + .forced-themed { + .icon-file { + background-image: url(icon-color-path('text', 'filetypes', $color-black, 1, true)); + } + } + .icon-favorite { /* Show favorite icon in yellow instead of default black. */ @include icon-color('star-dark', 'actions', 'FC0', 1, true); diff --git a/src/components/RightSidebar/RightSidebar.vue b/src/components/RightSidebar/RightSidebar.vue index 431b94b9d..aee526dcc 100644 --- a/src/components/RightSidebar/RightSidebar.vue +++ b/src/components/RightSidebar/RightSidebar.vue @@ -30,8 +30,15 @@ @submit-title="handleSubmitTitle" @dismiss-editing="isRenamingConversation = false" @close="handleClose"> - <template v-if="conversationHasSettings && showModerationMenu" + <template v-if="isFileConversation || (conversationHasSettings && showModerationMenu)" v-slot:secondary-actions> + <ActionLink + v-if="isFileConversation" + icon="icon-file" + class="forced-themed" + :href="linkToFile"> + {{ t('spreed', 'Go to file') }} + </ActionLink> <ActionButton v-if="canModerate" :close-after-click="true" @@ -156,11 +163,12 @@ </template> <script> +import ActionButton from '@nextcloud/vue/dist/Components/ActionButton' import ActionCheckbox from '@nextcloud/vue/dist/Components/ActionCheckbox' import ActionInput from '@nextcloud/vue/dist/Components/ActionInput' +import ActionLink from '@nextcloud/vue/dist/Components/ActionLink' import ActionText from '@nextcloud/vue/dist/Components/ActionText' import AppSidebar from '@nextcloud/vue/dist/Components/AppSidebar' -import ActionButton from '@nextcloud/vue/dist/Components/ActionButton' import AppSidebarTab from '@nextcloud/vue/dist/Components/AppSidebarTab' import ChatView from '../ChatView' import { CollectionList } from 'nextcloud-vue-collections' @@ -179,10 +187,11 @@ import { generateUrl } from '@nextcloud/router' export default { name: 'RightSidebar', components: { + ActionButton, ActionCheckbox, ActionInput, ActionText, - ActionButton, + ActionLink, AppSidebar, AppSidebarTab, ChatView, @@ -331,6 +340,17 @@ export default { return '' } }, + + isFileConversation() { + return this.conversation.objectType === 'file' && this.conversation.objectId + }, + linkToFile() { + if (this.isFileConversation) { + return window.location.protocol + '//' + window.location.host + generateUrl('/f/' + this.conversation.objectId) + } else { + return '' + } + }, }, methods: { |