2020-06-29 12:08:26 +00:00
|
|
|
@extends("app.layout.base")
|
|
|
|
|
|
|
|
@section("title")
|
|
|
|
Feedback - Ris/Ros
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section("content")
|
2020-08-18 07:02:03 +00:00
|
|
|
<style>
|
|
|
|
textarea {
|
|
|
|
color: black;
|
|
|
|
}
|
|
|
|
</style>
|
2020-08-05 05:51:30 +00:00
|
|
|
<main style="min-height: calc(100% - 61.34px)" class="text-center">
|
2020-09-07 12:21:59 +00:00
|
|
|
<div method="post" style="margin-top: 4rem; margin-bottom: auto; max-width: 100%; padding: 0 0.45rem 0 0.45rem; display: flex; flex-direction: column; justify-content: center;">
|
2020-06-30 06:35:40 +00:00
|
|
|
@csrf
|
2020-06-29 12:08:26 +00:00
|
|
|
<span>Ris el. Ros?</span>
|
2020-09-07 12:21:59 +00:00
|
|
|
<select id="suggestion_form" name="suggestion_form" class="mb-2" required>
|
2020-08-11 07:55:01 +00:00
|
|
|
<option selected>Ros</option>
|
2020-06-29 12:08:26 +00:00
|
|
|
<option>Ris</option>
|
|
|
|
</select>
|
2020-09-07 12:21:59 +00:00
|
|
|
<span>Besked:</span>
|
|
|
|
<textarea id="message" name="message" placeholder="Skriv Ris/Ros besked her" style="resize: vertical;" required></textarea>
|
|
|
|
<button onclick="ajaxCall(document.getElementById('suggestion_form'), document.getElementById('message'))" class="btn btn-sde-blue mt-2">Send Ris/Ros</button>
|
|
|
|
</div>
|
|
|
|
<div id="snackbar"></div>
|
2020-06-29 12:08:26 +00:00
|
|
|
</main>
|
|
|
|
@endsection
|
2020-09-07 12:21:59 +00:00
|
|
|
@section("scripts")
|
|
|
|
<script type="text/javascript">
|
|
|
|
function snackbar(data) {
|
|
|
|
var x = document.getElementById("snackbar");
|
|
|
|
x.innerHTML = data;
|
|
|
|
x.className = "show";
|
|
|
|
|
|
|
|
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 5000);
|
|
|
|
}
|
|
|
|
|
|
|
|
function ajaxCall(suggestion_form, message) {
|
|
|
|
var SF = suggestion_form.value
|
|
|
|
var M = message.value
|
|
|
|
|
|
|
|
if(SF != '' && M != '') {
|
|
|
|
axios.post("{{ route("feedbacks.storeajax") }}",
|
|
|
|
{
|
|
|
|
suggestion_form: SF,
|
|
|
|
message: M
|
|
|
|
}
|
|
|
|
).then(function (response) {
|
|
|
|
snackbar('{{__("msg.feedbacksendt")}}');
|
|
|
|
message.value = "";
|
|
|
|
}).catch(function (error) {
|
|
|
|
console.log(error);
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
snackbar('{{__("msg.feedbackerror")}}');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
@endsection
|