mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
Added markdown to tag edit fields/popup (#9867)
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
.col-4(v-for="tag in tags")
|
.col-4(v-for="tag in tags")
|
||||||
.custom-control.custom-checkbox
|
.custom-control.custom-checkbox
|
||||||
input.custom-control-input(type="checkbox", :value="tag.id", v-model="selectedTags", :id="`tag-${tag.id}`")
|
input.custom-control-input(type="checkbox", :value="tag.id", v-model="selectedTags", :id="`tag-${tag.id}`")
|
||||||
label.custom-control-label(:title="tag.name", :for="`tag-${tag.id}`") {{tag.name}}
|
label.custom-control-label(:title="tag.name", :for="`tag-${tag.id}`", v-markdown="tag.name")
|
||||||
.tags-footer
|
.tags-footer
|
||||||
span.clear-tags(@click="clearTags()") {{$t("clearTags")}}
|
span.clear-tags(@click="clearTags()") {{$t("clearTags")}}
|
||||||
span.close-tags(@click="close()") {{$t("close")}}
|
span.close-tags(@click="close()") {{$t("close")}}
|
||||||
@@ -95,8 +95,13 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import markdownDirective from 'client/directives/markdown';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: ['tags', 'value'],
|
props: ['tags', 'value'],
|
||||||
|
directives: {
|
||||||
|
markdown: markdownDirective,
|
||||||
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
selectedTags: [],
|
selectedTags: [],
|
||||||
|
|||||||
@@ -143,7 +143,7 @@
|
|||||||
.tags-none {{$t('none')}}
|
.tags-none {{$t('none')}}
|
||||||
.dropdown-toggle
|
.dropdown-toggle
|
||||||
span.category-select(v-else)
|
span.category-select(v-else)
|
||||||
.category-label(v-for='tagName in truncatedSelectedTags', :title="tagName") {{ tagName }}
|
.category-label(v-for='tagName in truncatedSelectedTags', :title="tagName", v-markdown='tagName')
|
||||||
.tags-more(v-if='remainingSelectedTags.length > 0') +{{ $t('more', { count: remainingSelectedTags.length }) }}
|
.tags-more(v-if='remainingSelectedTags.length > 0') +{{ $t('more', { count: remainingSelectedTags.length }) }}
|
||||||
.dropdown-toggle
|
.dropdown-toggle
|
||||||
tags-popup(v-if="showTagsSelect", :tags="user.tags", v-model="task.tags", @close='closeTagsPopup()')
|
tags-popup(v-if="showTagsSelect", :tags="user.tags", v-model="task.tags", @close='closeTagsPopup()')
|
||||||
@@ -346,7 +346,7 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
label {
|
label {
|
||||||
margin-bottom: 8px;
|
max-height: 30px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -637,6 +637,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import TagsPopup from './tagsPopup';
|
import TagsPopup from './tagsPopup';
|
||||||
import { mapGetters, mapActions, mapState } from 'client/libs/store';
|
import { mapGetters, mapActions, mapState } from 'client/libs/store';
|
||||||
|
import markdownDirective from 'client/directives/markdown';
|
||||||
import toggleSwitch from 'client/components/ui/toggleSwitch';
|
import toggleSwitch from 'client/components/ui/toggleSwitch';
|
||||||
import clone from 'lodash/clone';
|
import clone from 'lodash/clone';
|
||||||
import Datepicker from 'vuejs-datepicker';
|
import Datepicker from 'vuejs-datepicker';
|
||||||
@@ -664,6 +665,9 @@ export default {
|
|||||||
toggleSwitch,
|
toggleSwitch,
|
||||||
draggable,
|
draggable,
|
||||||
},
|
},
|
||||||
|
directives: {
|
||||||
|
markdown: markdownDirective,
|
||||||
|
},
|
||||||
// purpose is either create or edit, task is the task created or edited
|
// purpose is either create or edit, task is the task created or edited
|
||||||
props: ['task', 'purpose', 'challengeId', 'groupId'],
|
props: ['task', 'purpose', 'challengeId', 'groupId'],
|
||||||
data () {
|
data () {
|
||||||
|
|||||||
Reference in New Issue
Block a user