Skip to content
Snippets Groups Projects
Verified Commit 1c7bffb3 authored by Daniel Göbel's avatar Daniel Göbel
Browse files

Fix profile picture when missing gravatar url

parent 5e2e8974
No related branches found
No related tags found
1 merge request!125Resolve "Fix gravatar avatar for non-existing emails"
...@@ -3,6 +3,7 @@ import { useUserStore } from "@/stores/users"; ...@@ -3,6 +3,7 @@ import { useUserStore } from "@/stores/users";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import { watch, ref, computed } from "vue"; import { watch, ref, computed } from "vue";
import { OpenAPI } from "@/client"; import { OpenAPI } from "@/client";
import FontAwesomeIcon from "@/components/FontAwesomeIcon.vue";
const userRepository = useUserStore(); const userRepository = useUserStore();
const route = useRoute(); const route = useRoute();
...@@ -265,12 +266,18 @@ watch( ...@@ -265,12 +266,18 @@ watch(
> >
<strong class="me-2">{{ userRepository.user.display_name }}</strong> <strong class="me-2">{{ userRepository.user.display_name }}</strong>
<img <img
v-if="userRepository.user.gravatar_url"
:src="userRepository.user.gravatar_url + '?d=mp&s=32'" :src="userRepository.user.gravatar_url + '?d=mp&s=32'"
class="rounded-circle" class="rounded-circle"
height="32" height="32"
width="32" width="32"
alt="profile picture" alt="profile picture"
/> />
<font-awesome-icon
v-else
icon="fa-solid fa-circle-user"
class="text-secondary fs-4"
/>
</a> </a>
<ul <ul
class="dropdown-menu text-small shadow" class="dropdown-menu text-small shadow"
......
...@@ -213,12 +213,19 @@ onMounted(() => { ...@@ -213,12 +213,19 @@ onMounted(() => {
<tr v-for="(user, index) in userState.users" :key="user.uid"> <tr v-for="(user, index) in userState.users" :key="user.uid">
<th scope="row"> <th scope="row">
<img <img
v-if="user.gravatar_url"
:src="user.gravatar_url + '?d=mp&s=32'" :src="user.gravatar_url + '?d=mp&s=32'"
class="rounded-circle me-2" class="rounded-circle"
height="32" height="32"
width="32" width="32"
alt="profile picture" alt="profile picture"
/>{{ user.display_name }} />
<font-awesome-icon
v-else
icon="fa-solid fa-circle-user"
class="text-secondary fs-4"
/>
<span class="ms-2">{{ user.display_name }}</span>
</th> </th>
<td>{{ user.uid }}</td> <td>{{ user.uid }}</td>
<td <td
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment