v0.9.4 - Added remove function to feedback admin page
Added - You can now see if you're participating an event on event.index and yourevents.blade.php Fixed `Tilbage` buttons
This commit is contained in:
@@ -57,7 +57,11 @@
|
||||
<div class="container">
|
||||
{!! \App\Helpers::closetags(substr($userevent->description, 0, 300) )!!}
|
||||
<div class="row" style="justify-content: space-between;">
|
||||
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="javascript:;" onclick="return confirm('Are you sure you want to remove this event?');" >{{__('msg.afmeld')}}</a>
|
||||
@if (count(\App\UserEvent::query()->where('event_id', '=', $userevent->id)->where('user_id', '=', Auth::user()->id)->get()) > 0)
|
||||
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="javascript:void(0);" onclick="ajaxCallCancel({{ $userevent->id }})" id="t">{{__('msg.afmeld')}}</a>
|
||||
@else {{-- ^ If you're already participating in the event, then show a ´cancel´ button - v Else show a ´participate´ button --}}
|
||||
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="javascript:void(0);" onclick="ajaxCall({{ $userevent->id }})" >{{__('msg.tilmeld')}}</a>
|
||||
@endif
|
||||
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="{{route("events.show", ["event" => $userevent->id ])}}">{{__('msg.læsmere')}}</a>
|
||||
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="{{route("events.accountsignups", ["event" => $userevent->id ])}}">{{__('msg.sedeltagere')}}</a>
|
||||
</div>
|
||||
@@ -68,6 +72,50 @@
|
||||
@else
|
||||
<p class="text-center">{{__('msg.duharikketilmeldtdignogenaktiviteter')}}!</p>
|
||||
@endif
|
||||
<a href="{{ route("events.index") }}" type="submit" style="margin-top: auto" class="mt-2 btn text-center btn-sde-blue">{{__('msg.tilbage')}}</a>
|
||||
<a onclick="window.history.back()" type="submit" style="margin-top: auto" class="mt-2 btn text-center btn-sde-blue">{{__('msg.tilbage')}}</a>
|
||||
<div id="snackbar"></div>
|
||||
</main>
|
||||
@endsection
|
||||
@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", ""); }, 3000);
|
||||
}
|
||||
|
||||
function ajaxCall(event_id) {
|
||||
|
||||
axios.post("{{ route("userevents.createajax") }}",
|
||||
{
|
||||
event_id: event_id
|
||||
}
|
||||
).then(function (response) {
|
||||
var data = response.data;
|
||||
|
||||
snackbar(data);
|
||||
setTimeout(function(){document.location.reload(false)}, 2000);
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
function ajaxCallCancel(event_id) {
|
||||
|
||||
axios.post("{{ route("userevents.createajaxcancel") }}",
|
||||
{
|
||||
event_id: event_id
|
||||
}
|
||||
).then(function (response) {
|
||||
var data = response.data;
|
||||
|
||||
snackbar(data);
|
||||
setTimeout(function(){document.location.reload(false)}, 2000);
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user