Skip to content

Commit 11837a1

Browse files
committed
Added support for "WikiUrl" on duty list items
1 parent 9a2d994 commit 11837a1

File tree

1 file changed

+58
-24
lines changed

1 file changed

+58
-24
lines changed

frontend/src/components/DutyListItem.vue

+58-24
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
<template>
22
<div
3-
class="list-group-item align-items-center"
3+
class="list-group-item align-items-center duty-list-group"
44
:class="{
55
'list-group-item-action':
6-
this.$store.getters.hasCharacter && isHovering && (duty.cleared == -1 || duty.cleared == 2),
6+
this.$store.getters.hasCharacter && isHoveringListItem && (duty.cleared == -1 || duty.cleared == 2),
77
'cursor-pointer': this.$store.getters.hasCharacter && (duty.cleared == -1 || duty.cleared == 2),
88
}"
9-
@click="check"
10-
@mouseover="isHovering = true"
11-
@mouseout="isHovering = false"
129
>
1310
<div
1411
class="d-flex justify-content-between align-items-center"
1512
:class="{
1613
'text-secondary': duty.cleared == -1,
1714
'text-success': duty.cleared >= 1,
1815
}"
16+
@click="check"
17+
@mouseover="isHoveringListItem = true"
18+
@mouseout="isHoveringListItem = false"
1919
>
2020
<span
2121
class="duty-list-item"
@@ -27,9 +27,9 @@
2727
<i
2828
class="me-2 fa-fw fal"
2929
:class="{
30-
'fa-question-circle': duty.cleared == -1 && !(duty.cleared == -1 && isHovering),
30+
'fa-question-circle': duty.cleared == -1 && !(duty.cleared == -1 && isHoveringListItem && !isHoveringWikiLink),
3131
'fa-badge-check': duty.cleared == 1,
32-
'fa-check-circle': duty.cleared == 2 || (duty.cleared == -1 && isHovering),
32+
'fa-check-circle': duty.cleared == 2 || (duty.cleared == -1 && isHoveringListItem && !isHoveringWikiLink),
3333
'fa-circle': duty.cleared == 0,
3434
}"
3535
></i>
@@ -46,7 +46,7 @@
4646
'user-select-none': duty.blur,
4747
}"
4848
>
49-
{{ duty["Name" + $i18n.locale.toUpperCase()] || duty["NameEN"] }}
49+
{{ dutyName }}
5050
</a>
5151
<span
5252
v-else
@@ -58,23 +58,36 @@
5858
'text-bold': duty.Bold,
5959
}"
6060
>
61-
{{ duty["Name" + $i18n.locale.toUpperCase()] || duty["NameEN"] }}
61+
{{ dutyName }}
6262
</span>
6363
</span>
64-
<span
65-
v-if="duty.IsMSQ"
66-
class="icon-marker-msq"
67-
data-bs-toggle="tooltip"
68-
data-bs-placement="top"
69-
:title="$t('encounters.msqContent')"
70-
></span>
71-
<span
72-
v-if="duty.Expansion && showPatchNums"
73-
:class="'icon-exp-' + duty.Expansion"
74-
data-bs-toggle="tooltip"
75-
data-bs-placement="top"
76-
:title="$t('encounters.unlockedInExp')"
77-
></span>
64+
<div class="d-inline-flex align-items-center duty-icons">
65+
<span
66+
v-if="duty.IsMSQ"
67+
class="icon-marker-msq"
68+
data-bs-toggle="tooltip"
69+
data-bs-placement="top"
70+
:title="$t('encounters.msqContent')"
71+
></span>
72+
<span
73+
v-if="duty.Expansion && showPatchNums"
74+
:class="'icon-exp-' + duty.Expansion"
75+
data-bs-toggle="tooltip"
76+
data-bs-placement="top"
77+
:title="$t('encounters.unlockedInExp')"
78+
></span>
79+
<a
80+
v-if="showWikiLink"
81+
:href="duty.WikiUrl"
82+
class="text-success tt duty-wiki-link"
83+
@click.stop=""
84+
@mouseover="isHoveringWikiLink = true"
85+
@mouseout="isHoveringWikiLink = false"
86+
>
87+
<i class="fa-fw fad fa-external-link"></i>
88+
<span class="tt-text">Wiki resource</span>
89+
</a>
90+
</div>
7891
</div>
7992
<div id="rewards" v-if="filters.rewards && !duty.blur && ('Mounts' in duty || 'Minions' in duty)">
8093
<div v-if="'Mounts' in duty">
@@ -143,10 +156,24 @@
143156
text-overflow: unset;
144157
}
145158
159+
.duty-list-group {
160+
padding: 0;
161+
}
162+
146163
.duty-list-item {
147164
overflow: hidden;
148165
white-space: nowrap;
149166
text-overflow: "";
167+
width: 100%;
168+
}
169+
170+
.duty-wiki-link,
171+
.duty-list-item {
172+
padding: var(--bs-list-group-item-padding-y) var(--bs-list-group-item-padding-x);
173+
}
174+
175+
.duty-icons > :not(.duty-wiki-link):last-child {
176+
padding-right: var(--bs-list-group-item-padding-x);
150177
}
151178
152179
.duty-list-item-blur {
@@ -192,7 +219,8 @@ import dbs from "@/utilities/dbs.js";
192219
export default {
193220
data() {
194221
return {
195-
isHovering: false,
222+
isHoveringListItem: false,
223+
isHoveringWikiLink: false,
196224
};
197225
},
198226
props: {
@@ -206,6 +234,9 @@ export default {
206234
title() {
207235
return this.duty.LodestoneID || this.duty.blur ? "" : this.duty.Name;
208236
},
237+
dutyName() {
238+
return this.duty["Name" + this.$i18n.locale.toUpperCase()] || this.duty["NameEN"];
239+
},
209240
showPatchNums() {
210241
let patchNumsSetting = this.$store.getters.settings.patchNumsOption || 0;
211242
@@ -215,6 +246,9 @@ export default {
215246
patchNumsSetting == 2
216247
);
217248
},
249+
showWikiLink() {
250+
return !this.duty.blur && this.duty.WikiUrl ? true : false;
251+
},
218252
},
219253
methods: {
220254
getLodestoneURL: getLodestoneURL,

0 commit comments

Comments
 (0)