Skip to content

Commit

Permalink
Merge branch 'develop' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKrisKrisu committed Jan 6, 2022
2 parents 1dbf70d + eec96ec commit f3fdd5d
Show file tree
Hide file tree
Showing 18 changed files with 99 additions and 104 deletions.
8 changes: 5 additions & 3 deletions app/Console/Commands/RefreshCurrentTrips.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@ class RefreshCurrentTrips extends Command
protected $description = 'Refresh delay data from current active trips';

public function handle(): int {

$qStops = TrainStopover::where('arrival_planned', '<=', Carbon::now()->addHours(2)->toIso8601String())
->where(function($query) {
$query->where('arrival_planned', '>=', Carbon::now()->toIso8601String())
->orWhere('arrival_real', '>=', Carbon::now()->toIso8601String());
})
->select('trip_id')
->distinct();
$trips = HafasTrip::whereIn('trip_id', $qStops)->get();

if ($trips->count() == 0) {
$trips = HafasTrip::whereIn('trip_id', $qStops)
->where('created_at', Carbon::now()->subDays(2)->toIso8601String())
->get();

if ($trips->count() === 0) {
echo "There are currently no trips to refresh.\r\n";
return 0;
}
Expand Down
8 changes: 4 additions & 4 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ class Kernel extends ConsoleKernel
* @return void
*/
protected function schedule(Schedule $schedule): void {
$schedule->command('trwl:cleanUpUsers')->dailyAt("1:30");
$schedule->command('trwl:cleanUpHafasTrips')->dailyAt("1:35");
$schedule->command('trwl:cleanUpPolylines')->dailyAt("1:40");
$schedule->command('trwl:cleanUpUsers')->dailyAt('1:30');
$schedule->command('trwl:cleanUpHafasTrips')->dailyAt('1:35');
$schedule->command('trwl:cleanUpPolylines')->dailyAt('1:40');
$schedule->command('trwl:cleanUpPasswordResets')->dailyAt('1:45');
$schedule->command('trwl:refreshTrips')->withoutOverlapping()->everyMinute();
$schedule->command('trwl:refreshTrips')->withoutOverlapping()->everyTwoMinutes();
}

/**
Expand Down
19 changes: 0 additions & 19 deletions app/Http/Controllers/ChristmasController.php

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

/**
* This index is useful to improve the select query in trwl:refreshTrips command.
*/
class AddIndexToTrainStopovers extends Migration
{
public function up(): void {
Schema::table('train_stopovers', static function(Blueprint $table) {
$table->index(['arrival_planned', 'arrival_real']);
});
}

public function down(): void {
Schema::table('train_stopovers', static function(Blueprint $table) {
$table->dropIndex(['arrival_planned', 'arrival_real']);
});
}
}
23 changes: 23 additions & 0 deletions database/migrations/2022_01_06_230418_add_index_to_hafas_trips.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

/**
* This index is useful to improve the select query in trwl:refreshTrips command.
*/
class AddIndexToHafasTrips extends Migration
{
public function up(): void {
Schema::table('hafas_trips', static function(Blueprint $table) {
$table->index(['created_at', 'trip_id']);
});
}

public function down(): void {
Schema::table('hafas_trips', static function(Blueprint $table) {
$table->dropIndex(['created_at', 'trip_id']);
});
}
}
11 changes: 0 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"moment": "^2.29.1",
"momentjs": "^2.0.0",
"notyf": "^3.10.0",
"snowfall.js": "^1.0.2",
"vue-apexcharts": "^1.6.2",
"vue-axios": "^3.2.4",
"vue-i18n": "^8.24.4",
Expand Down
Binary file modified public/img/user.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/user_christmas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 0 additions & 9 deletions resources/js/snow.js

This file was deleted.

7 changes: 5 additions & 2 deletions resources/lang/de_by.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"about.points1": "Dia Punkte setzt sich us dr Produktklassn und dr Entfernung diner Reisen zamme.",
"controller.status.create-success": "Status erstellt.",
"controller.status.delete-ok": "Status glöscht.",
"controller.status.email-resend-mail": "Bestätigung nomal verschicka.",
"controller.status.email-resend-mail": "Bestätigungslink schicka",
"controller.status.export-invalid-dates": "Des sand koane richtige Data.",
"controller.status.export-neither-business": "Du kahsch id Privat und Business-Trips gleichzeitig abwähla.",
"controller.status.like-deleted": "Like isch glöscht wora.",
Expand Down Expand Up @@ -437,5 +437,8 @@
"settings.notconnected": "Id verbunda",
"description.profile": ":username isch schu :kmAmount Killomettr in :hourAmount Schdunda in öffatliche Verkeahrsmittl unterweags gweah.",
"settings.create-ics-token-success": "Dia Kalendrfreigabn isch erschdelld wora. Du kasch folgnda Link in an Kalendr eibinda, ders ICS-Format unterschtütza duat: <a href=\":link\">:link</a>",
"stationboard.arr": "an"
"stationboard.arr": "an",
"email.change": "Dua dei E-Mail-Adressn aktualisiera, indemd dia nuie Adress und dei aktuells Passwort eigibsch. Dir werd dann a Bschdädigungsmail zuagschickt, mit der'd dia Ändrung bschdädiga kahsch.",
"email.validation": "E-Mail-Adressn bschdädiga",
"welcome": "Griaß di bei Träwelling!"
}
5 changes: 3 additions & 2 deletions resources/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
"profile.statistics-for": "Statistics for",
"profile.unfollow": "Unfollow",
"profile.private-profile-text": "This profile is private.",
"profile.private-profile-information-text": "Only approved followers can see the check-ins of @:username. To request access, click \":request\".",
"profile.private-profile-information-text": "Only approved followers can see the check-ins of @:username. To request access, click on Request.",
"search-results": "Search results",
"settings.tab.account": "Account",
"settings.tab.profile": "Profile & Privacy",
Expand Down Expand Up @@ -497,5 +497,6 @@
"christmas-mode": "Christmas mode",
"christmas-mode.enable": "Enable Christmas mode for this session",
"christmas-mode.disable": "Disable Christmas mode for this session",
"merry-christmas": "We wish you a Merry Christmas!"
"merry-christmas": "We wish you a Merry Christmas!",
"user.email.not-set": "There is no email address saved yet"
}
30 changes: 26 additions & 4 deletions resources/lang/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@
"controller.transport.no-name-given": "Je moet een stationsnaam invullen!",
"controller.transport.not-in-stopovers": "De start-id is niet in de tussenstops.",
"controller.transport.also-in-connection": "Ook bij deze verbinding zijn:",
"controller.status.email-resend-mail": "Bevestiging opnieuw verzenden.",
"controller.status.email-resend-mail": "Bevestiging opnieuw verzenden",
"controller.transport.checkin-heading": "Ingecheckt",
"controller.transport.checkin-ok": "Je heb sucessvol in :lineName ingecheckd!|Je heb sucessvol in lijn :lineName ingecheckd!",
"controller.transport.overlapping-checkin": "Je hebt al een check in bij verbindung :linename: ",
"controller.transport.overlapping-checkin": "Je hebt al een check in bij verbindung :linename:",
"controller.transport.social-post": "Ik ben nu in :lineName naar :Destination! #NowTräwelling |Ik ben nu in lijn :lineName naar :Destination! #NowTräwelling ",
"controller.social.deleted": "Deze verbinding is geannuleerd.",
"user.login": "Inloggen",
Expand Down Expand Up @@ -328,7 +328,7 @@
"settings.btn-update": "actualiseren",
"settings.current-password": "Actueeles wachtwoord",
"settings.delete-profile-picture": "Profiel foto verwijdern",
"user.home-set": "Jouw thuis is nu :Station.",
"user.home-set": "Je thuisstation is nu :Station.",
"notifications.userJoinedConnection.notice": "@:username reist met <b>:linename</b> van <b>:origin</b> naar <b>:destination</b>.|@:username reist met lijn <b>:linename</b> van <b>:origin</b> naar <b>:destination</b>.",
"pagination.next": "Volgende pagina &raquo;",
"pagination.previous": "&laquo; Vorige pagina",
Expand Down Expand Up @@ -379,5 +379,27 @@
"user.already-muted": "De gebruiker :username is al op mute gezet.",
"user.muted.text": "Je kunt de check-ins van :username niet zien omdat je die gebruiker hebt op mute gezet.",
"user.already-unmuted": "De gebruiker :username is niet gemuted.",
"user.unmuted": "U heeft de gebruiker :username. gedemute."
"user.unmuted": "U heeft de gebruiker :username. gedemute.",
"email.change": "Gelieve uw e-mailadres bij te werken door het nieuwe adres en uw huidige wachtwoord in te voeren. Een bevestigingsmail zal u worden gestuurd om deze wijziging te bevestigen.",
"user.email.new": "Nieuw e-mail adres",
"user.email.not-set": "Er is nog geen emailadres in ons bestand",
"error.login": "Onjuiste inloggegevens",
"events.request.success": "Uw suggestie heeft ons bereikt. Dank je wel!",
"controller.user.follow-error": "Je kunt deze persoon niet volgen.",
"user.email.change": "Wijzig e-mail adres",
"user.login-credentials": "E-mailadres of gebruikersnaam",
"error.bad-request": "Het verzoek is ongeldig.",
"events.live-and-upcoming": "Huidige en toekomstige gebeurtenissen",
"events.period": "Periode",
"events.no-upcoming": "Er zijn op dit moment geen evenementen bij ons bekend.",
"email.verification.btn": "Klik op de knop om uw bevestigingslink te ontvangen.",
"email.validation": "Bevestig e-mail adres",
"events.request": "Verslag evenement",
"welcome": "Welkom bij Träwelling!",
"email.verification.required": "Om Träwelling ten volle te kunnen benutten, moet u uw e-mailadres nog bevestigen.",
"email.verification.sent": "Om de wijziging van uw e-mailadres te voltooien, moet u nog steeds klikken op de link in de e-mail die wij u zojuist hebben gestuurd.",
"events.request-question": "Voel je vrij om ons te laten weten over komende evenementen.",
"events.request-button": "Rapporteer",
"events.notice": "Uw bericht wordt pas gepubliceerd nadat het door het Träwelling-team is goedgekeurd.",
"user.home-not-set": "Je hebt nog geen thuisstation ingesteld."
}
8 changes: 6 additions & 2 deletions resources/lang/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"controller.transport.checkin-ok": "Du har lyckats checka in på :lineName!|Du har lyckats checka in på tågförbindelsen :lineName!",
"controller.transport.no-name-given": "Du måste ange ett stationsnamn!",
"controller.transport.not-in-stopovers": "Start-ID är inte bland tågstoppen.",
"controller.transport.overlapping-checkin": "Du har redan en incheckning i anslutningen :linename: ",
"controller.transport.overlapping-checkin": "Du har redan en incheckning i anslutningen :linename:",
"controller.transport.also-in-connection": "Också i detta tågförbindelse är:",
"controller.transport.social-post": "Jag är för närvarande i :lineName till :Destination! #NowTräwelling |Jag är för närvarande i tågförbindelsen :lineName till :Destination! #NowTräwelling ",
"controller.transport.social-post-with-event": "Jag är för närvarande i :lineName till :destination för #:hashtag! #NowTräwelling | Jag är för närvarande i tågförbindelsen :lineName till #destination för #:hashtag! #NowTräwelling ",
Expand Down Expand Up @@ -494,5 +494,9 @@
"checkin.points.could-have": "Du kunde ha fått fler poäng om du checkade in närmare den verkliga avgångstiden!",
"checkin.points.forced": "Du fick inga poäng för denna incheckning eftersom du tvingade fram den.",
"checkin.conflict.question": "Vill du checka in ändå? Du får inga poäng för detta, men din personliga statistik kommer fortfarande att uppdateras.",
"generic.error": "fel"
"generic.error": "fel",
"christmas-mode.disable": "Deaktivera julläge för den här sessionen",
"merry-christmas": "Vi önskar god jul!",
"christmas-mode": "Julläge",
"christmas-mode.enable": "Aktivera julläge för den här sessionen"
}
17 changes: 2 additions & 15 deletions resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<head>
<title>@yield('title') - {{ config('app.name', 'Träwelling') }}</title>

