register/login: show only remotesources with register/login enabled

This commit is contained in:
Simone Gotti 2019-07-05 13:49:16 +02:00
parent 43e860d3c5
commit 7c80b875f8
2 changed files with 30 additions and 26 deletions

View File

@ -13,19 +13,21 @@
v-for="rs in remotesources"
v-bind:key="rs.id"
>
<LoginForm
action="Login"
:name="rs.name"
v-if="rs.auth_type == 'password'"
v-on:login="doLogin($event.username, $event.password, rs.name)"
/>
<div v-else class="w-full max-w-xs">
<div class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4">
<div class="flex justify-center">
<button
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline"
@click="doLogin(null, null, rs.name)"
>Login with {{rs.name}}</button>
<div v-if="rs.login_enabled">
<LoginForm
action="Login"
:name="rs.name"
v-if="rs.auth_type == 'password'"
v-on:login="doLogin($event.username, $event.password, rs.name)"
/>
<div v-else class="w-full max-w-xs">
<div class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4">
<div class="flex justify-center">
<button
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline"
@click="doLogin(null, null, rs.name)"
>Login with {{rs.name}}</button>
</div>
</div>
</div>
</div>

View File

@ -22,19 +22,21 @@
v-for="rs in remotesources"
v-bind:key="rs.id"
>
<LoginForm
action="Register"
:name="rs.name"
v-if="rs.auth_type == 'password'"
v-on:login="doAuthorize(rs.name, $event.username, $event.password)"
/>
<div v-else class="w-full max-w-xs">
<div class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4">
<div class="flex justify-center">
<button
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline"
@click="doAuthorize(rs.name)"
>Register with {{rs.name}}</button>
<div v-if="rs.registration_enabled">
<LoginForm
action="Register"
:name="rs.name"
v-if="rs.auth_type == 'password'"
v-on:login="doAuthorize(rs.name, $event.username, $event.password)"
/>
<div v-else class="w-full max-w-xs">
<div class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4">
<div class="flex justify-center">
<button
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline"
@click="doAuthorize(rs.name)"
>Register with {{rs.name}}</button>
</div>
</div>
</div>
</div>