debian-mirror-gitlab/app/assets/javascripts/vue_shared/components/markdown/toolbar.vue

127 lines
2.9 KiB
Vue
Raw Normal View History

2017-09-10 17:25:29 +05:30
<script>
2018-12-05 23:21:45 +05:30
import { Link } from '@gitlab-org/gitlab-ui';
2017-09-10 17:25:29 +05:30
export default {
2018-12-05 23:21:45 +05:30
components: {
'gl-link': Link,
},
2017-09-10 17:25:29 +05:30
props: {
2018-03-17 18:26:18 +05:30
markdownDocsPath: {
2017-09-10 17:25:29 +05:30
type: String,
required: true,
},
2018-03-17 18:26:18 +05:30
quickActionsDocsPath: {
type: String,
required: false,
default: '',
},
canAttachFile: {
type: Boolean,
required: false,
default: true,
},
},
computed: {
hasQuickActionsDocsPath() {
return this.quickActionsDocsPath !== '';
},
2017-09-10 17:25:29 +05:30
},
};
</script>
<template>
<div class="comment-toolbar clearfix">
<div class="toolbar-text">
2018-03-17 18:26:18 +05:30
<template v-if="!hasQuickActionsDocsPath && markdownDocsPath">
2018-12-05 23:21:45 +05:30
<gl-link
2018-03-17 18:26:18 +05:30
:href="markdownDocsPath"
target="_blank"
tabindex="-1"
>
Markdown is supported
2018-12-05 23:21:45 +05:30
</gl-link>
2018-03-17 18:26:18 +05:30
</template>
<template v-if="hasQuickActionsDocsPath && markdownDocsPath">
2018-12-05 23:21:45 +05:30
<gl-link
2018-03-17 18:26:18 +05:30
:href="markdownDocsPath"
target="_blank"
tabindex="-1"
>
Markdown
2018-12-05 23:21:45 +05:30
</gl-link>
2018-03-17 18:26:18 +05:30
and
2018-12-05 23:21:45 +05:30
<gl-link
2018-03-17 18:26:18 +05:30
:href="quickActionsDocsPath"
target="_blank"
tabindex="-1"
>
quick actions
2018-12-05 23:21:45 +05:30
</gl-link>
2018-03-17 18:26:18 +05:30
are supported
</template>
2017-09-10 17:25:29 +05:30
</div>
2018-03-17 18:26:18 +05:30
<span
v-if="canAttachFile"
class="uploading-container"
>
<span class="uploading-progress-container hide">
<i
class="fa fa-file-image-o toolbar-button-icon"
aria-hidden="true"
>
</i>
<span class="attaching-file-message"></span>
<span class="uploading-progress">0%</span>
<span class="uploading-spinner">
<i
class="fa fa-spinner fa-spin toolbar-button-icon"
aria-hidden="true"
>
</i>
</span>
</span>
<span class="uploading-error-container hide">
<span class="uploading-error-icon">
<i
class="fa fa-file-image-o toolbar-button-icon"
aria-hidden="true"
>
</i>
</span>
<span class="uploading-error-message"></span>
<button
class="retry-uploading-link"
type="button"
>
Try again
</button>
or
<button
class="attach-new-file markdown-selector"
type="button"
>
attach a new file
</button>
</span>
<button
class="markdown-selector button-attach-file"
tabindex="-1"
type="button"
>
<i
class="fa fa-file-image-o toolbar-button-icon"
aria-hidden="true"
>
</i>
Attach a file
</button>
<button
2018-11-08 19:23:39 +05:30
class="btn btn-default btn-sm hide button-cancel-uploading-files"
2018-03-17 18:26:18 +05:30
type="button"
>
Cancel
</button>
</span>
2017-09-10 17:25:29 +05:30
</div>
</template>