|
1 | 1 | <script>
|
| 2 | + const staffRoles = [ |
| 3 | + "673682085608816652", // Project Management |
| 4 | + "1027665813525778436", // Software Engineer |
| 5 | + "514546359865442304", // Discord Mod |
| 6 | + "566417964820070421", // Technical Support |
| 7 | + "685969048399249459", // Human Resources |
| 8 | + "994342612532199525", // Community Management |
| 9 | + "811262682408943616" // Localization Manager, |
| 10 | + ], |
| 11 | + supportRoles = [ |
| 12 | + "1032759805732978708", //Contributor |
| 13 | + "502165799172309013", //Donator |
| 14 | + "515874214750715904", //Patron |
| 15 | + "585532751663333383" //Booster |
| 16 | + ], |
| 17 | + presenceDeveloperRole = "606222296016879722", //Presence Developer |
| 18 | + proofreaderRole = "522755339448483840", //Proofreader |
| 19 | + translatorRole = "502148045991968788", //Translator |
| 20 | + roles = [...staffRoles, ...supportRoles]; |
2 | 21 | export default {
|
3 | 22 | name: "Contributors",
|
4 | 23 | auth: false,
|
|
45 | 64 | },
|
46 | 65 | computed: {
|
47 | 66 | sortedUsers() {
|
48 |
| - const staffRoles = [ |
49 |
| - "673682085608816652", // Project Management |
50 |
| - "514546359865442304", // Moderator |
51 |
| - "566417964820070421", // Support |
52 |
| - "994342612532199525", // Community Management |
53 |
| - "811262682408943616", // Localization Manager |
54 |
| - "515874214750715904", //Patron |
55 |
| - "585532751663333383", //Booster |
56 |
| - "502165799172309013" //Donator |
57 |
| - ]; |
58 |
| -
|
59 | 67 | //* Sort by role array index
|
60 | 68 | return this.contributors.sort((a, b) => {
|
61 |
| - if ( |
62 |
| - staffRoles.indexOf(a.user.roleId) > |
63 |
| - staffRoles.indexOf(b.user.roleId) |
64 |
| - ) |
| 69 | + if (roles.indexOf(a.user.roleId) > roles.indexOf(b.user.roleId)) |
65 | 70 | return 1;
|
66 |
| - else if ( |
67 |
| - staffRoles.indexOf(a.user.roleId) < |
68 |
| - staffRoles.indexOf(b.user.roleId) |
69 |
| - ) |
| 71 | + else if (roles.indexOf(a.user.roleId) < roles.indexOf(b.user.roleId)) |
70 | 72 | return -1;
|
71 | 73 | else
|
72 | 74 | return a.user.name
|
|
77 | 79 | },
|
78 | 80 | methods: {
|
79 | 81 | isStaffRole(roleId) {
|
80 |
| - const staffRoles = [ |
81 |
| - "514546359865442304", // Discord Mod |
82 |
| - "566417964820070421", // Technical Support |
83 |
| - "673682085608816652", // Project Management |
84 |
| - "685969048399249459", // Human Resources |
85 |
| - "994342612532199525", // Community Management |
86 |
| - "673682085608816652", // Project Management |
87 |
| - "811262682408943616" // Localization Manager, |
88 |
| - ]; |
89 |
| -
|
90 | 82 | if (staffRoles.indexOf(roleId) !== -1) return true;
|
91 | 83 | else return false;
|
92 | 84 | },
|
93 | 85 | isSupporterRole(roleId) {
|
94 |
| - const supportRoles = [ |
95 |
| - "1032759805732978708", //Contributor |
96 |
| - "502165799172309013", //Donator |
97 |
| - "515874214750715904", //Patron |
98 |
| - "585532751663333383" //Booster |
99 |
| - ]; |
100 |
| -
|
101 | 86 | if (supportRoles.indexOf(roleId) !== -1) return true;
|
102 | 87 | else return false;
|
103 | 88 | },
|
104 | 89 |
|
105 | 90 | isPresenceDeveloperRole(roleId) {
|
106 |
| - const presenceDeveloperRole = "606222296016879722"; //Presence Developer |
107 |
| -
|
108 | 91 | if (presenceDeveloperRole == roleId) return true;
|
109 | 92 | else return false;
|
110 | 93 | },
|
111 | 94 | isProofreaderRole(roleId) {
|
112 |
| - const proofreaderRole = "522755339448483840"; //Proofreader |
113 |
| -
|
114 | 95 | if (proofreaderRole == roleId) return true;
|
115 | 96 | else return false;
|
116 | 97 | },
|
117 | 98 | isTranslatorRole(roleId) {
|
118 |
| - const translatorRole = "502148045991968788"; //Translator |
119 |
| -
|
120 | 99 | if (translatorRole == roleId) return true;
|
121 | 100 | else return false;
|
122 | 101 | },
|
|
149 | 128 | v-for="contributor of sortedUsers"
|
150 | 129 | :key="contributor.user.id + 'staff'"
|
151 | 130 | class="contributor-card"
|
| 131 | + v-if="isStaffRole(contributor.user.roleId)" |
152 | 132 | >
|
153 |
| - <CreditCard |
154 |
| - v-if="isStaffRole(contributor.user.roleId)" |
155 |
| - :user="contributor.user" |
156 |
| - /> |
| 133 | + <CreditCard :user="contributor.user" /> |
157 | 134 | </div>
|
158 | 135 | </div>
|
159 | 136 | </div>
|
|
168 | 145 | v-for="contributor of sortedUsers"
|
169 | 146 | :key="contributor.user.id + 'supporter'"
|
170 | 147 | class="contributor-card"
|
| 148 | + v-if="isSupporterRole(contributor.user.roleId)" |
171 | 149 | >
|
172 |
| - <CreditCard |
173 |
| - v-if="isSupporterRole(contributor.user.roleId)" |
174 |
| - :user="contributor.user" |
175 |
| - /> |
| 150 | + <CreditCard :user="contributor.user" /> |
176 | 151 | </div>
|
177 | 152 | </div>
|
178 | 153 | </div>
|
|
0 commit comments