Verbesserungen i80n, Bugfixes, uvm

This commit is contained in:
2026-03-28 14:04:01 +01:00
parent 7729aba416
commit e7adae9762
18 changed files with 202 additions and 65 deletions

View File

@@ -14,9 +14,9 @@ use Nette\Utils\Random;
class PreApplicationController extends Controller class PreApplicationController extends Controller
{ {
public function send(Request $request){ public function send(Request $request){
$event = $request->input('event'); $event = $request->input('district_region');
$ce = ChaosEvents::where('id', $event)->where('to_date', '>=', now())->first(); $ce = ChaosEvents::where('id', $event)->where('to_date_internal', '>=', today())->where('from_date_internal', '<=', today())->first();
if($ce){ if($ce){
$passport_type = $request->input('passport_type'); $passport_type = $request->input('passport_type');

View File

@@ -8,11 +8,22 @@ class ChaosEvents extends Model
{ {
protected $table = 'chaos_events'; protected $table = 'chaos_events';
protected function casts(): array
{
return [
'from_date_internal' => 'date',
'to_date_internal' => 'date',
'from_date_visible' => 'date',
'to_date_visible' => 'date',
];
}
public function preApplications() { public function preApplications() {
return $this->hasMany('App\Models\PreApplications', 'event_id'); return $this->hasMany('App\Models\PreApplications', 'event_id');
} }
public static function getActiveEvents(){ public static function getActiveEvents(){
return self::where('to_date', '>=', now())->where('from_date', '<=', now())->get(); return self::where('to_date_internal', '>=', today())
->where('from_date_internal', '<=', today())->get();
} }
} }

View File

@@ -15,8 +15,10 @@ return new class extends Migration
$table->id(); $table->id();
$table->string('name'); $table->string('name');
$table->string('shortname'); $table->string('shortname');
$table->date('from_date'); $table->date('from_date_internal');
$table->date('to_date'); $table->date('to_date_internal');
$table->date('from_date_visible');
$table->date('to_date_visible');
$table->boolean('active')->default(false); $table->boolean('active')->default(false);
$table->timestamps(); $table->timestamps();
}); });

View File

@@ -68,10 +68,11 @@ return [
], ],
'preapplication' => [ 'preapplication' => [
'title' => 'Vorantrag auf Reisepass gem. § 5 C3GovVerwV', '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. '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.', <br />Nachdem Sie den Vorantrag abgeschickt haben, erhalten Sie eine Bestätigung via elektronischer Post.',
'noevent' => 'Es sind derzeit keine temporäre Bezirksregionen verfügbar.', 'noevent' => 'Es sind derzeit keine (temporären) Bezirksregionen verfügbar.',
'passport_type' => 'Pass-Typ', 'region' => 'Bezirksregion',
'passport_type' => 'Reisepass-Typ',
'passport' => [ 'passport' => [
'standard' => 'Hacker*innen-Reisepass', 'standard' => 'Hacker*innen-Reisepass',
'kid' => 'Junghackerpass', 'kid' => 'Junghackerpass',
@@ -81,5 +82,22 @@ return [
'lastname' => 'Nachname (optional)', 'lastname' => 'Nachname (optional)',
'location' => 'Hackspace / Ort (optional)', 'location' => 'Hackspace / Ort (optional)',
'apply' => 'Vorantrag abschicken' 'apply' => 'Vorantrag abschicken'
] ],
'common' => [
'error_occurred' => 'Es ist ein Fehler geschehen: ',
'not_permitted' => 'Sie sind nicht berechtigt diese Funktion zu nutzen.',
],
'login' => [
'password_mismatch' => 'Ihr Kennwort stimmt nicht überein.',
'registration_success' => 'Sie wurden erfolgreich registriert.',
'login_success' => 'Sie wurden erfolgreich angemeldet.',
],
'blog' => [
'confirm_save' => 'Eintrag wirklich speichern?',
'confirm_delete' => 'Eintrag wirklich löschen?',
],
'ticker' => [
'delete_success' => 'Löschen erfolgreich!',
'insert_success' => 'Einfügen erfolgreich!',
],
]; ];

View File

@@ -68,9 +68,10 @@ return [
], ],
'preapplication' => [ 'preapplication' => [
'title' => 'Pre-application for Passport according to § 5 C3GovVerwV', 'title' => 'Pre-application for Passport according to § 5 C3GovVerwV',
'content' => 'Please select a temporary district region to submit your pre-application for a passport. '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.', <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' => 'There are currently no (temporary) district regions available.',
'region' => 'District region',
'passport_type' => 'Passport type', 'passport_type' => 'Passport type',
'passport' => [ 'passport' => [
'standard' => 'Hacker Passport', 'standard' => 'Hacker Passport',
@@ -81,5 +82,22 @@ return [
'lastname' => 'Last name (optional)', 'lastname' => 'Last name (optional)',
'location' => 'Hackspace / Location (optional)', 'location' => 'Hackspace / Location (optional)',
'apply' => 'Submit pre-application' 'apply' => 'Submit pre-application'
] ],
'common' => [
'error_occurred' => 'An error occurred: ',
'not_permitted' => 'You are not authorized to use this function.',
],
'login' => [
'password_mismatch' => 'Your password does not match.',
'registration_success' => 'You have been successfully registered.',
'login_success' => 'You have been successfully logged in.',
],
'blog' => [
'confirm_save' => 'Do you really want to save this entry?',
'confirm_delete' => 'Do you really want to delete this entry?',
],
'ticker' => [
'delete_success' => 'Deleted successfully!',
'insert_success' => 'Inserted successfully!',
],
]; ];

View File

@@ -16,8 +16,3 @@
.blogEdit textarea { .blogEdit textarea {
font-size: 1.2em; font-size: 1.2em;
} }
.blogEdit select {
font-size: 1em;
padding: 0.5em;
}

View File

@@ -9,6 +9,12 @@ html, body {
overflow-x: hidden; overflow-x: hidden;
} }
select {
font-size: 1em;
padding: 0.5em;
}
*, *:before, *:after { *, *:before, *:after {
box-sizing: inherit; box-sizing: inherit;
} }
@@ -176,6 +182,7 @@ html, body {
} }
.eingabemaske input { .eingabemaske input {
font-size: 1em;
padding: 0.5em; padding: 0.5em;
max-width: 100%; max-width: 100%;
} }

