v0.9.0 - Added individual Read more buttons on news.index
Added NewsType - To see if it's a news, menu, guide or event Added type column to News type_id & arrangement_id (Both needed to see what type (menu,guide,news,event) and arrangement(The individual types ID)) Added NewsTypeSeeder.php Fixed CSS Added & Fixed messages en/dk Fixed Editors Added routing when removing yourself from an event, on events.index
This commit is contained in:
@@ -140,4 +140,25 @@ class UserEventController extends Controller
|
||||
|
||||
return '<p class="text-center"><b>Du er hermed tilmeldt denne aktivitet!</b></p>';
|
||||
}
|
||||
|
||||
public function createajaxcancel(Request $request)
|
||||
{
|
||||
// Check the UserEvent table if there is a row that has the user_id AND the event_id
|
||||
$UserEvent = UserEvent::where('user_id', auth()->user()->id)
|
||||
->where('event_id', $request->event_id);
|
||||
|
||||
|
||||
// If you are in the Event, then remove yourself.
|
||||
if (count($UserEvent->get()) > 0) {
|
||||
// If not, then it keeps going and saves and shows a success message
|
||||
$UserEvent->delete();
|
||||
|
||||
if (request()->cookie('languagesSetting') == "dk")
|
||||
return '<p class="text-center"><b>Du er hermed afmeldt aktiviteten!</b></p>';
|
||||
if (request()->cookie('languagesSetting') == "en")
|
||||
return '<p class="text-center"><b>You are no longer participating in this event!</b></p>';
|
||||
|
||||
return '<p class="text-center"><b>Du er hermed afmeldt aktiviteten!</b></p>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user