Upload Tourenplan+Mitgliedsantrag
This commit is contained in:
parent
66d7802f7a
commit
f5519f1563
21 changed files with 423 additions and 10 deletions
53
motorradig/app/Http/Controllers/AdminController.php
Normal file
53
motorradig/app/Http/Controllers/AdminController.php
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class AdminController extends Controller
|
||||
{
|
||||
public function upload_tourplan(Request $request)
|
||||
{
|
||||
return view ('admin.upload_tourplan');
|
||||
}
|
||||
|
||||
public function store_tourplan(Request $request)
|
||||
{
|
||||
$request->validate(
|
||||
[
|
||||
'tourplan'=>'required|mimes:pdf|max:2048'
|
||||
]
|
||||
);
|
||||
|
||||
$request->file('tourplan')->storeAs('pdf', 'tourenplan.pdf','public2');
|
||||
|
||||
return view ('/home');
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function upload_mitgliedsantrag(Request $request)
|
||||
{
|
||||
return view ('admin.upload_mitgliedsantrag');
|
||||
}
|
||||
|
||||
public function store_mitgliedsantrag(Request $request)
|
||||
{
|
||||
$request->validate(
|
||||
[
|
||||
'mitgliedsantrag' => 'required|mimes:pdf|max:2048'
|
||||
]
|
||||
);
|
||||
|
||||
$request->file('mitgliedsantrag')->storeAs('pdf', 'mitgliedsantrag.pdf', 'public2');
|
||||
|
||||
return view('/home');
|
||||
}
|
||||
|
||||
public function edit_start_page(Request $request) {
|
||||
return view('admin.edit_start');
|
||||
}
|
||||
public function edit_activity_page(Request $request) {
|
||||
return view('admin.edit_activities');
|
||||
}
|
||||
}
|
||||
90
motorradig/app/Http/Controllers/TourController.php
Normal file
90
motorradig/app/Http/Controllers/TourController.php
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Tour;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\File;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
|
||||
class TourController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\Tour $tour
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Tour $tour)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Tour $tour
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(Tour $tour)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\Tour $tour
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, Tour $tour)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Tour $tour
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(Tour $tour)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -134,4 +134,7 @@ class UserController extends Controller
|
|||
{
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
10
motorradig/app/Tour.php
Normal file
10
motorradig/app/Tour.php
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Tour extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
|
|
@ -54,7 +54,10 @@ return [
|
|||
'url' => env('APP_URL').'/storage',
|
||||
'visibility' => 'public',
|
||||
],
|
||||
|
||||
'public2' => [
|
||||
'driver' => 'local',
|
||||
'root' => '.'
|
||||
],
|
||||
's3' => [
|
||||
'driver' => 's3',
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
|
|
@ -78,8 +81,8 @@ return [
|
|||
|
|
||||
*/
|
||||
|
||||
'links' => [
|
||||
public_path('storage') => storage_path('app/public'),
|
||||
],
|
||||
// 'links' => [
|
||||
// public_path('storage') => storage_path('app/public'),
|
||||
// ],
|
||||
|
||||
];
|
||||
|
|
|
|||
12
motorradig/database/factories/TourFactory.php
Normal file
12
motorradig/database/factories/TourFactory.php
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
|
||||
use App\Tour;
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(Tour::class, function (Faker $faker) {
|
||||
return [
|
||||
//
|
||||
];
|
||||
});
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateToursTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('tours', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('tours');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreatePagesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('pages', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->text('content');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('pages');
|
||||
}
|
||||
}
|
||||
16
motorradig/database/seeds/TourSeeder.php
Normal file
16
motorradig/database/seeds/TourSeeder.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class TourSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
BIN
motorradig/public/img/user/1.jpg
Normal file
BIN
motorradig/public/img/user/1.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
BIN
motorradig/public/img/user/1_gross.jpg
Normal file
BIN
motorradig/public/img/user/1_gross.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 111 KiB |
BIN
motorradig/public/pdf/tourenplan.pdf
Normal file
BIN
motorradig/public/pdf/tourenplan.pdf
Normal file
Binary file not shown.
|
|
@ -0,0 +1,39 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card mt-4">
|
||||
<div class="card-header">Tourenplan hochladen</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<form style="background-color: #fff;" class="text-dark" method="post" action="/admin/store_tourplan" enctype="multipart/form-data">
|
||||
@csrf
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="form-group" style="display:flex;">
|
||||
|
||||
<input type="file" class="mt-3 mr-2 form-control" id="tourplan" style="font-size:20px;" name="tourplan" value="" >
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@if(Auth::user()->role=="ADMIN")
|
||||
<button type="submit" class="btn btn-danger col-2 mb-2 float-right mr-2">Hochladen</button>
|
||||
@endif
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
39
motorradig/resources/views/admin/edit_page_home.blade.php
Normal file
39
motorradig/resources/views/admin/edit_page_home.blade.php
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card mt-4">
|
||||
<div class="card-header">Tourenplan hochladen</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<form style="background-color: #fff;" class="text-dark" method="post" action="/admin/store_tourplan" enctype="multipart/form-data">
|
||||
@csrf
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="form-group" style="display:flex;">
|
||||
|
||||
<input type="file" class="mt-3 mr-2 form-control" id="tourplan" style="font-size:20px;" name="tourplan" value="" >
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@if(Auth::user()->role=="ADMIN")
|
||||
<button type="submit" class="btn btn-danger col-2 mb-2 float-right mr-2">Hochladen</button>
|
||||
@endif
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card mt-4">
|
||||
<div class="card-header">Mitgliedsantrag aktualisieren</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<form style="background-color: #fff;" class="text-dark" method="post" action="/admin/store_mitgliedsantrag" enctype="multipart/form-data">
|
||||
@csrf
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="form-group" style="display:flex;">
|
||||
<input type="file" class="mt-3 mr-2 form-control" id="mitgliedsantrag" style="font-size:20px;" name="mitgliedsantrag" value="" >
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@if(Auth::user()->role=="ADMIN")
|
||||
<button type="submit" class="btn btn-danger col-2 mb-2 float-right mr-2">Hochladen</button>
|
||||
@endif
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
39
motorradig/resources/views/admin/upload_tourplan.blade.php
Normal file
39
motorradig/resources/views/admin/upload_tourplan.blade.php
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card mt-4">
|
||||
<div class="card-header">Tourenplan hochladen</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<form style="background-color: #fff;" class="text-dark" method="post" action="/admin/store_tourplan" enctype="multipart/form-data">
|
||||
@csrf
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="form-group" style="display:flex;">
|
||||
|
||||
<input type="file" class="mt-3 mr-2 form-control" id="tourplan" style="font-size:20px;" name="tourplan" value="" >
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@if(Auth::user()->role=="ADMIN")
|
||||
<button type="submit" class="btn btn-danger col-2 mb-2 float-right mr-2">Hochladen</button>
|
||||
@endif
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -94,6 +94,14 @@
|
|||
|
||||
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
|
||||
|
||||
|
||||
<a class="dropdown-item" href="{{ route('logout') }}">Seite: Startseite bearbeiten</a>
|
||||
<a class="dropdown-item" href="{{ route('logout') }}">Seite: Aktivitäten bearbeiten</a>
|
||||
<a class="dropdown-item" href="/admin/upload_tourplan">Tourenplan(pdf) hochladen</a>
|
||||
<a class="dropdown-item" href="/admin/upload_mitgliedsantrag">Mitgliedsantrag(pdf) hochladen</a>
|
||||
|
||||
|
||||
<a class="dropdown-item" href="{{ route('logout') }}"
|
||||
onclick="event.preventDefault();
|
||||
document.getElementById('logout-form').submit();">
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
@section('content')
|
||||
<div class="container text-center text-light mt-5">
|
||||
<h1 class="text-center">Tourenplan</h1>
|
||||
<a href="#" class="text-center text-light">Download</a>
|
||||
<a href="/pdf/tourenplan.pdf" class="text-center text-light">Download</a>
|
||||
<div class="container text-primary">
|
||||
.<ul class="list-group offset-3 col-6">
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
|
|
|
|||
|
|
@ -26,7 +26,11 @@ Route::get('/tourplan', function () { return view('tourplan'); });
|
|||
//Route::get('/member/{user_id}','UserController@show');
|
||||
Route::resource('/member',UserController::class);
|
||||
|
||||
Route::get('/admin/upload_tourplan', 'AdminController@upload_tourplan');
|
||||
Route::post('/admin/store_tourplan','AdminController@store_tourplan');
|
||||
|
||||
Route::get('/admin/upload_mitgliedsantrag', 'AdminController@upload_mitgliedsantrag');
|
||||
Route::post('/admin/store_mitgliedsantrag','AdminController@store_mitgliedsantrag');
|
||||
|
||||
|
||||
Auth::routes();
|
||||
|
|
|
|||
3
motorradig/storage/app/.gitignore
vendored
3
motorradig/storage/app/.gitignore
vendored
|
|
@ -1,3 +0,0 @@
|
|||
*
|
||||
!public/
|
||||
!.gitignore
|
||||
2
motorradig/storage/app/public/.gitignore
vendored
2
motorradig/storage/app/public/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
|||
*
|
||||
!.gitignore
|
||||
Loading…
Add table
Add a link
Reference in a new issue