Mehr Bilder, Arbeit am Backend
This commit is contained in:
@@ -83,4 +83,27 @@ class PreApplicationController extends Controller
|
||||
}
|
||||
return ["messageStatus" => "failure", "errorMessage" => __("controller_messages.PreApplicationController.event_not_found")];
|
||||
}
|
||||
|
||||
public static function applicationsPaginated(){
|
||||
return PreApplications::paginate(50);
|
||||
}
|
||||
|
||||
public function addApplication(Request $request){
|
||||
if(Auth::check()){
|
||||
try {
|
||||
$pa = new PreApplications();
|
||||
$pa->first_name = $request->input('first_name');
|
||||
$pa->last_name = $request->input('last_name');
|
||||
$pa->location = $request->input('location');
|
||||
$pa->passport_type = $request->input('passport_type');
|
||||
$pa->reference_number = $request->input('reference_number');
|
||||
$pa->event_id = $request->input('event_id');
|
||||
$pa->email = $request->input('email');
|
||||
$pa->save();
|
||||
}
|
||||
catch(\Exception $e){
|
||||
return ["messageStatus" => "failure", "errorMessage" => $e->getMessage()];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,4 +81,14 @@ class WebsiteController extends Controller
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class ChaosEvents extends Model
|
||||
}
|
||||
|
||||
public static function getActiveEvents(){
|
||||
return self::where('to_date_internal', '>=', today())
|
||||
return self::where('active', 1)->where('to_date_internal', '>=', today())
|
||||
->where('from_date_internal', '<=', today())->get();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,10 @@ return [
|
||||
'contact' => 'Kontakt',
|
||||
'imprint' => 'Impressum',
|
||||
'apply' => 'Jetzt beantragen',
|
||||
'editTicker' => 'Ticker bearbeiten',
|
||||
'editNews' => 'Neuigkeiten bearbeiten',
|
||||
'editApplications' => 'Anträge bearbeiten',
|
||||
'logout' => 'Abmelden'
|
||||
],
|
||||
'about' => [
|
||||
'subtitle' => 'Unbeschwertes Einreisen in die stationären sowie temporären CCC Bezirksregionen',
|
||||
@@ -70,7 +74,7 @@ return [
|
||||
'title' => 'Vorantrag auf Reisepass gem. § 5 C3GovVerwV',
|
||||
'content' => 'Bitte wählen Sie eine (temporäre) Bezirksregion aus, um Ihren Vorantrag auf einen Reisepass zu stellen.
|
||||
<br />Nachdem Sie den Vorantrag abgeschickt haben, erhalten Sie eine Bestätigung via elektronischer Post.',
|
||||
'noevent' => 'Es sind derzeit keine (temporären) Bezirksregionen verfügbar.',
|
||||
'noevent' => 'Es sind derzeit keine Termine verfügbar.',
|
||||
'region' => 'Bezirksregion',
|
||||
'passport_type' => 'Reisepass-Typ',
|
||||
'passport' => [
|
||||
@@ -81,7 +85,18 @@ return [
|
||||
'firstname' => 'Vorname (Nick)',
|
||||
'lastname' => 'Nachname (optional)',
|
||||
'location' => 'Hackspace / Ort (optional)',
|
||||
'apply' => 'Vorantrag abschicken'
|
||||
'reference_number' => 'Bearbeitungsnummer',
|
||||
'created_at' => 'Eingereicht am',
|
||||
'actions' => 'Aktionen',
|
||||
'apply' => 'Vorantrag abschicken',
|
||||
'edit' => [
|
||||
'title' => 'Anträge bearbeiten',
|
||||
'description' => 'Hier können Sie Anträge bearbeiten oder löschen.',
|
||||
'add' => 'Antrag hinzufügen',
|
||||
'save' => 'Speichern',
|
||||
'delete' => 'Löschen',
|
||||
'generated' => 'Wird generiert'
|
||||
]
|
||||
],
|
||||
'common' => [
|
||||
'error_occurred' => 'Es ist ein Fehler geschehen: ',
|
||||
|
||||
@@ -17,6 +17,10 @@ return [
|
||||
'contact' => 'Contact',
|
||||
'imprint' => 'Imprint',
|
||||
'apply' => 'Apply now',
|
||||
'editTicker' => 'Edit ticker',
|
||||
'editNews' => 'Edit news',
|
||||
'editApplications' => 'Edit applications',
|
||||
'logout' => 'Logout'
|
||||
],
|
||||
'about' => [
|
||||
'subtitle' => 'Hassle-Free Entry into CCC\'s Permanent and Temporary District Regions',
|
||||
@@ -70,7 +74,7 @@ return [
|
||||
'title' => 'Pre-application for Passport according to § 5 C3GovVerwV',
|
||||
'content' => 'Please select a (temporary) district region to submit your pre-application for a passport.
|
||||
<br />After you have submitted the pre-application, you will receive a confirmation by e-mail.',
|
||||
'noevent' => 'There are currently no (temporary) district regions available.',
|
||||
'noevent' => 'Currently, there are no open appointment slots available.',
|
||||
'region' => 'District region',
|
||||
'passport_type' => 'Passport type',
|
||||
'passport' => [
|
||||
@@ -81,7 +85,18 @@ return [
|
||||
'firstname' => 'First name (Nickname)',
|
||||
'lastname' => 'Last name (optional)',
|
||||
'location' => 'Hackspace / Location (optional)',
|
||||
'apply' => 'Submit pre-application'
|
||||
'reference_number' => 'Reference number',
|
||||
'created_at' => 'Submitted at',
|
||||
'actions' => 'Actions',
|
||||
'apply' => 'Submit pre-application',
|
||||
'edit' => [
|
||||
'title' => 'Edit applications',
|
||||
'description' => 'Here you can edit or delete applications.',
|
||||
'add' => 'Add application',
|
||||
'save' => 'Save',
|
||||
'delete' => 'Delete',
|
||||
'generated' => 'Generated'
|
||||
]
|
||||
],
|
||||
'common' => [
|
||||
'error_occurred' => 'An error occurred: ',
|
||||
|
||||
BIN
public/Bilder/kontakt.jpg
Normal file
BIN
public/Bilder/kontakt.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 MiB |
BIN
public/Bilder/neuigkeiten.jpg
Normal file
BIN
public/Bilder/neuigkeiten.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 MiB |
@@ -24,6 +24,7 @@ select {
|
||||
height: 3vh;
|
||||
min-height: 24px;
|
||||
flex-shrink: 0;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
.header {
|
||||
@@ -108,6 +109,13 @@ select {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.content-img {
|
||||
width: 33%;
|
||||
height: 150px;
|
||||
display: block;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.navbar ul {
|
||||
list-style-type: none;
|
||||
padding: 10px;
|
||||
|
||||
57
public/js/preapplication/edit.js
Normal file
57
public/js/preapplication/edit.js
Normal file
@@ -0,0 +1,57 @@
|
||||
function addApplication(){
|
||||
|
||||
let data = {};
|
||||
data.district_region = $('#region_new').val();
|
||||
data.passport_type = $('#passport_type').val();
|
||||
data.mail = $('#mail').val();
|
||||
data.first_name = $('#firstname').val();
|
||||
data.last_name = $('#lastname').val();
|
||||
data.location = $('#location').val();
|
||||
|
||||
console.log(data);
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/intern/antraege/neu",
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success:function(r){
|
||||
if(r.messageStatus === "success"){
|
||||
$('#mail').val("");
|
||||
$('#firstname').val("");
|
||||
$('#lastname').val("");
|
||||
$('#location').val("");
|
||||
alert(r.errorMessage);
|
||||
} else {
|
||||
alert(r.errorMessage);
|
||||
}
|
||||
},
|
||||
error:function(r, a, e){
|
||||
alert(i18n.common.error_occurred + e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function deleteApplication(applicationId){
|
||||
let data = {};
|
||||
data.id = applicationId;
|
||||
console.log(data);
|
||||
if(window.confirm(i18n.blog.confirm_delete)){
|
||||
$.ajax({
|
||||
type: "DELETE",
|
||||
url: "/intern/antraege/loeschen",
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success:function(r){
|
||||
if(r.messageStatus === "success"){
|
||||
alert(r.errorMessage);
|
||||
} else {
|
||||
alert(r.errorMessage);
|
||||
}
|
||||
},
|
||||
error:function(r, a, e){
|
||||
alert(i18n.common.error_occurred + e);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
79
resources/views/application/edit.blade.php
Normal file
79
resources/views/application/edit.blade.php
Normal file
@@ -0,0 +1,79 @@
|
||||
@php
|
||||
use App\Models\ChaosEvents;
|
||||
@endphp
|
||||
|
||||
@extends('layout.app')
|
||||
|
||||
@section('scripts')
|
||||
<script>
|
||||
const i18n = {
|
||||
common: {
|
||||
error_occurred: "{{ __('app.common.error_occurred') }}"
|
||||
},
|
||||
blog: {
|
||||
confirm_save: "{{ __('app.blog.confirm_save') }}",
|
||||
confirm_delete: "{{ __('app.blog.confirm_delete') }}"
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="{{ asset('/js/preapplication/edit.js') }}"></script>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<h1>{{ __("app.preapplication.edit.title") }}</h1>
|
||||
<p>{{ __("app.preapplication.edit.description") }}</p>
|
||||
|
||||
{{ __('app.preapplication.passport_type') }}<br />
|
||||
d = {{ __('app.preapplication.passport.standard') }}<br />
|
||||
k = {{ __('app.preapplication.passport.kid') }}
|
||||
<br /><br />
|
||||
|
||||
<table class="eingabetabelle">
|
||||
<tr>
|
||||
<th>{{ __('app.preapplication.region') }}</th>
|
||||
<th>{{ __('app.preapplication.reference_number') }}</th>
|
||||
<th>{{ __('app.preapplication.firstname') }}</th>
|
||||
<th>{{ __('app.preapplication.lastname') }}</th>
|
||||
<th>{{ __('app.preapplication.location') }}</th>
|
||||
<th>{{ __('app.preapplication.mail') }}</th>
|
||||
<th>{{ __('app.preapplication.passport_type') }}</th>
|
||||
<th>{{ __('app.preapplication.created_at') }}</th>
|
||||
<th>{{ __('app.preapplication.actions') }}</th>
|
||||
</tr>
|
||||
@foreach($applications as $appl)
|
||||
<tr>
|
||||
<td>{{ $appl->event()->first()->name }}</td>
|
||||
<td>{{ $appl->reference_number }}</td>
|
||||
<td><input id="first_name_{{ $appl->id }}" type="text" value="{{ $appl->first_name }}"></td>
|
||||
<td><input id="last_name_{{ $appl->id }}" type="text" value="{{ $appl->last_name }}"></td>
|
||||
<td><input id="location_{{ $appl->id }}" type="text" value="{{ $appl->location }}"></td>
|
||||
<td><input id="email_{{ $appl->id }}" type="text" value="{{ $appl->email }}"></td>
|
||||
<td>{{ $appl->passport_type }}</td>
|
||||
<td>{{ $appl->created_at }}</td>
|
||||
<td><button onclick="editApplication({{ $appl->id }})">{{ __('app.preapplication.edit.save') }}</button><button onclick="deleteApplication({{ $appl->id }})">{{ __('app.preapplication.edit.delete') }}</button></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<tr>
|
||||
<td>
|
||||
<select id="region_new">
|
||||
@foreach(ChaosEvents::getActiveEvents() as $region)
|
||||
<option value="{{ $region->id }}">{{ $region->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</td>
|
||||
<td>{{ __('app.preapplication.edit.generated') }}</td>
|
||||
<td><input id="first_name_new" type="text"></td>
|
||||
<td><input id="last_name_new" type="text"></td>
|
||||
<td><input id="location_new" type="text"></td>
|
||||
<td><input id="email_new" type="text"></td>
|
||||
<td><select id="passport_type_new">
|
||||
<option value="d">d</option>
|
||||
<option value="k">k</option>
|
||||
</select>
|
||||
</td>
|
||||
<td></td>
|
||||
<td><button onclick="addApplication()">{{ __('app.preapplication.edit.add') }}</button></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@endsection
|
||||
@@ -3,6 +3,7 @@
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<img class="content-img" src="{{ asset('/Bilder/abgelehnt.jpg') }}">
|
||||
<h2>{{ __('app.nav.about') }}</h2>
|
||||
|
||||
<h1>{{ __('app.about.subtitle') }}</h1>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<img class="content-img" src="{{ asset('Bilder/kontakt.jpg') }}" alt="Contact" />
|
||||
<h1>{{ __('app.contact.title') }}</h1>
|
||||
<br />
|
||||
{!! __('app.contact.content') !!}
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<img class="content-img" src="{{ asset('/Bilder/ernsthaft.jpg') }}">
|
||||
<h1>{{ __('app.imprint.title') }}</h1>
|
||||
<br />
|
||||
<h2>{!! __('app.imprint.content') !!}</h2>
|
||||
<p>{!! __('app.imprint.content') !!}</p>
|
||||
@endsection
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
@extends('layout.app')
|
||||
|
||||
@section('content')
|
||||
<h1>Guten Tag.</h1>
|
||||
<img class="content-img" src="{{ asset('/Bilder/verwvstempel.jpg') }}">
|
||||
<h1>Guten Tag.</h1>
|
||||
@endsection
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<img class="content-img" src="{{ asset('Bilder/neuigkeiten.jpg') }}">
|
||||
<h1>{{ __('app.nav.news') }}</h1>
|
||||
@foreach($blogs as $blog)
|
||||
<h2>{{ $blog->title }}</h2>
|
||||
|
||||
@@ -5,15 +5,22 @@
|
||||
@section('content')
|
||||
<h1>{{ __('app.services.title') }}</h1>
|
||||
<br />
|
||||
<img class="content-img" src="{{ asset('Bilder/erstausstellung.jpg') }}">
|
||||
<h2>{{ __('app.services.topic1.title') }}</h2>
|
||||
<p>{!! __('app.services.topic1.content') !!}</p>
|
||||
<br />
|
||||
<br /><br />
|
||||
|
||||
<img class="content-img" src="{{ asset('Bilder/abgelehnt.jpg') }}">
|
||||
<h2>{{ __('app.services.topic2.title') }}</h2>
|
||||
<p>{!! __('app.services.topic2.content') !!}</p>
|
||||
<br />
|
||||
<br /><br />
|
||||
|
||||
<img class="content-img" src="{{ asset('Bilder/ersatz.jpg') }}">
|
||||
<h2>{{ __('app.services.topic3.title') }}</h2>
|
||||
<p>{!! __('app.services.topic3.content') !!}</p>
|
||||
<br />
|
||||
<br /><br />
|
||||
|
||||
<img class="content-img" src="{{ asset('Bilder/verwvstempel.jpg') }}">
|
||||
<h2>{{ __('app.services.topic4.title') }}</h2>
|
||||
<p>{!! __('app.services.topic4.content') !!}</p>
|
||||
<br />
|
||||
|
||||
@@ -45,10 +45,10 @@
|
||||
<li><a href="{{ route('apply') }}">{{ __('app.nav.apply') }}</a></li>
|
||||
@auth
|
||||
<br />
|
||||
<li><a href="{{ route('editTicker') }}">Ticker bearbeiten</a></li>
|
||||
<li><a href="{{ route('editNews') }}">Nachrichten bearbeiten</a></li>
|
||||
<li><a href="{{ route('logout') }}">Abmelden</a></li>
|
||||
|
||||
<li><a href="{{ route('editTicker') }}">{{ __('app.nav.editTicker') }}</a></li>
|
||||
<li><a href="{{ route('editNews') }}">{{ __('app.nav.editNews') }}</a></li>
|
||||
<li><a href="{{ route('editApplications') }}">{{ __('app.nav.editApplications') }}</a></li>
|
||||
<li><a href="{{ route('logout') }}">{{ __('app.nav.logout') }}</a></li>
|
||||
@endauth
|
||||
</ul>
|
||||
<br />
|
||||
|
||||
@@ -39,3 +39,8 @@ Route::get('/intern/nachrichten', [WebsiteController::class, 'editNews'])->name(
|
||||
Route::post('/intern/nachrichten/add', [BlogController::class, 'addBlog']);
|
||||
Route::delete('/intern/nachrichten/delete', [BlogController::class, 'deleteBlog']);
|
||||
Route::put('/intern/nachrichten/edit', [BlogController::class, 'editBlog']);
|
||||
|
||||
Route::get('/intern/antraege', [WebsiteController::class, 'editApplications'])->name('editApplications');
|
||||
Route::post('/intern/antraege/add', [PreApplicationController::class, 'addApplication']);
|
||||
Route::delete('/intern/antraege/delete', [PreApplicationController::class, 'deleteApplication']);
|
||||
Route::put('/intern/antraege/edit', [PreApplicationController::class, 'editApplication']);
|
||||
|
||||
Reference in New Issue
Block a user