Skip to content

Commit e71d655

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

File tree

1 file changed

+97
-59
lines changed

1 file changed

+97
-59
lines changed

frontend/src/components/DutyListItem.vue

+97-59
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,95 @@
11
<template>
2-
<div
3-
class="list-group-item align-items-center"
4-
:class="{
5-
'list-group-item-action':
6-
this.$store.getters.hasCharacter && isHovering && (duty.cleared == -1 || duty.cleared == 2),
7-
'cursor-pointer': this.$store.getters.hasCharacter && (duty.cleared == -1 || duty.cleared == 2),
8-
}"
9-
@click="check"
10-
@mouseover="isHovering = true"
11-
@mouseout="isHovering = false"
12-
>
2+
<div class="list-group-item align-items-center" style="padding: 0">
133
<div
144
class="d-flex justify-content-between align-items-center"
155
:class="{
166
'text-secondary': duty.cleared == -1,
177
'text-success': duty.cleared >= 1,
188
}"
199
>
20-
<span
21-
class="duty-list-item"
10+
<div
11+
class="duty-list-item-wrapper d-flex justify-content-between align-items-center"
2212
:class="{
23-
'duty-list-item-blur': duty.blur,
13+
'list-group-item-action':
14+
this.$store.getters.hasCharacter && isHovering && (duty.cleared == -1 || duty.cleared == 2),
15+
'cursor-pointer': this.$store.getters.hasCharacter && (duty.cleared == -1 || duty.cleared == 2),
2416
}"
25-
:title="title"
17+
:style="{
18+
'padding-right': showWikiLink ? 0 : undefined,
19+
}"
20+
@click="check"
21+
@mouseover="isHovering = true"
22+
@mouseout="isHovering = false"
2623
>
27-
<i
28-
class="me-2 fa-fw fal"
29-
:class="{
30-
'fa-question-circle': duty.cleared == -1 && !(duty.cleared == -1 && isHovering),
31-
'fa-badge-check': duty.cleared == 1,
32-
'fa-check-circle': duty.cleared == 2 || (duty.cleared == -1 && isHovering),
33-
'fa-circle': duty.cleared == 0,
34-
}"
35-
></i>
36-
<a
37-
v-if="duty.LodestoneID && !duty.blur"
38-
class="text-reset lodestone-tooltip eorzeadb_link"
39-
:href="getLodestoneURL() + 'playguide/db/duty/' + duty.LodestoneID"
40-
target="_blank"
41-
rel="noopener noreferrer"
42-
:class="{
43-
'blur-maybe': duty.blur && duty.cleared == -1,
44-
'blur-cleared': duty.blur && duty.cleared == 1,
45-
'blur-uncleared': duty.blur && duty.cleared == 0,
46-
'user-select-none': duty.blur,
47-
}"
48-
>
49-
{{ duty["Name" + $i18n.locale.toUpperCase()] || duty["NameEN"] }}
50-
</a>
5124
<span
52-
v-else
25+
class="duty-list-item"
5326
:class="{
54-
'blur-maybe': duty.blur && duty.cleared == -1,
55-
'blur-cleared': duty.blur && duty.cleared == 1,
56-
'blur-uncleared': duty.blur && duty.cleared == 0,
57-
'user-select-none': duty.blur,
58-
'text-bold': duty.Bold,
27+
'duty-list-item-blur': duty.blur,
5928
}"
29+
:title="title"
6030
>
61-
{{ duty["Name" + $i18n.locale.toUpperCase()] || duty["NameEN"] }}
31+
<i
32+
class="me-2 fa-fw fal"
33+
:class="{
34+
'fa-question-circle': duty.cleared == -1 && !(duty.cleared == -1 && isHovering),
35+
'fa-badge-check': duty.cleared == 1,
36+
'fa-check-circle': duty.cleared == 2 || (duty.cleared == -1 && isHovering),
37+
'fa-circle': duty.cleared == 0,
38+
}"
39+
></i>
40+
<a
41+
v-if="duty.LodestoneID && !duty.blur"
42+
class="text-reset lodestone-tooltip eorzeadb_link"
43+
:href="getLodestoneURL() + 'playguide/db/duty/' + duty.LodestoneID"
44+
target="_blank"
45+
rel="noopener noreferrer"
46+
:class="{
47+
'blur-maybe': duty.blur && duty.cleared == -1,
48+
'blur-cleared': duty.blur && duty.cleared == 1,
49+
'blur-uncleared': duty.blur && duty.cleared == 0,
50+
'user-select-none': duty.blur,
51+
}"
52+
>
53+
{{ dutyName }}
54+
</a>
55+
<span
56+
v-else
57+
:class="{
58+
'blur-maybe': duty.blur && duty.cleared == -1,
59+
'blur-cleared': duty.blur && duty.cleared == 1,
60+
'blur-uncleared': duty.blur && duty.cleared == 0,
61+
'user-select-none': duty.blur,
62+
'text-bold': duty.Bold,
63+
}"
64+
>
65+
{{ dutyName }}
66+
</span>
6267
</span>
63-
</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"
68+
<span
69+
v-if="duty.IsMSQ"
70+
class="icon-marker-msq"
71+
data-bs-toggle="tooltip"
72+
data-bs-placement="top"
73+
:title="$t('encounters.msqContent')"
74+
></span>
75+
<span
76+
v-if="duty.Expansion && showPatchNums"
77+
:class="'icon-exp-' + duty.Expansion"
78+
data-bs-toggle="tooltip"
79+
data-bs-placement="top"
80+
:title="$t('encounters.unlockedInExp')"
81+
></span>
82+
</div>
83+
<a
84+
class="duty-wiki-link cursor-pointer text-reset"
85+
v-if="showWikiLink"
86+
:href="duty.WikiUrl"
87+
:title="`${dutyName} Wiki Information Link`"
7488
data-bs-toggle="tooltip"
7589
data-bs-placement="top"
76-
:title="$t('encounters.unlockedInExp')"
77-
></span>
90+
>
91+
<span class="fas fa-link"></span>
92+
</a>
7893
</div>
7994
<div id="rewards" v-if="filters.rewards && !duty.blur && ('Mounts' in duty || 'Minions' in duty)">
8095
<div v-if="'Mounts' in duty">
@@ -153,6 +168,23 @@
153168
text-overflow: " ";
154169
}
155170
171+
.duty-wiki-link,
172+
.duty-list-item-wrapper {
173+
padding: var(--bs-list-group-item-padding-y) var(--bs-list-group-item-padding-x);
174+
}
175+
176+
.duty-list-item-wrapper {
177+
width: 100%;
178+
}
179+
180+
.duty-wiki-link {
181+
text-decoration: none;
182+
}
183+
184+
.duty-wiki-link:hover {
185+
color: #41b883 !important;
186+
}
187+
156188
.night {
157189
.list-group-item-action:focus,
158190
.list-group-item-action:hover {
@@ -206,6 +238,9 @@ export default {
206238
title() {
207239
return this.duty.LodestoneID || this.duty.blur ? "" : this.duty.Name;
208240
},
241+
dutyName() {
242+
return this.duty["Name" + this.$i18n.locale.toUpperCase()] || this.duty["NameEN"];
243+
},
209244
showPatchNums() {
210245
let patchNumsSetting = this.$store.getters.settings.patchNumsOption || 0;
211246
@@ -215,6 +250,9 @@ export default {
215250
patchNumsSetting == 2
216251
);
217252
},
253+
showWikiLink() {
254+
return !this.duty.blur && this.duty.WikiUrl ? true : false;
255+
},
218256
},
219257
methods: {
220258
getLodestoneURL: getLodestoneURL,

0 commit comments

Comments
 (0)