Verbesserungen i80n, Bugfixes, uvm
This commit is contained in:
@@ -14,9 +14,9 @@ use Nette\Utils\Random;
|
||||
class PreApplicationController extends Controller
|
||||
{
|
||||
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){
|
||||
|
||||
$passport_type = $request->input('passport_type');
|
||||
|
||||
@@ -8,11 +8,22 @@ class ChaosEvents extends Model
|
||||
{
|
||||
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() {
|
||||
return $this->hasMany('App\Models\PreApplications', 'event_id');
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,10 @@ return new class extends Migration
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('shortname');
|
||||
$table->date('from_date');
|
||||
$table->date('to_date');
|
||||
$table->date('from_date_internal');
|
||||
$table->date('to_date_internal');
|
||||
$table->date('from_date_visible');
|
||||
$table->date('to_date_visible');
|
||||
$table->boolean('active')->default(false);
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
@@ -68,10 +68,11 @@ return [
|
||||
],
|
||||
'preapplication' => [
|
||||
'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.',
|
||||
'noevent' => 'Es sind derzeit keine temporäre Bezirksregionen verfügbar.',
|
||||
'passport_type' => 'Pass-Typ',
|
||||
'noevent' => 'Es sind derzeit keine (temporären) Bezirksregionen verfügbar.',
|
||||
'region' => 'Bezirksregion',
|
||||
'passport_type' => 'Reisepass-Typ',
|
||||
'passport' => [
|
||||
'standard' => 'Hacker*innen-Reisepass',
|
||||
'kid' => 'Junghackerpass',
|
||||
@@ -81,5 +82,22 @@ return [
|
||||
'lastname' => 'Nachname (optional)',
|
||||
'location' => 'Hackspace / Ort (optional)',
|
||||
'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!',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -68,9 +68,10 @@ return [
|
||||
],
|
||||
'preapplication' => [
|
||||
'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.',
|
||||
'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' => [
|
||||
'standard' => 'Hacker Passport',
|
||||
@@ -81,5 +82,22 @@ return [
|
||||
'lastname' => 'Last name (optional)',
|
||||
'location' => 'Hackspace / Location (optional)',
|
||||
'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!',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -16,8 +16,3 @@
|
||||
.blogEdit textarea {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.blogEdit select {
|
||||
font-size: 1em;
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,12 @@ html, body {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
select {
|
||||
font-size: 1em;
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
|
||||
*, *:before, *:after {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
@@ -176,6 +182,7 @@ html, body {
|
||||
}
|
||||
|
||||
.eingabemaske input {
|
||||
font-size: 1em;
|
||||
padding: 0.5em;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ function addBlog(){
|
||||
|
||||
console.log(b);
|
||||
|
||||
if(window.confirm('Eintrag wirklich speichern?')){
|
||||
if(window.confirm(i18n.blog.confirm_save)){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/intern/nachrichten/add",
|
||||
@@ -34,7 +34,7 @@ function addBlog(){
|
||||
}
|
||||
},
|
||||
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.language = $('#blogLanguage_'+blogId).val();
|
||||
|
||||
if(window.confirm('Eintrag wirklich speichern?')){
|
||||
if(window.confirm(i18n.blog.confirm_save)){
|
||||
$.ajax({
|
||||
type: "PUT",
|
||||
url: "/intern/nachrichten/edit",
|
||||
@@ -62,7 +62,7 @@ function editBlog(blogId){
|
||||
}
|
||||
},
|
||||
error:function(r, a, e){
|
||||
alert(e);
|
||||
alert(i18n.common.error_occurred + e);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -72,7 +72,7 @@ function deleteBlog(blogId){
|
||||
let b = {};
|
||||
b.id = blogId;
|
||||
|
||||
if(window.confirm('Eintrag wirklich löschen?')){
|
||||
if(window.confirm(i18n.blog.confirm_delete)){
|
||||
$.ajax({
|
||||
type:"DELETE",
|
||||
url:"/intern/nachrichten/delete",
|
||||
@@ -89,7 +89,7 @@ function deleteBlog(blogId){
|
||||
}
|
||||
},
|
||||
error:function(r, a, e){
|
||||
alert(e);
|
||||
alert(i18n.common.error_occurred + e);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -11,19 +11,19 @@ function login(){
|
||||
success: function(d){
|
||||
switch(d.messageStatus){
|
||||
case "success":
|
||||
setzeFehlermeldung("success", "Sie wurden erfolgreich angemeldet.");
|
||||
setzeFehlermeldung("success", i18n.login.login_success);
|
||||
location.reload();
|
||||
break;
|
||||
case "failure":
|
||||
setzeFehlermeldung("failure", "Es ist ein Fehler geschehen: " + d.errorMessage);
|
||||
setzeFehlermeldung("failure", i18n.common.error_occurred + d.errorMessage);
|
||||
break;
|
||||
case "not permitted":
|
||||
setzeFehlermeldung("failure", "Sie sind nicht berechtigt diese Funktion zu nutzen.");
|
||||
setzeFehlermeldung("failure", i18n.common.not_permitted);
|
||||
break;
|
||||
}
|
||||
},
|
||||
error: function(d, status, errorThrown) {
|
||||
setzeFehlermeldung("failure", "Es ist ein Fehler geschehen: " + errorThrown);
|
||||
setzeFehlermeldung("failure", i18n.common.error_occurred + errorThrown);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@ function abschicken(){
|
||||
|
||||
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++){
|
||||
alert("Ihr Kennwort stimmt nicht überein.");
|
||||
alert(i18n.login.password_mismatch);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -21,18 +21,18 @@ function abschicken(){
|
||||
success: function(d){
|
||||
switch(d.messageStatus){
|
||||
case "success":
|
||||
setzeFehlermeldung("success", "Sie wurden erfolgreich registriert.")
|
||||
setzeFehlermeldung("success", i18n.login.registration_success)
|
||||
break;
|
||||
case "failure":
|
||||
setzeFehlermeldung("failure", "Es ist ein Fehler geschehen: " + d.errorMessage);
|
||||
setzeFehlermeldung("failure", i18n.common.error_occurred + d.errorMessage);
|
||||
break;
|
||||
case "not permitted":
|
||||
setzeFehlermeldung("failure", "Sie sind nicht berechtigt diese Funktion zu nutzen.");
|
||||
setzeFehlermeldung("failure", i18n.common.not_permitted);
|
||||
break;
|
||||
}
|
||||
},
|
||||
error: function(d, status, errorThrown) {
|
||||
setzeFehlermeldung("failure", "Es ist ein Fehler geschehen: " + errorThrown);
|
||||
setzeFehlermeldung("failure", i18n.common.error_occurred + errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5,12 +5,36 @@ $(function() {
|
||||
$(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(){
|
||||
|
||||
let data = {};
|
||||
data.event = $('#eventSelect').val();
|
||||
data.district_region = $('#district_region').val();
|
||||
data.passport_type = $('#passport_type').val();
|
||||
data.mail = $('#mail').val();
|
||||
data.first_name = $('#firstname').val();
|
||||
@@ -36,7 +60,7 @@ function vorantragAbschicken(){
|
||||
}
|
||||
},
|
||||
error:function(r, a, e){
|
||||
alert(e);
|
||||
alert(i18n.common.error_occurred + e);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ function remove(lang){
|
||||
success: function (d) {
|
||||
switch(d.messageStatus){
|
||||
case "success":
|
||||
setzeFehlermeldung(d.messageStatus, "Löschen erfolgreich!");
|
||||
setzeFehlermeldung(d.messageStatus, i18n.ticker.delete_success);
|
||||
location.reload();
|
||||
break;
|
||||
case "failure":
|
||||
@@ -23,7 +23,7 @@ function remove(lang){
|
||||
}
|
||||
},
|
||||
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) {
|
||||
switch(d.messageStatus){
|
||||
case "success":
|
||||
setzeFehlermeldung(d.messageStatus, "Einfügen erfolgreich!");
|
||||
setzeFehlermeldung(d.messageStatus, i18n.ticker.insert_success);
|
||||
location.reload();
|
||||
break;
|
||||
case "failure":
|
||||
@@ -51,7 +51,7 @@ function insert(lang){
|
||||
}
|
||||
},
|
||||
error: function (d, status, error) {
|
||||
setzeFehlermeldung("failure", error);
|
||||
setzeFehlermeldung("failure", i18n.common.error_occurred + error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
@php use App\Models\ChaosEvents; @endphp
|
||||
@extends('layout.app')
|
||||
@section('scripts')
|
||||
<script>
|
||||
const i18n = {
|
||||
common: {
|
||||
error_occurred: "{{ __('app.common.error_occurred') }}"
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="{{ asset('/js/preapplication/preapplication.js') }}"></script>
|
||||
@endsection
|
||||
|
||||
@@ -11,32 +18,42 @@
|
||||
|
||||
@forelse (ChaosEvents::getActiveEvents() as $event)
|
||||
<div class="eingabemaske">
|
||||
<select name="event" id="eventSelect">
|
||||
<option value="{{ $event->id }}">{{ $event->name }}</option>
|
||||
</select>
|
||||
<br/>
|
||||
|
||||
<label for="passport_type">{{ __('app.preapplication.passport_type') }}</label>
|
||||
<select name="passport_type" id="passport_type">
|
||||
<option value="d">{{ __('app.preapplication.passport.standard') }}</option>
|
||||
<option value="k">{{ __('app.preapplication.passport.kid') }}</option>
|
||||
</select>
|
||||
<br/>
|
||||
|
||||
<label for="mail">{{ __('app.preapplication.mail') }}:</label>
|
||||
<input type="text" id="mail" name="mail" placeholder="{{ __('app.preapplication.mail') }}" required>
|
||||
<br/>
|
||||
<label for="firstname">{{ __('app.preapplication.firstname') }}:</label>
|
||||
<input type="text" id="firstname" name="firstname" placeholder="{{ __('app.preapplication.firstname') }}"
|
||||
required>
|
||||
<br/>
|
||||
<label for="lastname">{{ __('app.preapplication.lastname') }}:</label>
|
||||
<input type="text" id="lastname" name="lastname" placeholder="{{ __('app.preapplication.lastname') }}">
|
||||
<br/>
|
||||
<label for="location">{{ __('app.preapplication.location') }}:</label>
|
||||
<input type="text" id="location" name="location" placeholder="{{ __('app.preapplication.location') }}">
|
||||
<br /><br />
|
||||
<table class="eingabetabelle">
|
||||
<tr>
|
||||
<td>{{ __('app.preapplication.region') }}:</td>
|
||||
<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>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ __('app.preapplication.passport_type') }}:</td>
|
||||
<td>
|
||||
<select name="passport_type" id="passport_type">
|
||||
<option value="d">{{ __('app.preapplication.passport.standard') }}</option>
|
||||
<option value="k">{{ __('app.preapplication.passport.kid') }}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ __('app.preapplication.mail') }}:</td>
|
||||
<td><input type="text" id="mail" name="mail" placeholder="{{ __('app.preapplication.mail') }}" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ __('app.preapplication.firstname') }}:</td>
|
||||
<td><input type="text" id="firstname" name="firstname" placeholder="{{ __('app.preapplication.firstname') }}" required></td>
|
||||
</tr>
|
||||
<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>
|
||||
|
||||
</div>
|
||||
|
||||
@empty
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
@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>
|
||||
<link rel="stylesheet" href="{{ asset("css/blog/edit.css") . "?rnd=" . rand(0, 1000000000) }}">
|
||||
<script src="{{ asset('/js/blog/blog.js') }}"></script>
|
||||
@endsection
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
@endauth
|
||||
</ul>
|
||||
<br /><br /><br /><br />
|
||||
<br />
|
||||
<a href="https://chaos.social/@c3gov" rel="me"><img src="{{ asset("Bilder/fedicsgovnetscape.png") }}"
|
||||
onmouseover="{ this.src = '{{ asset("Bilder/fedicsgovnetscapepress.png") }}' }"
|
||||
onmouseout="{ this.src = '{{ asset("Bilder/fedicsgovnetscape.png") }}' }" alt="C3Gov on Fediverse"></a>
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
@extends('layout.app')
|
||||
@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/login/login.js") }}"></script>
|
||||
@endsection
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
@extends('layout.app')
|
||||
@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/login/registrieren.js") }}"></script>
|
||||
@endsection
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
@php use App\Models\TickerMessages; @endphp
|
||||
@extends('layout.app')
|
||||
@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") }}">
|
||||
<script src="{{ asset("js/intern.js") }}"></script>
|
||||
<script src="{{ asset("js/ticker/edit.js") }}"></script>
|
||||
|
||||
Reference in New Issue
Block a user