Skip to content

Commit

Permalink
Migrate locator-tool to Vue
Browse files Browse the repository at this point in the history
  • Loading branch information
simon04 committed Feb 4, 2024
1 parent dd503ad commit 3e4e872
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/api/ltDataAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function getUserInfo() {
headers: {
'X-XSRF-TOKEN': xsrfToken() || ''
}
});
}).json();
}

export function editLocation(title: CommonsFile, coordinates: LatLng) {
Expand Down
6 changes: 3 additions & 3 deletions app/components/ltFilesSelector.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- eslint-disable vue/no-v-html -->
<template>
<h2 v-show="!userInfo?.user" class="mt-4">{{ t('Sign in') }}</h2>
<p v-show="!userInfo?.user">
<h2 v-if="!userInfo?.user" class="mt-4">{{ t('Sign in') }}</h2>
<p v-if="!userInfo?.user">
<span>
{{ t('In order to allow locator-tool to modify file description pages, sign in first:') }}
</span>
Expand All @@ -12,7 +12,7 @@
<span>{{ t('Log in') }}</span>
</a>
</p>
<p v-show="userInfo?.user">{{ msgLoggedIn }}</p>
<p v-if="userInfo?.user" class="mt-4">{{ msgLoggedIn }}</p>
<h2>{{ t('Select files to geolocate') }}</h2>
<ul class="nav nav-pills my-3">
<li class="nav-item">
Expand Down
8 changes: 4 additions & 4 deletions app/components/ltUserInfo.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<a v-show="!userInfo?.user" class="btn btn-success ms-2" :href="loginURL()">
<a v-if="!userInfo?.user" class="btn btn-success ms-2" :href="loginURL()">
<svg class="octicon">
<use xlink:href="#sign-in"></use>
</svg>
<span>{{ t('Log in') }}</span>
</a>
<span v-show="userInfo?.user" class="navbar-text ms-2">
<span v-if="userInfo?.user" class="navbar-text ms-2">
{{ msgLoggedIn }}
</span>
<a v-show="userInfo?.user" class="btn btn-secondary ms-2" :href="logoutURL()">
<a v-if="userInfo?.user" class="btn btn-secondary ms-2" :href="logoutURL()">
<svg class="octicon">
<use xlink:href="#sign-out"></use>
</svg>
Expand All @@ -23,6 +23,6 @@ import {t} from './useI18n';
const {data: userInfo} = getUserInfo();
const msgLoggedIn = computed(() =>
t('Logged in as {{$ctrl.user}}').replace('{{$ctrl.user}}', userInfo.value?.user)
t('Logged in as {{$ctrl.user}}').replace('{{$ctrl.user}}', userInfo.value?.user || '')
);
</script>

0 comments on commit 3e4e872

Please sign in to comment.