Mehr!
This commit is contained in:
19
app/Http/Controllers/TickerController.php
Normal file
19
app/Http/Controllers/TickerController.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\TickerMessages;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\App;
|
||||
|
||||
class TickerController extends Controller
|
||||
{
|
||||
public static function getTicker(){
|
||||
$t = "";
|
||||
foreach(TickerMessages::getMessages(App::getLocale())->get() as $message){
|
||||
$t .= " -- " . $message->message;
|
||||
}
|
||||
$t .= " -- ";
|
||||
return $t;
|
||||
}
|
||||
}
|
||||
@@ -7,18 +7,23 @@ use Illuminate\Support\Facades\App;
|
||||
|
||||
class WebsiteController extends Controller
|
||||
{
|
||||
|
||||
public function __construct(){
|
||||
$this->setLang($_COOKIE['lang']);
|
||||
}
|
||||
|
||||
private function setLang($lang)
|
||||
{
|
||||
if (! in_array($lang, ['de', 'en'])) {
|
||||
$lang = 'en';
|
||||
$lang = 'de';
|
||||
}
|
||||
|
||||
App::setLocale($lang);
|
||||
}
|
||||
|
||||
//
|
||||
public function index(Request $request, $lang){
|
||||
$this->setLang($lang);
|
||||
public function index(Request $request){
|
||||
|
||||
|
||||
return view('layout.app', ['page' => 'content.index']);
|
||||
}
|
||||
|
||||
19
app/Models/TickerMessages.php
Normal file
19
app/Models/TickerMessages.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class TickerMessages extends Model
|
||||
{
|
||||
//
|
||||
protected $table = 'ticker_messages';
|
||||
|
||||
protected $fillable = ['language', 'message'];
|
||||
|
||||
public static function getMessages($language){
|
||||
return self::where('language', $language)->orderBy('updated_at', 'desc');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -18,7 +18,7 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => env('SESSION_DRIVER', 'database'),
|
||||
'driver' => env('SESSION_DRIVER', 'cookies'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('ticker_messages', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('language');
|
||||
$table->string('message');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('ticker_messages');
|
||||
}
|
||||
};
|
||||
@@ -2,5 +2,9 @@
|
||||
|
||||
return [
|
||||
'subtitle' => 'Ihr Amt für Reisepass-Angelegenheiten in der Bezirksregion CCC.',
|
||||
'logo' => 'Offizielles Logo des c3gov'
|
||||
'logo' => 'Offizielles Logo des c3gov',
|
||||
'language' => [
|
||||
'en' => 'English',
|
||||
'de' => 'Deutsch',
|
||||
]
|
||||
];
|
||||
|
||||
@@ -2,5 +2,9 @@
|
||||
|
||||
return [
|
||||
'subtitle' => 'Your office for passport document affairs within the district region CCC.',
|
||||
'logo' => 'Official logo of the c3gov'
|
||||
'logo' => 'Official logo of the c3gov',
|
||||
'language' => [
|
||||
'en' => 'English',
|
||||
'de' => 'Deutsch',
|
||||
]
|
||||
];
|
||||
|
||||
BIN
public/Bilder/deutsch.gif
Normal file
BIN
public/Bilder/deutsch.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 829 KiB |
BIN
public/Bilder/englisch.gif
Normal file
BIN
public/Bilder/englisch.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
@@ -5,7 +5,18 @@
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: darkred;
|
||||
}
|
||||
|
||||
.language {
|
||||
position: absolute;
|
||||
width: 10%;
|
||||
height: 20%;
|
||||
top: 0;
|
||||
right: 0;
|
||||
background-color: #f8b803;
|
||||
}
|
||||
.language img {
|
||||
height: 35%;
|
||||
}
|
||||
|
||||
#logo {
|
||||
|
||||
4
public/js/web.js
Normal file
4
public/js/web.js
Normal file
@@ -0,0 +1,4 @@
|
||||
function setLanguage(lang) {
|
||||
document.cookie = "lang=" + lang;
|
||||
location.reload();
|
||||
}
|
||||
@@ -4,13 +4,20 @@
|
||||
<meta charset="UTF-8">
|
||||
<title>c3gov - {{ __('app.subtitle') }}</title>
|
||||
<link rel="stylesheet" href="{{ asset("css/style.css") }}">
|
||||
<script src="{{ asset("js/web.js") }}"></script>
|
||||
</head>
|
||||
<body>
|
||||
<span class="header">
|
||||
<img id="logo" src="{{ asset("Bilder/logo.png") }}" alt="{{ __('app.logo') }}">
|
||||
</span>
|
||||
|
||||
<span class="language">
|
||||
<img alt="{{ __('app.language.de') }}" onclick="setLanguage('de')" src="{{ asset("Bilder/deutsch.gif") }}">
|
||||
<img alt="{{ __('app.language.en') }}" onclick="setLanguage('en')" src="{{ asset("Bilder/englisch.gif") }}">
|
||||
</span>
|
||||
|
||||
<span class="ticker">
|
||||
<marquee>Dies ist ein Text. -- Gut, oder?</marquee>
|
||||
<marquee>{{\App\Http\Controllers\TickerController::getTicker()}}</marquee>
|
||||
</span>
|
||||
<span class="navbar"></span>
|
||||
<span class="content">
|
||||
|
||||
@@ -2,11 +2,14 @@
|
||||
|
||||
use App\Http\Controllers\WebsiteController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
/*
|
||||
Route::get('/', function () {
|
||||
return view('welcome');
|
||||
});*/
|
||||
|
||||
Route::redirect('/', '/de');
|
||||
|
||||
Route::get('/{lang}', [WebsiteController::class, 'index']);
|
||||
Route::get('/', [WebsiteController::class, 'index']);
|
||||
|
||||
Route::get('/ueberuns', [WebsiteController::class, 'about']);
|
||||
Route::get('/kontakt', [WebsiteController::class, 'contact']);
|
||||
Route::get('/impressum', [WebsiteController::class, 'imprint']);
|
||||
Route::get('/services', [WebsiteController::class, 'services']);
|
||||
Route::get('/neuigkeiten', [WebsiteController::class, 'news']);
|
||||
|
||||
Route::get('/intern/anmelden', [WebsiteController::class, 'login']);
|
||||
|
||||
Reference in New Issue
Block a user