2020-06-29 12:08:26 +00:00
|
|
|
@extends("app.layout.base")
|
|
|
|
|
|
|
|
@section("title")
|
|
|
|
Feedback - Ris/Ros
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section("content")
|
2020-08-05 05:51:30 +00:00
|
|
|
<main style="min-height: calc(100% - 61.34px)" class="text-center">
|
2020-11-26 09:19:12 +00:00
|
|
|
<div method="post" class="mt-3 mb-auto d-flex flex-column pl-1 pr-1">
|
2020-06-30 06:35:40 +00:00
|
|
|
@csrf
|
2020-09-10 10:35:38 +00:00
|
|
|
<span>{{__("msg.risros")}}</span>
|
2020-09-07 12:21:59 +00:00
|
|
|
<select id="suggestion_form" name="suggestion_form" class="mb-2" required>
|
2020-09-10 10:35:38 +00:00
|
|
|
<option selected value="Ros">{{__("msg.ros")}}</option>
|
|
|
|
<option value="Ris">{{__("msg.ris")}}</option>
|
|
|
|
<option value="Andet">{{__("msg.andet")}}</option>
|
2020-06-29 12:08:26 +00:00
|
|
|
</select>
|
2020-09-10 10:35:38 +00:00
|
|
|
<span>{{__("msg.besked")}}:</span>
|
2020-11-26 09:19:12 +00:00
|
|
|
<textarea class="text-black resize-vertical" id="message" name="message" placeholder="{{__("msg.besked")}}" required></textarea>
|
2020-09-10 10:35:38 +00:00
|
|
|
<button onclick="ajaxCall(document.getElementById('suggestion_form'), document.getElementById('message'))" class="btn btn-sde-blue mt-2">{{__("msg.send")}}</button>
|
2020-09-07 12:21:59 +00:00
|
|
|
</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
|