View File

@@ -17,7 +17,7 @@ function addBlog(){
console.log(b); console.log(b);
if(window.confirm('Eintrag wirklich speichern?')){ if(window.confirm(i18n.blog.confirm_save)){
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "/intern/nachrichten/add", url: "/intern/nachrichten/add",
@@ -34,7 +34,7 @@ function addBlog(){
} }
}, },
error:function(r, a, e){ error:function(r, a, e){
alert(e); alert(i18n.common.error_occurred + e);
} }
}); });
} }
@@ -48,7 +48,7 @@ function editBlog(blogId){
b.published = $('#blogPublished_'+blogId).is(":checked") ? "1" : "0"; b.published = $('#blogPublished_'+blogId).is(":checked") ? "1" : "0";
b.language = $('#blogLanguage_'+blogId).val(); b.language = $('#blogLanguage_'+blogId).val();
if(window.confirm('Eintrag wirklich speichern?')){ if(window.confirm(i18n.blog.confirm_save)){
$.ajax({ $.ajax({
type: "PUT", type: "PUT",
url: "/intern/nachrichten/edit", url: "/intern/nachrichten/edit",
@@ -62,7 +62,7 @@ function editBlog(blogId){
} }
}, },
error:function(r, a, e){ error:function(r, a, e){
alert(e); alert(i18n.common.error_occurred + e);
} }
}); });
} }
@@ -72,7 +72,7 @@ function deleteBlog(blogId){
let b = {}; let b = {};
b.id = blogId; b.id = blogId;
if(window.confirm('Eintrag wirklich löschen?')){ if(window.confirm(i18n.blog.confirm_delete)){
$.ajax({ $.ajax({
type:"DELETE", type:"DELETE",
url:"/intern/nachrichten/delete", url:"/intern/nachrichten/delete",
@@ -89,7 +89,7 @@ function deleteBlog(blogId){
} }
}, },
error:function(r, a, e){ error:function(r, a, e){
alert(e); alert(i18n.common.error_occurred + e);
} }
}) })
} }

View File

