diff --git a/.gitignore b/.gitignore index 55f3edb0..8f7635f6 100644 --- a/.gitignore +++ b/.gitignore @@ -32,4 +32,5 @@ /public/js /public/fonts /bower_components -.sass-cache \ No newline at end of file +.sass-cache +!/resources/views/vendor/ diff --git a/app/Http/Controllers/Admin/FileManager/UploadFile.php b/app/Http/Controllers/Admin/FileManager/UploadFile.php index 3c4a7933..03b5f91f 100644 --- a/app/Http/Controllers/Admin/FileManager/UploadFile.php +++ b/app/Http/Controllers/Admin/FileManager/UploadFile.php @@ -1,8 +1,8 @@ middleware('guest'); + } +} diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php new file mode 100644 index 00000000..17597694 --- /dev/null +++ b/app/Http/Controllers/Auth/LoginController.php @@ -0,0 +1,45 @@ +middleware('guest')->except('logout'); + } + + public function logout() { + Auth::logout(); + return redirect()->route('login'); + } +} diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php new file mode 100644 index 00000000..de74489d --- /dev/null +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -0,0 +1,73 @@ +middleware('guest'); + } + + /** + * Get a validator for an incoming registration request. + * + * @param array $data + * + * @return \Illuminate\Contracts\Validation\Validator + */ + protected function validator(array $data) + { + return Validator::make($data, [ + 'name' => 'required|string|max:255', + 'email' => 'required|string|email|max:255|unique:users', + 'password' => 'required|string|min:6|confirmed', + 'g-recaptcha-response' => 'required|recaptcha', + ]); + } + + /** + * Create a new user instance after a valid registration. + * + * @param array $data + * + * @return \App\User + */ + protected function create(array $data) + { + return User::create([ + 'name' => $data['name'], + 'role' => User::ROLE_VISITOR, + 'state' => User::STATE_ACTIVE, + 'email' => $data['email'], + 'password' => bcrypt($data['password']), + ]); + } +} diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php new file mode 100644 index 00000000..44672583 --- /dev/null +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -0,0 +1,39 @@ +middleware('guest'); + } +} diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index 7cfbf72b..44a30265 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -2,6 +2,7 @@ namespace App\Http\Middleware; +use App\Models\User; use Closure; use Illuminate\Support\Facades\Auth; @@ -18,13 +19,26 @@ class Authenticate */ public function handle($request, Closure $next, $guard = null) { - if (!Auth::guard($guard)->check()) { + if (!Auth::guard($guard) + ->check() || Auth::user()->status != User::STATE_ACTIVE || Auth::user()->role == User::ROLE_VISITOR) { + Auth::logout(); + if ($request->ajax()) { return response('Unauthorized.', 401); } + // select right message + if (Auth::user() && Auth::user()->status != User::STATE_ACTIVE) { + $message = 'auth.userNotActive'; + } elseif (Auth::user() && Auth::user()->role == User::ROLE_VISITOR) { + $message = 'auth.visitorInAdmin'; + } else { + $message = 'auth.loginExpired'; + } + return redirect() ->route('login') + ->with('warning', trans($message)) ->with('redirectTo', $request->fullUrl()); } diff --git a/app/Listeners/Loggers/LogLogout.php b/app/Listeners/Loggers/LogLogout.php index 6ca608bf..abda7140 100644 --- a/app/Listeners/Loggers/LogLogout.php +++ b/app/Listeners/Loggers/LogLogout.php @@ -3,19 +3,22 @@ namespace App\Listeners\Loggers; use Illuminate\Auth\Events\Logout; -use Illuminate\Queue\InteractsWithQueue; -use Illuminate\Contracts\Queue\ShouldQueue; class LogLogout extends Logger { /** * Handle the event. * - * @param Logout $event + * @param Logout $event + * * @return void */ public function handle(Logout $event) { + if (is_null($event->user)) { + return; + } + $parameters = [ 'id' => $event->user->id, 'name' => $event->user->name, @@ -27,7 +30,6 @@ class LogLogout extends Logger /** * Getter for action name. Used only internally - * * @return mixed */ protected function getName() diff --git a/app/Models/User.php b/app/Models/User.php index 35d4911f..56332a3b 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -2,18 +2,27 @@ namespace App\Models; +use App\Notifications\ResetPasswordNotification; use Illuminate\Auth\Authenticatable; use Illuminate\Contracts\Auth\Authenticatable as AuthenticableInterface; +use Illuminate\Contracts\Auth\CanResetPassword; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Foundation\Auth\Access\Authorizable; +use Illuminate\Notifications\Notifiable; /** * Class User */ -class User extends Model implements AuthenticableInterface +class User extends Model implements AuthenticableInterface, CanResetPassword { - use SoftDeletes, Authenticatable, Authorizable; + use SoftDeletes, Authenticatable, Authorizable, Notifiable; + const STATE_DELETED = 'deleted'; + const STATE_BLOCKED = 'blocked'; + const STATE_ACTIVE = 'active'; + const ROLE_VISITOR = 'visitor'; + const ROLE_EDITOR = 'editor'; + const ROLE_ADMIN = 'admin'; public $timestamps = true; protected $fillable = [ 'email', @@ -24,17 +33,31 @@ class User extends Model implements AuthenticableInterface ]; /** * The attributes excluded from the model's JSON form. - * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; - const STATE_DELETED = 'deleted'; - const STATE_BLOCKED = 'blocked'; - const STATE_ACTIVE = 'active'; - const ROLE_VISITOR = 'visitor'; - const ROLE_EDITOR = 'editor'; - const ROLE_ADMIN = 'admin'; + + /** + * Get the e-mail address where password reset links are sent. + * @return string + */ + public function getEmailForPasswordReset() + { + return $this->email; + } + + /** + * Send the password reset notification. + * + * @param string $token + * + * @return void + */ + public function sendPasswordResetNotification($token) + { + $this->notify(new ResetPasswordNotification($token)); + } } diff --git a/app/Notifications/ResetPasswordNotification.php b/app/Notifications/ResetPasswordNotification.php new file mode 100644 index 00000000..03418cda --- /dev/null +++ b/app/Notifications/ResetPasswordNotification.php @@ -0,0 +1,52 @@ +token = $token; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * + * @return \Illuminate\Notifications\Messages\MailMessage + */ + public function toMail($notifiable) + { + $url = route('password.reset', ['token' => $this->token, 'email' => $notifiable->email]); + + return (new MailMessage())->subject(trans('notification.forgottenPassword.subject')) + ->line(trans('notification.forgottenPassword.firstLine')) + ->action(trans('notification.forgottenPassword.button'), $url) + ->line(trans('notification.forgottenPassword.lastLine')); + } +} diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 98a9ad4b..4a67cf56 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -14,15 +14,6 @@ class RouteServiceProvider extends ServiceProvider */ protected $namespace = 'App\Http\Controllers'; - /** - * Define your route model bindings, pattern filters, etc. - * @return void - */ - public function boot() - { - parent::boot(); - } - /** * Define the routes for the application. * @return void @@ -41,6 +32,6 @@ class RouteServiceProvider extends ServiceProvider { Route::namespace($this->namespace) ->middleware('web') - ->group(app_path('Http/routes.php')); + ->group(base_path('routes/web.php')); } } \ No newline at end of file diff --git a/config/app.php b/config/app.php index 09223bbe..106c737a 100644 --- a/config/app.php +++ b/config/app.php @@ -153,10 +153,10 @@ return [ Illuminate\Translation\TranslationServiceProvider::class, Illuminate\Validation\ValidationServiceProvider::class, Illuminate\View\ViewServiceProvider::class, + Illuminate\Notifications\NotificationServiceProvider::class, Mcamara\LaravelLocalization\LaravelLocalizationServiceProvider::class, \App\ModuleManager\Providers\ModuleManager::class, \Nwidart\Menus\MenusServiceProvider::class, -// Pingpong\Menus\MenusServiceProvider::class, Franzose\ClosureTable\ClosureTableServiceProvider::class, \Watson\Sitemap\SitemapServiceProvider::class, Intervention\Image\ImageServiceProvider::class, @@ -185,7 +185,6 @@ return [ */ 'aliases' => [ - 'App' => Illuminate\Support\Facades\App::class, 'Artisan' => Illuminate\Support\Facades\Artisan::class, 'Auth' => Illuminate\Support\Facades\Auth::class, @@ -221,7 +220,7 @@ return [ 'View' => Illuminate\Support\Facades\View::class, 'Recaptcha' => Greggilbert\Recaptcha\Facades\Recaptcha::class, 'Shortcode' => Webwizo\Shortcodes\Facades\Shortcode::class, - + 'Notification' => Illuminate\Support\Facades\Notification::class, ], ]; diff --git a/config/mail.php b/config/mail.php index 7c60a671..8f0edf46 100644 --- a/config/mail.php +++ b/config/mail.php @@ -111,4 +111,22 @@ return [ 'sendmail' => '/usr/sbin/sendmail -bs', + /* + |-------------------------------------------------------------------------- + | Markdown Mail Settings + |-------------------------------------------------------------------------- + | + | If you are using Markdown based email rendering, you may configure your + | theme and component paths here, allowing you to customize the design + | of the emails. Or, you may simply stick with the Laravel defaults! + | + */ + + 'markdown' => [ + 'theme' => 'default', + + 'paths' => [ + resource_path('views/vendor/mail'), + ], + ] ]; diff --git a/resources/lang/cs/admin/loginForm.php b/resources/lang/cs/admin/loginForm.php index bc8dec7a..d6236905 100644 --- a/resources/lang/cs/admin/loginForm.php +++ b/resources/lang/cs/admin/loginForm.php @@ -10,4 +10,6 @@ return [ 'loginToContinue' => 'Pro vstup je nutné přihlášení', 'yourEmail' => 'Váš e-mail', 'yourPassword' => 'Vaše heslo', + 'sendConfirmEmail' => 'Odeslat odkaz pro resetování hesla', + 'passwordReset' => 'Nové heslo' ]; diff --git a/resources/lang/cs/auth.php b/resources/lang/cs/auth.php index 3c6641c8..e27fa692 100644 --- a/resources/lang/cs/auth.php +++ b/resources/lang/cs/auth.php @@ -1,6 +1,9 @@ "Nelze přistoupit k tomuto zdroji", - "failed" => "Přihlašovací údaje nejsou správné.", - "throttle" => "Příliš mnoho neplatných přihlášení. Zkuste to znovu za :seconds sekund.", + "accessDenied" => "Nelze přistoupit k tomuto zdroji", + "failed" => "Přihlašovací údaje nejsou správné.", + "throttle" => "Příliš mnoho neplatných přihlášení. Zkuste to znovu za :seconds sekund.", + 'userNotActive' => 'Uživatel nebyl aktivován, či byl administrátorem zablokován.', + 'visitorInAdmin' => 'Návštěvník nemá oprávnění do adminstrace!', + 'loginExpired' => 'Vaše přihlášení expirovalo. Přihlašte se prosím znovu.' ]; diff --git a/resources/lang/cs/notification.php b/resources/lang/cs/notification.php new file mode 100644 index 00000000..d79ea618 --- /dev/null +++ b/resources/lang/cs/notification.php @@ -0,0 +1,9 @@ + [ + 'firstLine' => 'Dostali jste tento e-mail, protože byl zaslán požadavek na reset hesla. Pro nastavení nového hesla klikněte na následující tlačítko:', + 'lastLine' => 'V případě, že tento e-mail neočekáváte, můžete ho klidně ignorovat.', + 'button' => 'Resetovat heslo', + 'subject' => 'Odkaz pro změnu hesla' + ] +]; \ No newline at end of file diff --git a/resources/lang/cs/register.php b/resources/lang/cs/register.php new file mode 100644 index 00000000..38d8ec29 --- /dev/null +++ b/resources/lang/cs/register.php @@ -0,0 +1,10 @@ + 'Registrace nového uživatele', + 'name' => 'Jméno', + 'email' => 'E-mail', + 'password' => 'Heslo', + 'passwordConfirm' => 'Heslo (znovu)', + 'register' => 'Vytvořit účet', + 'setNewPassword' => 'Nastavit nové heslo' +]; \ No newline at end of file diff --git a/resources/views/admin/layout.blade.php b/resources/views/admin/layout.blade.php index 2dae3db6..0a183172 100644 --- a/resources/views/admin/layout.blade.php +++ b/resources/views/admin/layout.blade.php @@ -26,6 +26,13 @@ +@if (session('status')) +
+ + {{ session('status') }} +
+@endif + @if (session('success'))
diff --git a/resources/views/admin/loginForm.blade.php b/resources/views/auth/login.blade.php similarity index 65% rename from resources/views/admin/loginForm.blade.php rename to resources/views/auth/login.blade.php index d44cc144..569fea3d 100644 --- a/resources/views/admin/loginForm.blade.php +++ b/resources/views/auth/login.blade.php @@ -8,7 +8,7 @@

- {{isset($pageName) ? $pageName : ''}} + @lang('admin/loginForm.login')

@@ -24,6 +24,12 @@ name="email" id="email" placeholder="@lang('admin/loginForm.yourEmail')" required> + + @if ($errors->has('email')) + + {{ $errors->first('email') }} + + @endif
@@ -32,13 +38,27 @@ name="password" id="password" placeholder="@lang('admin/loginForm.yourPassword')" required> + + @if ($errors->has('password')) + + {{ $errors->first('password') }} + + @endif
-
-@endsection \ No newline at end of file +@endsection diff --git a/resources/views/auth/passwords/email.blade.php b/resources/views/auth/passwords/email.blade.php new file mode 100644 index 00000000..161c650d --- /dev/null +++ b/resources/views/auth/passwords/email.blade.php @@ -0,0 +1,42 @@ +@extends('admin.layout') + +@section('pageHeading', trans('admin/loginForm.forgottenPassword')) + +@section('page') +
+
+
+
+

+ @lang('admin/loginForm.forgottenPassword') +

+
+
+ +
+ {!! 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 00000000..34c8d196 --- /dev/null +++ b/resources/views/auth/passwords/reset.blade.php @@ -0,0 +1,68 @@ +@extends('admin.layout') + +@section('pageHeading', trans('admin/loginForm.passwordReset')) + +@section('page') +
+
+
+
+

+ @lang('admin/loginForm.passwordReset') +

+
+
+
+ {!! 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 00000000..10f9a9a7 --- /dev/null +++ b/resources/views/auth/register.blade.php @@ -0,0 +1,89 @@ +@extends('admin.layout') + +@section('pageHeading', trans('register.heading')) + +@section('page') +
+
+
+
+

+ @lang('register.heading') +

+
+
+
+ {!! 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 +
+ +
+ + +
+ +
+ {!! \Greggilbert\Recaptcha\Facades\Recaptcha::render() !!} + + @if ($errors->has('g-recaptcha-response')) + + {{ $errors->first('g-recaptcha-response') }} + + @endif + +
+ + +
+ +
+ +
+
+
+
+
+
+@endsection diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php new file mode 100644 index 00000000..d4745b4e --- /dev/null +++ b/resources/views/layouts/app.blade.php @@ -0,0 +1,80 @@ + + + + + + + + + + + {{ config('app.name', 'Laravel') }} + + + + + +
+ + + @yield('content') +
+ + + + + diff --git a/resources/views/vendor/mail/html/button.blade.php b/resources/views/vendor/mail/html/button.blade.php new file mode 100644 index 00000000..c7aae1b8 --- /dev/null +++ b/resources/views/vendor/mail/html/button.blade.php @@ -0,0 +1,19 @@ + + + + +
+ + + + +
+ + + + +
+ {{ $slot }} +
+
+
diff --git a/resources/views/vendor/mail/html/footer.blade.php b/resources/views/vendor/mail/html/footer.blade.php new file mode 100644 index 00000000..c3f9360a --- /dev/null +++ b/resources/views/vendor/mail/html/footer.blade.php @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/resources/views/vendor/mail/html/header.blade.php b/resources/views/vendor/mail/html/header.blade.php new file mode 100644 index 00000000..eefabab9 --- /dev/null +++ b/resources/views/vendor/mail/html/header.blade.php @@ -0,0 +1,7 @@ + + + + {{ $slot }} + + + diff --git a/resources/views/vendor/mail/html/layout.blade.php b/resources/views/vendor/mail/html/layout.blade.php new file mode 100644 index 00000000..36b7bdfe --- /dev/null +++ b/resources/views/vendor/mail/html/layout.blade.php @@ -0,0 +1,51 @@ + + + + + + + + + + + + + +
+ + {!! $header or '' !!} + + + + + +
+ + + + + +
+ {!! $slot !!} +
+
+
+ + diff --git a/resources/views/vendor/mail/html/message.blade.php b/resources/views/vendor/mail/html/message.blade.php new file mode 100644 index 00000000..3030f2d8 --- /dev/null +++ b/resources/views/vendor/mail/html/message.blade.php @@ -0,0 +1,11 @@ +@component('mail::layout') + {{-- Header --}} + @slot('header') + @component('mail::header', ['url' => config('app.url')]) + {{ config('app.name') }} + @endcomponent + @endslot + + {{-- Body --}} + {!! $slot !!} +@endcomponent diff --git a/resources/views/vendor/mail/html/panel.blade.php b/resources/views/vendor/mail/html/panel.blade.php new file mode 100644 index 00000000..f3970802 --- /dev/null +++ b/resources/views/vendor/mail/html/panel.blade.php @@ -0,0 +1,13 @@ + + + + +
+ + + + +
+ {{ Illuminate\Mail\Markdown::parse($slot) }} +
+
diff --git a/resources/views/vendor/mail/html/promotion.blade.php b/resources/views/vendor/mail/html/promotion.blade.php new file mode 100644 index 00000000..0debcf8a --- /dev/null +++ b/resources/views/vendor/mail/html/promotion.blade.php @@ -0,0 +1,7 @@ + + + + +
+ {{ Illuminate\Mail\Markdown::parse($slot) }} +
diff --git a/resources/views/vendor/mail/html/promotion/button.blade.php b/resources/views/vendor/mail/html/promotion/button.blade.php new file mode 100644 index 00000000..8e79081c --- /dev/null +++ b/resources/views/vendor/mail/html/promotion/button.blade.php @@ -0,0 +1,13 @@ + + + + +
+ + + + +
+ {{ $slot }} +
+
diff --git a/resources/views/vendor/mail/html/subcopy.blade.php b/resources/views/vendor/mail/html/subcopy.blade.php new file mode 100644 index 00000000..c3df7b4c --- /dev/null +++ b/resources/views/vendor/mail/html/subcopy.blade.php @@ -0,0 +1,7 @@ + + + + +
+ {{ Illuminate\Mail\Markdown::parse($slot) }} +
diff --git a/resources/views/vendor/mail/html/table.blade.php b/resources/views/vendor/mail/html/table.blade.php new file mode 100644 index 00000000..a5f3348b --- /dev/null +++ b/resources/views/vendor/mail/html/table.blade.php @@ -0,0 +1,3 @@ +
+{{ Illuminate\Mail\Markdown::parse($slot) }} +
diff --git a/resources/views/vendor/mail/html/themes/default.css b/resources/views/vendor/mail/html/themes/default.css new file mode 100644 index 00000000..20659933 --- /dev/null +++ b/resources/views/vendor/mail/html/themes/default.css @@ -0,0 +1,285 @@ +/* Base */ + +body, body *:not(html):not(style):not(br):not(tr):not(code) { + font-family: Avenir, Helvetica, sans-serif; + box-sizing: border-box; +} + +body { + background-color: #f5f8fa; + color: #74787E; + height: 100%; + hyphens: auto; + line-height: 1.4; + margin: 0; + -moz-hyphens: auto; + -ms-word-break: break-all; + width: 100% !important; + -webkit-hyphens: auto; + -webkit-text-size-adjust: none; + word-break: break-all; + word-break: break-word; +} + +p, +ul, +ol, +blockquote { + line-height: 1.4; + text-align: left; +} + +a { + color: #3869D4; +} + +a img { + border: none; +} + +/* Typography */ + +h1 { + color: #2F3133; + font-size: 19px; + font-weight: bold; + margin-top: 0; + text-align: left; +} + +h2 { + color: #2F3133; + font-size: 16px; + font-weight: bold; + margin-top: 0; + text-align: left; +} + +h3 { + color: #2F3133; + font-size: 14px; + font-weight: bold; + margin-top: 0; + text-align: left; +} + +p { + color: #74787E; + font-size: 16px; + line-height: 1.5em; + margin-top: 0; + text-align: left; +} + +p.sub { + font-size: 12px; +} + +img { + max-width: 100%; +} + +/* Layout */ + +.wrapper { + background-color: #f5f8fa; + margin: 0; + padding: 0; + width: 100%; + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 100%; +} + +.content { + margin: 0; + padding: 0; + width: 100%; + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 100%; +} + +/* Header */ + +.header { + padding: 25px 0; + text-align: center; +} + +.header a { + color: #bbbfc3; + font-size: 19px; + font-weight: bold; + text-decoration: none; + text-shadow: 0 1px 0 white; +} + +/* Body */ + +.body { + background-color: #FFFFFF; + border-bottom: 1px solid #EDEFF2; + border-top: 1px solid #EDEFF2; + margin: 0; + padding: 0; + width: 100%; + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 100%; +} + +.inner-body { + background-color: #FFFFFF; + margin: 0 auto; + padding: 0; + width: 570px; + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 570px; +} + +/* Subcopy */ + +.subcopy { + border-top: 1px solid #EDEFF2; + margin-top: 25px; + padding-top: 25px; +} + +.subcopy p { + font-size: 12px; +} + +/* Footer */ + +.footer { + margin: 0 auto; + padding: 0; + text-align: center; + width: 570px; + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 570px; +} + +.footer p { + color: #AEAEAE; + font-size: 12px; + text-align: center; +} + +/* Tables */ + +.table table { + margin: 30px auto; + width: 100%; + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 100%; +} + +.table th { + border-bottom: 1px solid #EDEFF2; + padding-bottom: 8px; +} + +.table td { + color: #74787E; + font-size: 15px; + line-height: 18px; + padding: 10px 0; +} + +.content-cell { + padding: 35px; +} + +/* Buttons */ + +.action { + margin: 30px auto; + padding: 0; + text-align: center; + width: 100%; + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 100%; +} + +.button { + border-radius: 3px; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.16); + color: #FFF; + display: inline-block; + text-decoration: none; + -webkit-text-size-adjust: none; +} + +.button-blue { + background-color: #3097D1; + border-top: 10px solid #3097D1; + border-right: 18px solid #3097D1; + border-bottom: 10px solid #3097D1; + border-left: 18px solid #3097D1; +} + +.button-green { + background-color: #2ab27b; + border-top: 10px solid #2ab27b; + border-right: 18px solid #2ab27b; + border-bottom: 10px solid #2ab27b; + border-left: 18px solid #2ab27b; +} + +.button-red { + background-color: #bf5329; + border-top: 10px solid #bf5329; + border-right: 18px solid #bf5329; + border-bottom: 10px solid #bf5329; + border-left: 18px solid #bf5329; +} + +/* Panels */ + +.panel { + margin: 0 0 21px; +} + +.panel-content { + background-color: #EDEFF2; + padding: 16px; +} + +.panel-item { + padding: 0; +} + +.panel-item p:last-of-type { + margin-bottom: 0; + padding-bottom: 0; +} + +/* Promotions */ + +.promotion { + background-color: #FFFFFF; + border: 2px dashed #9BA2AB; + margin: 0; + margin-bottom: 25px; + margin-top: 25px; + padding: 24px; + width: 100%; + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 100%; +} + +.promotion h1 { + text-align: center; +} + +.promotion p { + font-size: 15px; + text-align: center; +} diff --git a/resources/views/vendor/notifications/email.blade.php b/resources/views/vendor/notifications/email.blade.php new file mode 100644 index 00000000..5f008b4c --- /dev/null +++ b/resources/views/vendor/notifications/email.blade.php @@ -0,0 +1,36 @@ +@component('mail::message') + {{-- Intro Lines --}} + @foreach ($introLines as $line) + {!!$line!!} + + @endforeach + + {{-- Action Button --}} + @isset($actionText) + + @component('mail::button', ['url' => $actionUrl, 'color' => $color]) + {!!$actionText!!} + @endcomponent + @endisset + + {{-- Outro Lines --}} + @foreach ($outroLines as $line) + {!!$line!!} + @endforeach + + {{-- Salutation --}} + @if (! empty($salutation)) + {!!$salutation!!} + @endif +@endcomponent diff --git a/resources/views/vendor/nwidart/menus/child/dropdown.blade.php b/resources/views/vendor/nwidart/menus/child/dropdown.blade.php new file mode 100644 index 00000000..e02f1e33 --- /dev/null +++ b/resources/views/vendor/nwidart/menus/child/dropdown.blade.php @@ -0,0 +1,12 @@ + diff --git a/resources/views/vendor/nwidart/menus/child/item.blade.php b/resources/views/vendor/nwidart/menus/child/item.blade.php new file mode 100644 index 00000000..4a1fea66 --- /dev/null +++ b/resources/views/vendor/nwidart/menus/child/item.blade.php @@ -0,0 +1,11 @@ +@if ($item->isDivider()) +
  • +@elseif ($item->isHeader()) + +@else +
  • + + {{ $item->title }} + +
  • +@endif diff --git a/resources/views/vendor/nwidart/menus/default.blade.php b/resources/views/vendor/nwidart/menus/default.blade.php new file mode 100644 index 00000000..a4b286fa --- /dev/null +++ b/resources/views/vendor/nwidart/menus/default.blade.php @@ -0,0 +1,3 @@ + diff --git a/resources/views/vendor/nwidart/menus/item/dropdown.blade.php b/resources/views/vendor/nwidart/menus/item/dropdown.blade.php new file mode 100644 index 00000000..5dc6f342 --- /dev/null +++ b/resources/views/vendor/nwidart/menus/item/dropdown.blade.php @@ -0,0 +1,15 @@ + diff --git a/resources/views/vendor/nwidart/menus/item/item.blade.php b/resources/views/vendor/nwidart/menus/item/item.blade.php new file mode 100644 index 00000000..d2278747 --- /dev/null +++ b/resources/views/vendor/nwidart/menus/item/item.blade.php @@ -0,0 +1,12 @@ +@if ($item->isDivider()) +
  • +@elseif ($item->isHeader()) + +@else +
  • + getAttributes() !!}> + {!! $item->getIcon() !!} + {{ $item->title }} + +
  • +@endif diff --git a/resources/views/vendor/nwidart/menus/menu.blade.php b/resources/views/vendor/nwidart/menus/menu.blade.php new file mode 100644 index 00000000..aef51281 --- /dev/null +++ b/resources/views/vendor/nwidart/menus/menu.blade.php @@ -0,0 +1,7 @@ +@foreach ($items as $item) + @if ($item->hasChilds()) + @include('menus::item.dropdown', compact('item')) + @else + @include('menus::item.item', compact('item')) + @endif +@endforeach diff --git a/resources/views/vendor/nwidart/menus/nav-pills-justified.blade.php b/resources/views/vendor/nwidart/menus/nav-pills-justified.blade.php new file mode 100644 index 00000000..325bd9ee --- /dev/null +++ b/resources/views/vendor/nwidart/menus/nav-pills-justified.blade.php @@ -0,0 +1,3 @@ + diff --git a/resources/views/vendor/nwidart/menus/nav-pills-stacked.blade.php b/resources/views/vendor/nwidart/menus/nav-pills-stacked.blade.php new file mode 100644 index 00000000..dbe0131f --- /dev/null +++ b/resources/views/vendor/nwidart/menus/nav-pills-stacked.blade.php @@ -0,0 +1,3 @@ + diff --git a/resources/views/vendor/nwidart/menus/nav-pills.blade.php b/resources/views/vendor/nwidart/menus/nav-pills.blade.php new file mode 100644 index 00000000..46d91da2 --- /dev/null +++ b/resources/views/vendor/nwidart/menus/nav-pills.blade.php @@ -0,0 +1,3 @@ + diff --git a/resources/views/vendor/nwidart/menus/nav-tabs-justified.blade.php b/resources/views/vendor/nwidart/menus/nav-tabs-justified.blade.php new file mode 100644 index 00000000..03ce5de2 --- /dev/null +++ b/resources/views/vendor/nwidart/menus/nav-tabs-justified.blade.php @@ -0,0 +1,3 @@ + diff --git a/resources/views/vendor/nwidart/menus/nav-tabs.blade.php b/resources/views/vendor/nwidart/menus/nav-tabs.blade.php new file mode 100644 index 00000000..445455b4 --- /dev/null +++ b/resources/views/vendor/nwidart/menus/nav-tabs.blade.php @@ -0,0 +1,3 @@ + diff --git a/resources/views/vendor/nwidart/menus/navbar-left.blade.php b/resources/views/vendor/nwidart/menus/navbar-left.blade.php new file mode 100644 index 00000000..bc2cf1c8 --- /dev/null +++ b/resources/views/vendor/nwidart/menus/navbar-left.blade.php @@ -0,0 +1,3 @@ + diff --git a/resources/views/vendor/nwidart/menus/navbar-right.blade.php b/resources/views/vendor/nwidart/menus/navbar-right.blade.php new file mode 100644 index 00000000..67aa7532 --- /dev/null +++ b/resources/views/vendor/nwidart/menus/navbar-right.blade.php @@ -0,0 +1,3 @@ + diff --git a/resources/views/vendor/nwidart/menus/style.blade.php b/resources/views/vendor/nwidart/menus/style.blade.php new file mode 100644 index 00000000..76f31ec4 --- /dev/null +++ b/resources/views/vendor/nwidart/menus/style.blade.php @@ -0,0 +1,49 @@ + diff --git a/resources/views/vendor/pagination/bootstrap-4.blade.php b/resources/views/vendor/pagination/bootstrap-4.blade.php new file mode 100644 index 00000000..3f984557 --- /dev/null +++ b/resources/views/vendor/pagination/bootstrap-4.blade.php @@ -0,0 +1,36 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/resources/views/vendor/pagination/default.blade.php b/resources/views/vendor/pagination/default.blade.php new file mode 100644 index 00000000..4e795ff4 --- /dev/null +++ b/resources/views/vendor/pagination/default.blade.php @@ -0,0 +1,36 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/resources/views/vendor/pagination/simple-bootstrap-4.blade.php b/resources/views/vendor/pagination/simple-bootstrap-4.blade.php new file mode 100644 index 00000000..a9a18d32 --- /dev/null +++ b/resources/views/vendor/pagination/simple-bootstrap-4.blade.php @@ -0,0 +1,17 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/resources/views/vendor/pagination/simple-default.blade.php b/resources/views/vendor/pagination/simple-default.blade.php new file mode 100644 index 00000000..18016092 --- /dev/null +++ b/resources/views/vendor/pagination/simple-default.blade.php @@ -0,0 +1,17 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/app/Http/routes/admin/contents.php b/routes/admin/contents.php similarity index 100% rename from app/Http/routes/admin/contents.php rename to routes/admin/contents.php diff --git a/app/Http/routes/admin/fileManager.php b/routes/admin/fileManager.php similarity index 100% rename from app/Http/routes/admin/fileManager.php rename to routes/admin/fileManager.php diff --git a/app/Http/routes/admin/settings.php b/routes/admin/settings.php similarity index 100% rename from app/Http/routes/admin/settings.php rename to routes/admin/settings.php diff --git a/app/Http/routes/admin/templates.php b/routes/admin/templates.php similarity index 100% rename from app/Http/routes/admin/templates.php rename to routes/admin/templates.php diff --git a/app/Http/routes/admin/users.php b/routes/admin/users.php similarity index 100% rename from app/Http/routes/admin/users.php rename to routes/admin/users.php diff --git a/app/Http/routes/admin/widgets.php b/routes/admin/widgets.php similarity index 100% rename from app/Http/routes/admin/widgets.php rename to routes/admin/widgets.php diff --git a/app/Http/routes.php b/routes/web.php similarity index 80% rename from app/Http/routes.php rename to routes/web.php index f961866d..6d5248ef 100644 --- a/app/Http/routes.php +++ b/routes/web.php @@ -10,6 +10,8 @@ Route::pattern('id', '\d+'); Route::pattern('url', '[0-9\-a-z]+'); /*******************************************************************************/ +Auth::routes(); +$this->get('logout', 'Auth\LoginController@logout')->name('logout'); Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['bindings']], function () { /** @@ -24,7 +26,7 @@ Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['bi // include all routes in routes/admin subfolder $files = ['contents', 'fileManager', 'settings', 'templates', 'users', 'widgets']; foreach ($files as $file) { - require_once __DIR__ . DIRECTORY_SEPARATOR . 'routes' . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . $file . '.php'; + require_once __DIR__ . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . $file . '.php'; } // display dashboard with some usefull information @@ -38,10 +40,6 @@ Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['bi // search form with results Route::get('search', 'Search@getSearch') ->name('search'); - - // logout method - Route::get('logout', 'Login@logout') - ->name('logout'); }); /**************************************************************************************/ @@ -49,21 +47,12 @@ Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['bi /** * This section must be specified as last one */ - Route::group(['middleware' => ['web']], function () { // Homepage Route::get('/', 'Visitor\Homepage@getIndex') ->name('page.index'); - // display login form - Route::get('admin/login', 'Admin\Login@getLogin') - ->name('loginForm'); - - // handle login - Route::post('admin/login', 'Admin\Login@postLogin') - ->name('login'); - // route for sitemap Route::get('sitemap.xml', 'Visitor\Sitemap@getMap') ->name('sitemap'); @@ -72,4 +61,4 @@ Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['bi Route::get('{url}', 'Visitor\ContentPage@getPage') ->name('page.content'); }); -}); \ No newline at end of file +});