<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Auth;

class WebsiteController extends Controller
{


    //
    public function index(Request $request)
    {
        return view('content.index');
    }

    public function about(Request $request){
        return view('content.about');
    }

    public function documents(Request $request){
        return view('content.documents');
    }

    public function contact(Request $request){
        return view('content.contact');
    }

	public function faq(Request $request){
        return view('content.faq');
    }

    public function imprint(Request $request){
        return view('content.imprint');
    }

    public function news(Request $request){
        return view('content.news', ['blogs' => BlogController::blogPaginated(App::getLocale(), true)]);
    }

    public function services(Request $request){
        return view('content.services');
    }

    public function apply(Request $request){
        return view('application.apply');
    }


    // C3Gov-Stuffs

    public function showRegister()
    {
        return view('login.register');
    }

    public function showLogin()
    {
        return view('login.login');
    }

    public function editTicker(){
        if(Auth::check()){
            return view('ticker.edit');
        }
        abort(404);
    }

    public function editNews(){
        if(Auth::check()){
            return response()
                ->view('blog.edit', ['blogs' => BlogController::blogPaginatedEdit()])
                ->header('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
        }
        abort(404);
    }

    public function editApplications(){
        if(Auth::check()){
            return response()
                ->view('application.edit', ['applications' => PreApplicationController::applicationsPaginated()])
                ->header('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
        }
        abort(404);
    }

    public function editEvents(){
        if(Auth::check()){
            return response()
                ->view('events.edit', ['events' => EventController::eventsPaginated()])
                ->header('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
        }
        abort(404);
    }

}