@@ -11,19 +11,19 @@ function login(){
success: function(d){ success: function(d){
switch(d.messageStatus){ switch(d.messageStatus){
case "success": case "success":
setzeFehlermeldung("success", "Sie wurden erfolgreich angemeldet."); setzeFehlermeldung("success", i18n.login.login_success);
location.reload(); location.reload();
break; break;
case "failure": case "failure":
setzeFehlermeldung("failure", "Es ist ein Fehler geschehen: " + d.errorMessage); setzeFehlermeldung("failure", i18n.common.error_occurred + d.errorMessage);
break; break;
case "not permitted": case "not permitted":
setzeFehlermeldung("failure", "Sie sind nicht berechtigt diese Funktion zu nutzen."); setzeFehlermeldung("failure", i18n.common.not_permitted);
break; break;
} }
}, },
error: function(d, status, errorThrown) { error: function(d, status, errorThrown) {
setzeFehlermeldung("failure", "Es ist ein Fehler geschehen: " + errorThrown); setzeFehlermeldung("failure", i18n.common.error_occurred + errorThrown);
} }
}); });

View File

@@ -7,9 +7,9 @@ function abschicken(){
if(data.password !== $("#password_repeat").val()) { if(data.password !== $("#password_repeat").val()) {
setzeFehlermeldung("failure", "Ihr Kennwort stimmt nicht überein."); setzeFehlermeldung("failure", i18n.login.password_mismatch);
for(let i=0; i<Math.random() * 10; i++){ for(let i=0; i<Math.random() * 10; i++){
alert("Ihr Kennwort stimmt nicht überein."); alert(i18n.login.password_mismatch);
} }
} else { } else {
@@ -21,18 +21,18 @@ function abschicken(){
success: function(d){ success: function(d){
switch(d.messageStatus){ switch(d.messageStatus){
case "success": case "success":
setzeFehlermeldung("success", "Sie wurden erfolgreich registriert.") setzeFehlermeldung("success", i18n.login.registration_success)
break; break;
case "failure": case "failure":
setzeFehlermeldung("failure", "Es ist ein Fehler geschehen: " + d.errorMessage); setzeFehlermeldung("failure", i18n.common.error_occurred + d.errorMessage);
break; break;
case "not permitted": case "not permitted":
setzeFehlermeldung("failure", "Sie sind nicht berechtigt diese Funktion zu nutzen."); setzeFehlermeldung("failure", i18n.common.not_permitted);
break; break;
} }
}, },
error: function(d, status, errorThrown) { error: function(d, status, errorThrown) {
setzeFehlermeldung("failure", "Es ist ein Fehler geschehen: " + errorThrown); setzeFehlermeldung("failure", i18n.common.error_occurred + errorThrown);
} }
}); });
} }

View File

@@ -5,12 +5,36 @@ $(function() {
$(this).val(selectedValue); $(this).val(selectedValue);
} }
}); });
function updateMaxlengths() {
const passportType = $('#passport_type').val();
let maxLength;
switch (passportType) {
case 'd':
maxLength = 17;
break;
case 'k':
maxLength = 25;
break;
default:
maxLength = 17;
}
$('#firstname, #lastname, #location').attr('maxlength', maxLength);
}
updateMaxlengths();
$('#passport_type, #district_region').on('change', function() {
updateMaxlengths();
});
}); });
function vorantragAbschicken(){ function vorantragAbschicken(){
let data = {}; let data = {};
data.event = $('#eventSelect').val(); data.district_region = $('#district_region').val();
data.passport_type = $('#passport_type').val(); data.passport_type = $('#passport_type').val();
data.mail = $('#mail').val(); data.mail = $('#mail').val();
data.first_name = $('#firstname').val(); data.first_name = $('#firstname').val();
@@ -36,7 +60,7 @@ function vorantragAbschicken(){
} }
}, },
error:function(r, a, e){ error:function(r, a, e){
alert(e); alert(i18n.common.error_occurred + e);
} }
}); });

View File

