Merge remote-tracking branch 'origin/developer' into developer

This commit is contained in:
Senta Mandutz 2019-04-16 21:24:10 +02:00
commit c7a835ad1c
3 changed files with 43 additions and 17 deletions

View File

@ -86,13 +86,11 @@
<div class="om-header-container"> <div class="om-header-container">
<div class="om-header"> <div class="om-header">
<a class="logo-img" href="index.html"><img src="img/app_icon.png" width=45px height=45px></a> <a class="logo-img" href="index.html"><img src="img/app_icon.png" width=45px height=45px></a>
<button v-on:click="showLoginModal=true">Login</button>
<form class="om-searchbar"> <form class="om-searchbar">
<input type="search" placeholder="Search..."> <input type="search" placeholder="Search...">
</form> </form>
</div> </div>
</div> </div>
<login-panel v-if="showLoginModal" @clicked="onClickChild" ></login-panel>
<div class="om-content"> <div class="om-content">
<div id=xxx></div> <div id=xxx></div>
@ -125,12 +123,8 @@
router, router,
el: '#api', el: '#api',
data: { data: {
showLoginModal: false,
}, },
methods: { methods: {
onClickChild (value) {
this.showLoginModal= value;
},
} }
}); });

View File

@ -8,14 +8,18 @@ Vue.component('login-panel', {
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form> <form>
User (Ohmportal):<br> <div class="form-group">
<input type=text length=20 ref=userField v-model=user><br> <label class="bmd-label-floating"> User (Ohmportal)</label>
Password:<br> <input type="text" class="form-control" length=20 ref=userField v-model=user>
<input type=password length=20 v-model=pwd><br> </div>
<div class="form-group">
<label class="bmd-label-floating">Password</label>
<input type=password class="form-control" length=20 v-model=pwd>
</div>
</form> </form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-primary">Login</button> <button type="button" class="btn btn-primary" data-dismiss="modal" v-on:click="closeLogin(this.Event)">Login</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal" v-on:click="closeLogin(this.Event)">Close</button> <button type="button" class="btn btn-secondary" data-dismiss="modal" v-on:click="closeLogin(this.Event)">Close</button>
</div> </div>
</div> </div>
@ -28,6 +32,10 @@ Vue.component('login-panel', {
}; };
}, },
methods: { methods: {
logIn(event){
this.$emit('clicked', true)
},
closeLogin (event) { closeLogin (event) {
this.$emit('clicked', false) this.$emit('clicked', false)
} }

View File

@ -1,17 +1,41 @@
const ProfilRouter = { const ProfilRouter = {
template: ` template: `
<div> <div>
<ProfilCard <div v-if="isAuthentified">
v-for="(profil, index) in profilcard" <ProfilCard
:key="profil.id" v-for="(profil, index) in profilcard"
:profil="profil" :key="profil.id"
></ProfilCard> :profil="profil"
></ProfilCard>
<button type="button" class="btn btn-primary" data-dismiss="modal" v-on:click="logOut() ">Logout</button>
</div>
<div v-else-if="!isAuthentified">
<button v-on:click="showLoginModal=true" @clicked="logIn">Login</button>
<login-panel v-if="showLoginModal" @clicked="closeModal" ></login-panel>
</div>
</div>`, </div>`,
data: function () { data: function () {
return { profilcard: _profilcard }; return {
profilcard: _profilcard,
showLoginModal: false,
isAuthentified: false,
};
}, },
methods: { methods: {
closeModal (value) {
this.showLoginModal = value;
this.isAuthentified = !this.isAuthentified;
},
logIn (value) {
this.showLoginModal=false;
},
logOut () {
this.isAuthentified=false;
},
}, },
}; };