diff --git a/app/Http/Controllers/PreApplicationController.php b/app/Http/Controllers/PreApplicationController.php
index 448b132..8c13818 100644
--- a/app/Http/Controllers/PreApplicationController.php
+++ b/app/Http/Controllers/PreApplicationController.php
@@ -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()];
+ }
+ }
+ }
}
diff --git a/app/Http/Controllers/WebsiteController.php b/app/Http/Controllers/WebsiteController.php
index 5047dbb..ef2ca0c 100644
--- a/app/Http/Controllers/WebsiteController.php
+++ b/app/Http/Controllers/WebsiteController.php
@@ -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);
+ }
+
}
diff --git a/app/Models/ChaosEvents.php b/app/Models/ChaosEvents.php
index 4c48689..0b3854d 100644
--- a/app/Models/ChaosEvents.php
+++ b/app/Models/ChaosEvents.php
@@ -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();
}
}
diff --git a/lang/de/app.php b/lang/de/app.php
index 82f8fa4..a85e401 100644
--- a/lang/de/app.php
+++ b/lang/de/app.php
@@ -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.
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: ',
diff --git a/lang/en/app.php b/lang/en/app.php
index f2644bb..1874ed8 100644
--- a/lang/en/app.php
+++ b/lang/en/app.php
@@ -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.
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: ',
diff --git a/public/Bilder/kontakt.jpg b/public/Bilder/kontakt.jpg
new file mode 100644
index 0000000..b9deb73
Binary files /dev/null and b/public/Bilder/kontakt.jpg differ
diff --git a/public/Bilder/neuigkeiten.jpg b/public/Bilder/neuigkeiten.jpg
new file mode 100644
index 0000000..8841ea7
Binary files /dev/null and b/public/Bilder/neuigkeiten.jpg differ
diff --git a/public/css/style.css b/public/css/style.css
index 1ec311b..a8cb660 100644
--- a/public/css/style.css
+++ b/public/css/style.css
@@ -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;
diff --git a/public/js/preapplication/edit.js b/public/js/preapplication/edit.js
new file mode 100644
index 0000000..0b22d89
--- /dev/null
+++ b/public/js/preapplication/edit.js
@@ -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);
+ }
+ });
+ }
+}
diff --git a/resources/views/application/edit.blade.php b/resources/views/application/edit.blade.php
new file mode 100644
index 0000000..f216be8
--- /dev/null
+++ b/resources/views/application/edit.blade.php
@@ -0,0 +1,79 @@
+@php
+ use App\Models\ChaosEvents;
+@endphp
+
+@extends('layout.app')
+
+@section('scripts')
+
+
+@endsection
+
+@section('content')
+
{{ __("app.preapplication.edit.description") }}
+ + {{ __('app.preapplication.passport_type') }}| {{ __('app.preapplication.region') }} | +{{ __('app.preapplication.reference_number') }} | +{{ __('app.preapplication.firstname') }} | +{{ __('app.preapplication.lastname') }} | +{{ __('app.preapplication.location') }} | +{{ __('app.preapplication.mail') }} | +{{ __('app.preapplication.passport_type') }} | +{{ __('app.preapplication.created_at') }} | +{{ __('app.preapplication.actions') }} | +
|---|---|---|---|---|---|---|---|---|
| {{ $appl->event()->first()->name }} | +{{ $appl->reference_number }} | ++ | + | + | + | {{ $appl->passport_type }} | +{{ $appl->created_at }} | ++ |
| + + | +{{ __('app.preapplication.edit.generated') }} | ++ | + | + | + | + | ++ | + |
{!! __('app.imprint.content') !!}
@endsection diff --git a/resources/views/content/index.blade.php b/resources/views/content/index.blade.php index 7b62285..8be92c2 100644 --- a/resources/views/content/index.blade.php +++ b/resources/views/content/index.blade.php @@ -1,5 +1,6 @@ @extends('layout.app') @section('content') -
+
{!! __('app.services.topic1.content') !!}
-
{!! __('app.services.topic2.content') !!}
-
{!! __('app.services.topic3.content') !!}
-
{!! __('app.services.topic4.content') !!}