@@ -14,7 +14,7 @@ function remove(lang){
success: function (d) { success: function (d) {
switch(d.messageStatus){ switch(d.messageStatus){
case "success": case "success":
setzeFehlermeldung(d.messageStatus, "Löschen erfolgreich!"); setzeFehlermeldung(d.messageStatus, i18n.ticker.delete_success);
location.reload(); location.reload();
break; break;
case "failure": case "failure":
@@ -23,7 +23,7 @@ function remove(lang){
} }
}, },
error: function (d, status, error) { error: function (d, status, error) {
setzeFehlermeldung("failure", error); setzeFehlermeldung("failure", i18n.common.error_occurred + error);
} }
}); });
} }
@@ -42,7 +42,7 @@ function insert(lang){
success: function (d) { success: function (d) {
switch(d.messageStatus){ switch(d.messageStatus){
case "success": case "success":
setzeFehlermeldung(d.messageStatus, "Einfügen erfolgreich!"); setzeFehlermeldung(d.messageStatus, i18n.ticker.insert_success);
location.reload(); location.reload();
break; break;
case "failure": case "failure":
@@ -51,7 +51,7 @@ function insert(lang){
} }
}, },
error: function (d, status, error) { error: function (d, status, error) {
setzeFehlermeldung("failure", error); setzeFehlermeldung("failure", i18n.common.error_occurred + error);
} }
}); });
} }

View File

@@ -1,6 +1,13 @@
@php use App\Models\ChaosEvents; @endphp @php use App\Models\ChaosEvents; @endphp
@extends('layout.app') @extends('layout.app')
@section('scripts') @section('scripts')
<script>
const i18n = {
common: {
error_occurred: "{{ __('app.common.error_occurred') }}"
}
};
</script>
<script src="{{ asset('/js/preapplication/preapplication.js') }}"></script> <script src="{{ asset('/js/preapplication/preapplication.js') }}"></script>
@endsection @endsection
@@ -11,32 +18,42 @@
@forelse (ChaosEvents::getActiveEvents() as $event) @forelse (ChaosEvents::getActiveEvents() as $event)
<div class="eingabemaske"> <div class="eingabemaske">
<select name="event" id="eventSelect"> <table class="eingabetabelle">
<option value="{{ $event->id }}">{{ $event->name }}</option> <tr>
</select> <td>{{ __('app.preapplication.region') }}:</td>
<br/> <td><select name="district_region" id="district_region">
<option value="{{ $event->id }}">{{ $event->name }} ({{ $event->from_date_visible->format('Y-m-d') }} - {{ $event->to_date_visible->format('Y-m-d') }})</option>
<label for="passport_type">{{ __('app.preapplication.passport_type') }}</label> </select></td>
<select name="passport_type" id="passport_type"> </tr>
<option value="d">{{ __('app.preapplication.passport.standard') }}</option> <tr>
<option value="k">{{ __('app.preapplication.passport.kid') }}</option> <td>{{ __('app.preapplication.passport_type') }}:</td>
</select> <td>
<br/> <select name="passport_type" id="passport_type">
<option value="d">{{ __('app.preapplication.passport.standard') }}</option>
<label for="mail">{{ __('app.preapplication.mail') }}:</label> <option value="k">{{ __('app.preapplication.passport.kid') }}</option>
<input type="text" id="mail" name="mail" placeholder="{{ __('app.preapplication.mail') }}" required> </select>
<br/> </td>
<label for="firstname">{{ __('app.preapplication.firstname') }}:</label> </tr>
<input type="text" id="firstname" name="firstname" placeholder="{{ __('app.preapplication.firstname') }}" <tr>
required> <td>{{ __('app.preapplication.mail') }}:</td>
<br/> <td><input type="text" id="mail" name="mail" placeholder="{{ __('app.preapplication.mail') }}" required></td>
<label for="lastname">{{ __('app.preapplication.lastname') }}:</label> </tr>
<input type="text" id="lastname" name="lastname" placeholder="{{ __('app.preapplication.lastname') }}"> <tr>
<br/> <td>{{ __('app.preapplication.firstname') }}:</td>
<label for="location">{{ __('app.preapplication.location') }}:</label> <td><input type="text" id="firstname" name="firstname" placeholder="{{ __('app.preapplication.firstname') }}" required></td>
<input type="text" id="location" name="location" placeholder="{{ __('app.preapplication.location') }}"> </tr>
<br /><br /> <tr>
<td>{{ __('app.preapplication.lastname') }}:</td>
<td><input type="text" id="lastname" name="lastname" placeholder="{{ __('app.preapplication.lastname') }}" required></td>
</tr>
<tr>
<td>{{ __('app.preapplication.location') }}:</td>
<td><input type="text" id="location" name="location" placeholder="{{ __('app.preapplication.location') }}" required></td>
</tr>
</table>
<br />
<button id="apply" onclick="vorantragAbschicken()">{{ __('app.preapplication.apply') }}</button> <button id="apply" onclick="vorantragAbschicken()">{{ __('app.preapplication.apply') }}</button>
</div> </div>
@empty @empty

