From 33ad0c14d168d36a4e7ad42dc6aa6a37a7335849 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Sun, 25 Sep 2016 23:56:46 +0200 Subject: Change from lumen 5.2 to laravel 5.3 (Resolves #1) --- resources/lang/en/auth.php | 19 ++++++ resources/lang/en/pagination.php | 19 ++++++ resources/lang/en/passwords.php | 22 +++++++ resources/lang/en/validation.php | 14 ++++- resources/views/.gitkeep | 0 resources/views/auth/login.blade.php | 68 +++++++++++++++++++++ resources/views/auth/passwords/email.blade.php | 47 +++++++++++++++ resources/views/auth/passwords/reset.blade.php | 70 ++++++++++++++++++++++ resources/views/auth/register.blade.php | 82 ++++++++++++++++++++++++++ resources/views/contribute.blade.php | 4 +- resources/views/layouts/master.blade.php | 32 ++++++---- resources/views/stats.blade.php | 8 ++- resources/views/trainer.blade.php | 6 +- 13 files changed, 371 insertions(+), 20 deletions(-) create mode 100644 resources/lang/en/auth.php create mode 100644 resources/lang/en/pagination.php create mode 100644 resources/lang/en/passwords.php delete mode 100644 resources/views/.gitkeep create mode 100644 resources/views/auth/login.blade.php create mode 100644 resources/views/auth/passwords/email.blade.php create mode 100644 resources/views/auth/passwords/reset.blade.php create mode 100644 resources/views/auth/register.blade.php (limited to 'resources') diff --git a/resources/lang/en/auth.php b/resources/lang/en/auth.php new file mode 100644 index 0000000..e5506df --- /dev/null +++ b/resources/lang/en/auth.php @@ -0,0 +1,19 @@ + 'These credentials do not match our records.', + 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', + +]; diff --git a/resources/lang/en/pagination.php b/resources/lang/en/pagination.php new file mode 100644 index 0000000..fcab34b --- /dev/null +++ b/resources/lang/en/pagination.php @@ -0,0 +1,19 @@ + '« Previous', + 'next' => 'Next »', + +]; diff --git a/resources/lang/en/passwords.php b/resources/lang/en/passwords.php new file mode 100644 index 0000000..e5544d2 --- /dev/null +++ b/resources/lang/en/passwords.php @@ -0,0 +1,22 @@ + 'Passwords must be at least six characters and match the confirmation.', + 'reset' => 'Your password has been reset!', + 'sent' => 'We have e-mailed your password reset link!', + 'token' => 'This password reset token is invalid.', + 'user' => "We can't find a user with that e-mail address.", + +]; diff --git a/resources/lang/en/validation.php b/resources/lang/en/validation.php index ff1c087..73b49d0 100644 --- a/resources/lang/en/validation.php +++ b/resources/lang/en/validation.php @@ -34,13 +34,18 @@ return [ 'different' => 'The :attribute and :other must be different.', 'digits' => 'The :attribute must be :digits digits.', 'digits_between' => 'The :attribute must be between :min and :max digits.', + 'dimensions' => 'The :attribute has invalid image dimensions.', + 'distinct' => 'The :attribute field has a duplicate value.', 'email' => 'The :attribute must be a valid email address.', - 'filled' => 'The :attribute field is required.', 'exists' => 'The selected :attribute is invalid.', + 'file' => 'The :attribute must be a file.', + 'filled' => 'The :attribute field is required.', 'image' => 'The :attribute must be an image.', 'in' => 'The selected :attribute is invalid.', + 'in_array' => 'The :attribute field does not exist in :other.', 'integer' => 'The :attribute must be an integer.', 'ip' => 'The :attribute must be a valid IP address.', + 'json' => 'The :attribute must be a valid JSON string.', 'max' => [ 'numeric' => 'The :attribute may not be greater than :max.', 'file' => 'The :attribute may not be greater than :max kilobytes.', @@ -48,6 +53,7 @@ return [ 'array' => 'The :attribute may not have more than :max items.', ], 'mimes' => 'The :attribute must be a file of type: :values.', + 'mimetypes' => 'The :attribute must be a file of type: :values.', 'min' => [ 'numeric' => 'The :attribute must be at least :min.', 'file' => 'The :attribute must be at least :min kilobytes.', @@ -56,9 +62,11 @@ return [ ], 'not_in' => 'The selected :attribute is invalid.', 'numeric' => 'The :attribute must be a number.', + 'present' => 'The :attribute field must be present.', 'regex' => 'The :attribute format is invalid.', 'required' => 'The :attribute field is required.', 'required_if' => 'The :attribute field is required when :other is :value.', + 'required_unless' => 'The :attribute field is required unless :other is in :values.', 'required_with' => 'The :attribute field is required when :values is present.', 'required_with_all' => 'The :attribute field is required when :values is present.', 'required_without' => 'The :attribute field is required when :values is not present.', @@ -70,9 +78,11 @@ return [ 'string' => 'The :attribute must be :size characters.', 'array' => 'The :attribute must contain :size items.', ], + 'string' => 'The :attribute must be a string.', + 'timezone' => 'The :attribute must be a valid zone.', 'unique' => 'The :attribute has already been taken.', + 'uploaded' => 'The :attribute failed to upload.', 'url' => 'The :attribute format is invalid.', - 'timezone' => 'The :attribute must be a valid zone.', /* |-------------------------------------------------------------------------- diff --git a/resources/views/.gitkeep b/resources/views/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php new file mode 100644 index 0000000..2070f2b --- /dev/null +++ b/resources/views/auth/login.blade.php @@ -0,0 +1,68 @@ +@extends('layouts.master') + +@section('master-content') +
+
+
+
+
Login
+
+
+ {{ csrf_field() }} + +
+ + +
+ + + @if ($errors->has('email')) + + {{ $errors->first('email') }} + + @endif +
+
+ +
+ + +
+ + + @if ($errors->has('password')) + + {{ $errors->first('password') }} + + @endif +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + + Forgot Your Password? + +
+
+
+
+
+
+
+
+@endsection diff --git a/resources/views/auth/passwords/email.blade.php b/resources/views/auth/passwords/email.blade.php new file mode 100644 index 0000000..62e0120 --- /dev/null +++ b/resources/views/auth/passwords/email.blade.php @@ -0,0 +1,47 @@ +@extends('layouts.master') + + +@section('master-content') +
+
+
+
+
Reset Password
+
+ @if (session('status')) +
+ {{ session('status') }} +
+ @endif + +
+ {{ csrf_field() }} + +
+ + +
+ + + @if ($errors->has('email')) + + {{ $errors->first('email') }} + + @endif +
+
+ +
+
+ +
+
+
+
+
+
+
+
+@endsection diff --git a/resources/views/auth/passwords/reset.blade.php b/resources/views/auth/passwords/reset.blade.php new file mode 100644 index 0000000..deb4d56 --- /dev/null +++ b/resources/views/auth/passwords/reset.blade.php @@ -0,0 +1,70 @@ +@extends('layouts.master') + +@section('master-content') +
+
+
+
+
Reset Password
+ +
+
+ {{ csrf_field() }} + + + +
+ + +
+ + + @if ($errors->has('email')) + + {{ $errors->first('email') }} + + @endif +
+
+ +
+ + +
+ + + @if ($errors->has('password')) + + {{ $errors->first('password') }} + + @endif +
+
+ +
+ +
+ + + @if ($errors->has('password_confirmation')) + + {{ $errors->first('password_confirmation') }} + + @endif +
+
+ +
+
+ +
+
+
+
+
+
+
+
+@endsection diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php new file mode 100644 index 0000000..c4f9009 --- /dev/null +++ b/resources/views/auth/register.blade.php @@ -0,0 +1,82 @@ +@extends('layouts.master') + +@section('master-content') +
+
+
+
+
Register
+
+
+ {{ csrf_field() }} + +
+ + +
+ + + @if ($errors->has('name')) + + {{ $errors->first('name') }} + + @endif +
+
+ +
+ + +
+ + + @if ($errors->has('email')) + + {{ $errors->first('email') }} + + @endif +
+
+ +
+ + +
+ + + @if ($errors->has('password')) + + {{ $errors->first('password') }} + + @endif +
+
+ +
+ + +
+ + + @if ($errors->has('password_confirmation')) + + {{ $errors->first('password_confirmation') }} + + @endif +
+
+ +
+
+ +
+
+
+
+
+
+
+
+@endsection diff --git a/resources/views/contribute.blade.php b/resources/views/contribute.blade.php index 2e0eff3..6ddd37c 100644 --- a/resources/views/contribute.blade.php +++ b/resources/views/contribute.blade.php @@ -9,8 +9,8 @@ use HebrewParseTrainer\Verb;

@if(!Auth::check()) - Login - Sign up + Login + Sign up @endif

Here's how it works:

diff --git a/resources/views/layouts/master.blade.php b/resources/views/layouts/master.blade.php index 095fee9..5d244d0 100644 --- a/resources/views/layouts/master.blade.php +++ b/resources/views/layouts/master.blade.php @@ -28,18 +28,21 @@ $menu = [ if (Auth::check()) { $menu['Statistics'] = ['stats', 'stats']; - $menu['Logout'] = ['logout', 'logout']; } ?> - + + + ParseTrainer - - + + + @@ -48,22 +51,29 @@ if (Auth::check()) { -

ParseTrainer

+

ParseTrainer

@yield('master-content') - - - - + + + + @if(Auth::check()) - + + + @endif diff --git a/resources/views/stats.blade.php b/resources/views/stats.blade.php index 27010fd..eb4205f 100644 --- a/resources/views/stats.blade.php +++ b/resources/views/stats.blade.php @@ -2,7 +2,9 @@ use \HebrewParseTrainer\RandomLog; $db_stats = RandomLog - ::select(DB::raw('COUNT(*) as count'), 'created_at') + ::select( + DB::raw('COUNT(*) as count'), + DB::raw('DATE(created_at) as created_at')) ->groupBy(DB::raw('DATE(created_at)')) ->orderBy('created_at') ->get(); @@ -21,7 +23,9 @@ foreach ($db_stats as $stat) { $stats['requests'] = "[" . implode(",", $stats['requests']) . "]"; $db_stats = RandomLog - ::select(DB::raw('COUNT(DISTINCT `ip`) as count'), 'created_at') + ::select( + DB::raw('COUNT(DISTINCT `ip`) as count'), + DB::raw('DATE(created_at) as created_at')) ->groupBy(DB::raw('DATE(created_at)')) ->orderBy('created_at') ->get(); diff --git a/resources/views/trainer.blade.php b/resources/views/trainer.blade.php index 02d9964..f03254a 100644 --- a/resources/views/trainer.blade.php +++ b/resources/views/trainer.blade.php @@ -82,10 +82,10 @@ use HebrewParseTrainer\Tense;

Contribute!

-

If this app is useful to you, please consider contributing by adding more verbs to the database!

+

If this app is useful to you, please consider contributing by adding more verbs to the database!

@if(!Auth::check()) - Sign up - or login + Sign up + or login @endif
-- cgit v1.2.3