@include('layouts.includes.meta')
@include('layouts.includes.meta')

<!-- Scripts -->
<!-- Scripts -->
<script src="{{ mix('js/app.js') }}"></script>

<!-- Fonts -->
Expand All @@ -20,10 +20,6 @@
<link rel="author" href="/humans.txt">

@yield('head')

@if(session()->get('christmas-mode') === true)
<script src="{{ mix('js/snow.js') }}"></script>
@endif
</head>
<body>
<div class="modal fade bd-example-modal-lg" id="notifications-board" tabindex="-1" role="dialog"
Expand Down Expand Up @@ -54,11 +50,6 @@
<nav class="navbar navbar-expand-md navbar-dark {{ !config('app.debug') ? 'bg-trwl' : 'bg-black' }}">
<div class="container">
<a class="navbar-brand" href="{{ url('/') }}">
@if(\Carbon\Carbon::now()->isBetween(\Carbon\Carbon::parse('2021-12-24 00:00'), \Carbon\Carbon::parse('2021-12-27 23:59')))
🎁
@elseif(\Carbon\Carbon::now()->isBefore('2022-01-06'))
🎄
@endif
{{ config('app.name', 'Träwelling') }}
</a>
<div class="navbar-toggler">
Expand Down Expand Up @@ -259,10 +250,6 @@ class="text-muted">
var urlUnfollow = '{{ route('follow.destroy') }}';
var urlAutocomplete = '{{ url('transport/train/autocomplete') }}';
</script>