View File

@@ -1,5 +1,16 @@
@extends('layout.app') @extends('layout.app')
@section('scripts') @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>
<link rel="stylesheet" href="{{ asset("css/blog/edit.css") . "?rnd=" . rand(0, 1000000000) }}"> <link rel="stylesheet" href="{{ asset("css/blog/edit.css") . "?rnd=" . rand(0, 1000000000) }}">
<script src="{{ asset('/js/blog/blog.js') }}"></script> <script src="{{ asset('/js/blog/blog.js') }}"></script>
@endsection @endsection

View File

@@ -51,7 +51,7 @@
@endauth @endauth
</ul> </ul>
<br /><br /><br /><br /> <br />
<a href="https://chaos.social/@c3gov" rel="me"><img src="{{ asset("Bilder/fedicsgovnetscape.png") }}" <a href="https://chaos.social/@c3gov" rel="me"><img src="{{ asset("Bilder/fedicsgovnetscape.png") }}"
onmouseover="{ this.src = '{{ asset("Bilder/fedicsgovnetscapepress.png") }}' }" onmouseover="{ this.src = '{{ asset("Bilder/fedicsgovnetscapepress.png") }}' }"
onmouseout="{ this.src = '{{ asset("Bilder/fedicsgovnetscape.png") }}' }" alt="C3Gov on Fediverse"></a> onmouseout="{ this.src = '{{ asset("Bilder/fedicsgovnetscape.png") }}' }" alt="C3Gov on Fediverse"></a>

View File

@@ -1,5 +1,16 @@
@extends('layout.app') @extends('layout.app')
@section('scripts') @section('scripts')
<script>
const i18n = {
common: {
error_occurred: "{{ __('app.common.error_occurred') }}",
not_permitted: "{{ __('app.common.not_permitted') }}"
},
login: {
login_success: "{{ __('app.login.login_success') }}"
}
};
</script>
<script src="{{ asset("js/intern.js") }}"></script> <script src="{{ asset("js/intern.js") }}"></script>
<script src="{{ asset("js/login/login.js") }}"></script> <script src="{{ asset("js/login/login.js") }}"></script>
@endsection @endsection

View File

@@ -1,5 +1,17 @@
@extends('layout.app') @extends('layout.app')
@section('scripts') @section('scripts')
<script>
const i18n = {
common: {
error_occurred: "{{ __('app.common.error_occurred') }}",
not_permitted: "{{ __('app.common.not_permitted') }}"
},
login: {
password_mismatch: "{{ __('app.login.password_mismatch') }}",
registration_success: "{{ __('app.login.registration_success') }}"
}
};
</script>
<script src="{{ asset("js/intern.js") }}"></script> <script src="{{ asset("js/intern.js") }}"></script>
<script src="{{ asset("js/login/registrieren.js") }}"></script> <script src="{{ asset("js/login/registrieren.js") }}"></script>
@endsection @endsection

View File

@@ -1,6 +1,17 @@
@php use App\Models\TickerMessages; @endphp @php use App\Models\TickerMessages; @endphp
@extends('layout.app') @extends('layout.app')
@section('scripts') @section('scripts')
<script>
const i18n = {
common: {
error_occurred: "{{ __('app.common.error_occurred') }}"
},
ticker: {
delete_success: "{{ __('app.ticker.delete_success') }}",
insert_success: "{{ __('app.ticker.insert_success') }}"
}
};
</script>
<link rel="stylesheet" href="{{ asset("css/ticker/ticker.css") }}"> <link rel="stylesheet" href="{{ asset("css/ticker/ticker.css") }}">
<script src="{{ asset("js/intern.js") }}"></script> <script src="{{ asset("js/intern.js") }}"></script>
<script src="{{ asset("js/ticker/edit.js") }}"></script> <script src="{{ asset("js/ticker/edit.js") }}"></script>