Create and Edit update with icon field

This commit is contained in:
Bubka 2020-01-02 00:09:19 +01:00
parent a5858093b0
commit 20a2d40a85
4 changed files with 106 additions and 54 deletions

View File

@ -32,7 +32,8 @@ public function store(Request $request)
$twofaccount = TwoFAccount::create([ $twofaccount = TwoFAccount::create([
'name' => $request->name, 'name' => $request->name,
'email' => $request->email, 'email' => $request->email,
'uri' => $request->uri 'uri' => $request->uri,
'icon' => $request->icon
]); ]);
return response()->json($twofaccount, 201); return response()->json($twofaccount, 201);

View File

@ -1,42 +1,49 @@
<template> <template>
<div class="container"> <div class="modal modal-otp is-active">
<div class="row justify-content-center"> <div class="modal-background"></div>
<div class="col-md-8"> <div class="modal-content">
<div class="card card-default"> <section class="section">
<div class="card-header">Register</div> <div class="columns is-centered">
<div class="card-body"> <div class="column is-three-quarters">
<div class="box has-background-black-ter ">
<form @submit.prevent="createAccount"> <form @submit.prevent="createAccount">
<div class="field"> <div class="field">
<label class="label">Name</label> <label class="label">Name</label>
<div class="control"> <div class="control">
<input class="input" type="text" placeholder="Text input" v-model="twofaccount.name" required autofocus> <input class="input" type="text" placeholder="Name" v-model="twofaccount.name" required autofocus />
</div> </div>
</div> </div>
<div class="field"> <div class="field">
<label class="label">Email</label> <label class="label">Email</label>
<div class="control"> <div class="control">
<input class="input" type="email" placeholder="Text input" v-model="twofaccount.email" required> <input class="input" type="text" placeholder="Email" v-model="twofaccount.email" required />
</div> </div>
</div> </div>
<div class="field"> <div class="field">
<label class="label">Uri</label> <label class="label">Uri</label>
<div class="control"> <div class="control">
<input class="input" type="text" placeholder="Text input" v-model="twofaccount.uri" required> <input class="input" type="text" placeholder="Uri" v-model="twofaccount.uri" required />
</div>
</div>
<div class="field">
<label class="label">Icon</label>
<div class="control">
<input class="input" type="text" placeholder="Icon" v-model="twofaccount.icon" required />
</div> </div>
</div> </div>
<div class="field is-grouped"> <div class="field is-grouped">
<div class="control"> <div class="control">
<button class="button is-link">Submit</button> <router-link :to="{ name: 'accounts' }" class="button is-light">Cancel</router-link>
</div> </div>
<div class="control"> <div class="control">
<router-link :to="{ name: 'accounts' }" class="button is-text">Cancel</router-link> <button type="submit" class="button is-link">Submit</button>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
</div> </div>
</section>
</div> </div>
</div> </div>
</template> </template>

View File

@ -1,27 +1,45 @@
<template> <template>
<div class="modal modal-otp is-active">
<div class="modal-background"></div>
<div class="modal-content">
<section class="section">
<div class="columns is-centered">
<div class="column is-three-quarters">
<div class="box has-background-black-ter ">
<form @submit.prevent="updateAccount"> <form @submit.prevent="updateAccount">
<div class="field"> <div class="field">
<label class="label">Name</label> <label class="label">Name</label>
<div class="control"> <div class="control">
<input class="input" type="text" placeholder="Text input" v-model="twofaccount.name" required autofocus /> <input class="input" type="text" placeholder="Account name" v-model="twofaccount.name" required autofocus />
</div> </div>
</div> </div>
<div class="field"> <div class="field">
<label class="label">Email</label> <label class="label">Email</label>
<div class="control"> <div class="control">
<input class="input" type="email" placeholder="Text input" v-model="twofaccount.email" required /> <input class="input" type="email" placeholder="account email" v-model="twofaccount.email" required />
</div>
</div>
<div class="field">
<label class="label">Icon</label>
<div class="control">
<input class="input" type="text" placeholder="account icon" v-model="twofaccount.icon" required />
</div> </div>
</div> </div>
<div class="field is-grouped"> <div class="field is-grouped">
<div class="control"> <div class="control">
<button class="button is-link">Submit</button> <router-link :to="{ name: 'accounts' }" class="button is-light">Cancel</router-link>
</div> </div>
<div class="control"> <div class="control">
<router-link :to="{ name: 'accounts' }" class="button is-text">Cancel</router-link> <button type="submit" class="button is-link">Submit</button>
</div> </div>
</div> </div>
</form> </form>
</div>
</div>
</div>
</section>
</div>
</div>
</template> </template>
<script> <script>

View File

@ -69,3 +69,29 @@ nav.level {
// background-color: black; // background-color: black;
//display:none; //display:none;
} }
.input, .select select, .textarea {
background-color: hsl(0, 0%, 21%);
border-color: hsl(0, 0%, 29%);
color: hsl(0, 0%, 71%);
}
.label {
color: hsl(0, 0%, 48%);
}
.modal .field.is-grouped:last-child {
justify-content: flex-end;
padding-top: 20px;
}
.modal-action-links {
position: absolute;
display: block;
bottom: 0px;
left: 0px;
width: 100%;
text-align: center;
}