@if(session()->get('christmas-mode') === true)
<div id="snow"></div>
@endif
</body>
@yield('footer')
</html>
27 changes: 1 addition & 26 deletions resources/views/settings/settings.blade.php
Original file line number Diff line number Diff line change
@@ -1,37 +1,12 @@
@extends('layouts.app')

@section('title'){{ __('menu.settings') }}@endsection
@section('title', __('menu.settings'))

@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8 col-lg-7">
@include('settings.cards.general')

<div class="card mt-3">
<div class="card-header">🎄 {{ __('christmas-mode') }}</div>

<div class="card-body text-center">

<form method="POST" action="{{ route('christmas-mode') }}">
@csrf

@if(session()->get('christmas-mode') === true)
<input type="hidden" name="christmas-mode" value="0"/>
<button type="submit" class="btn btn-secondary">
🎁 {{ __('christmas-mode.disable') }} ⛄️
</button>
@else
<input type="hidden" name="christmas-mode" value="1"/>
<button type="submit" class="btn btn-success">
🎁 {{ __('christmas-mode.enable') }} ⛄️
</button>
@endif
</form>
</div>
</div>


@include('settings.cards.privacy')
@include('settings.cards.password')
@include('settings.cards.login-providers')
Expand Down
4 changes: 0 additions & 4 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
|
*/

use App\Http\Controllers\ChristmasController;
use App\Http\Controllers\Frontend\AccountController;
use App\Http\Controllers\Frontend\EventController;
use App\Http\Controllers\Frontend\Export\ExportController;
Expand Down Expand Up @@ -124,9 +123,6 @@
* All of these routes can only be used by fully registered users.
*/
Route::middleware(['auth', 'privacy'])->group(function() {
Route::post('/christmas-mode', [ChristmasController::class, 'toggleChristmasMode'])
->name('christmas-mode');

Route::post('/ics/createToken', [IcsController::class, 'createIcsToken'])
->name('ics.createToken');
Route::post('/ics/revokeToken', [IcsController::class, 'revokeIcsToken'])
Expand Down
3 changes: 1 addition & 2 deletions webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ const mix = require("laravel-mix");
|
*/

mix.js("resources/js/snow.js", "public/js")
.js("resources/js/app.js", "public/js")
mix.js("resources/js/app.js", "public/js")
.js("resources/js/stats.js", "public/js")
.sass("resources/sass/app.scss", "public/css")
.js("resources/js/admin.js", "public/js")
Expand Down

0 comments on commit f3fdd5d

Please sign in to comment.