aboutsummaryrefslogtreecommitdiff
path: root/resources/views
diff options
context:
space:
mode:
Diffstat (limited to 'resources/views')
-rw-r--r--resources/views/.gitkeep0
-rw-r--r--resources/views/auth/login.blade.php68
-rw-r--r--resources/views/auth/passwords/email.blade.php47
-rw-r--r--resources/views/auth/passwords/reset.blade.php70
-rw-r--r--resources/views/auth/register.blade.php82
-rw-r--r--resources/views/contribute.blade.php4
-rw-r--r--resources/views/layouts/master.blade.php32
-rw-r--r--resources/views/stats.blade.php8
-rw-r--r--resources/views/trainer.blade.php6
9 files changed, 299 insertions, 18 deletions
diff --git a/resources/views/.gitkeep b/resources/views/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/resources/views/.gitkeep
+++ /dev/null
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')
+<div class="container">
+ <div class="row">
+ <div class="col-md-8 col-md-offset-2">
+ <div class="panel panel-default">
+ <div class="panel-heading">Login</div>
+ <div class="panel-body">
+ <form class="form-horizontal" role="form" method="POST" action="{{ url('/login') }}">
+ {{ csrf_field() }}
+
+ <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
+ <label for="email" class="col-md-4 control-label">E-Mail Address</label>
+
+ <div class="col-md-6">
+ <input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required autofocus>
+
+ @if ($errors->has('email'))
+ <span class="help-block">
+ <strong>{{ $errors->first('email') }}</strong>
+ </span>
+ @endif
+ </div>
+ </div>
+
+ <div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
+ <label for="password" class="col-md-4 control-label">Password</label>
+
+ <div class="col-md-6">
+ <input id="password" type="password" class="form-control" name="password" required>
+
+ @if ($errors->has('password'))
+ <span class="help-block">
+ <strong>{{ $errors->first('password') }}</strong>
+ </span>
+ @endif
+ </div>
+ </div>
+
+ <div class="form-group">
+ <div class="col-md-6 col-md-offset-4">
+ <div class="checkbox">
+ <label>
+ <input type="checkbox" name="remember"> Remember Me
+ </label>
+ </div>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <div class="col-md-8 col-md-offset-4">
+ <button type="submit" class="btn btn-primary">
+ Login
+ </button>
+
+ <a class="btn btn-link" href="{{ url('/password/reset') }}">
+ Forgot Your Password?
+ </a>
+ </div>
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+@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')
+
+<!-- Main Content -->
+@section('master-content')
+<div class="container">
+ <div class="row">
+ <div class="col-md-8 col-md-offset-2">
+ <div class="panel panel-default">
+ <div class="panel-heading">Reset Password</div>
+ <div class="panel-body">
+ @if (session('status'))
+ <div class="alert alert-success">
+ {{ session('status') }}
+ </div>
+ @endif
+
+ <form class="form-horizontal" role="form" method="POST" action="{{ url('/password/email') }}">
+ {{ csrf_field() }}
+
+ <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
+ <label for="email" class="col-md-4 control-label">E-Mail Address</label>
+
+ <div class="col-md-6">
+ <input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required>
+
+ @if ($errors->has('email'))
+ <span class="help-block">
+ <strong>{{ $errors->first('email') }}</strong>
+ </span>
+ @endif
+ </div>
+ </div>
+
+ <div class="form-group">
+ <div class="col-md-6 col-md-offset-4">
+ <button type="submit" class="btn btn-primary">
+ Send Password Reset Link
+ </button>
+ </div>
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+@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')
+<div class="container">
+ <div class="row">
+ <div class="col-md-8 col-md-offset-2">
+ <div class="panel panel-default">
+ <div class="panel-heading">Reset Password</div>
+
+ <div class="panel-body">
+ <form class="form-horizontal" role="form" method="POST" action="{{ url('/password/reset') }}">
+ {{ csrf_field() }}
+
+ <input type="hidden" name="token" value="{{ $token }}">
+
+ <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
+ <label for="email" class="col-md-4 control-label">E-Mail Address</label>
+
+ <div class="col-md-6">
+ <input id="email" type="email" class="form-control" name="email" value="{{ $email or old('email') }}" required autofocus>
+
+ @if ($errors->has('email'))
+ <span class="help-block">
+ <strong>{{ $errors->first('email') }}</strong>
+ </span>
+ @endif
+ </div>
+ </div>
+
+ <div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
+ <label for="password" class="col-md-4 control-label">Password</label>
+
+ <div class="col-md-6">
+ <input id="password" type="password" class="form-control" name="password" required>
+
+ @if ($errors->has('password'))
+ <span class="help-block">
+ <strong>{{ $errors->first('password') }}</strong>
+ </span>
+ @endif
+ </div>
+ </div>
+
+ <div class="form-group{{ $errors->has('password_confirmation') ? ' has-error' : '' }}">
+ <label for="password-confirm" class="col-md-4 control-label">Confirm Password</label>
+ <div class="col-md-6">
+ <input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>
+
+ @if ($errors->has('password_confirmation'))
+ <span class="help-block">
+ <strong>{{ $errors->first('password_confirmation') }}</strong>
+ </span>
+ @endif
+ </div>
+ </div>
+
+ <div class="form-group">
+ <div class="col-md-6 col-md-offset-4">
+ <button type="submit" class="btn btn-primary">
+ Reset Password
+ </button>
+ </div>
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+@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')
+<div class="container">
+ <div class="row">
+ <div class="col-md-8 col-md-offset-2">
+ <div class="panel panel-default">
+ <div class="panel-heading">Register</div>
+ <div class="panel-body">
+ <form class="form-horizontal" role="form" method="POST" action="{{ url('/register') }}">
+ {{ csrf_field() }}
+
+ <div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
+ <label for="name" class="col-md-4 control-label">Name</label>
+
+ <div class="col-md-6">
+ <input id="name" type="text" class="form-control" name="name" value="{{ old('name') }}" required autofocus>
+
+ @if ($errors->has('name'))
+ <span class="help-block">
+ <strong>{{ $errors->first('name') }}</strong>
+ </span>
+ @endif
+ </div>
+ </div>
+
+ <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
+ <label for="email" class="col-md-4 control-label">E-Mail Address</label>
+
+ <div class="col-md-6">
+ <input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required>
+
+ @if ($errors->has('email'))
+ <span class="help-block">
+ <strong>{{ $errors->first('email') }}</strong>
+ </span>
+ @endif
+ </div>
+ </div>
+
+ <div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
+ <label for="password" class="col-md-4 control-label">Password</label>
+
+ <div class="col-md-6">
+ <input id="password" type="password" class="form-control" name="password" required>
+
+ @if ($errors->has('password'))
+ <span class="help-block">
+ <strong>{{ $errors->first('password') }}</strong>
+ </span>
+ @endif
+ </div>
+ </div>
+
+ <div class="form-group{{ $errors->has('password_confirmation') ? ' has-error' : '' }}">
+ <label for="password-confirm" class="col-md-4 control-label">Confirm Password</label>
+
+ <div class="col-md-6">
+ <input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>
+
+ @if ($errors->has('password_confirmation'))
+ <span class="help-block">
+ <strong>{{ $errors->first('password_confirmation') }}</strong>
+ </span>
+ @endif
+ </div>
+ </div>
+
+ <div class="form-group">
+ <div class="col-md-6 col-md-offset-4">
+ <button type="submit" class="btn btn-primary">
+ Register
+ </button>
+ </div>
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+@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;
</p>
@if(!Auth::check())
- <a class="btn btn-lg btn-primary" href="{{ env('APP_URL') }}contribute?login=yes">Login</a>
- <a class="btn btn-lg btn-success" href="{{ env('APP_URL') }}user/create">Sign up</a>
+ <a class="btn btn-lg btn-primary" href="{{ url('/login') }}">Login</a>
+ <a class="btn btn-lg btn-success" href="{{ url('/register') }}">Sign up</a>
@endif
<h3>Here's how it works:</h3>
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'];
}
?>
<html lang="en">
<head>
- <meta charset="utf-8">
+ <meta charset="utf-8"/>
+ <meta name="csrf-token" content="{{ csrf_token() }}"/>
+
<title>ParseTrainer</title>
- <link rel="stylesheet" href="{{ env('APP_URL') }}vendor/twbs/bootstrap/dist/css/bootstrap.min.css">
- <link rel="stylesheet" href="{{ env('APP_URL') }}public/css/hebrewparsetrainer.css">
+
+ <link rel="stylesheet" href="{{ asset('vendor/twbs/bootstrap/dist/css/bootstrap.min.css') }}"/>
+ <link rel="stylesheet" href="{{ asset('public/css/hebrewparsetrainer.css') }}"/>
<script type="text/javascript">
var app_url = '{{ env('APP_URL') }}';
+ window.Laravel = <?php echo json_encode([ 'csrfToken' => csrf_token() ]); ?>;
</script>
</head>
<body role="application">
@@ -48,22 +51,29 @@ if (Auth::check()) {
<nav>
<ul class="nav nav-pills pull-right">
@foreach($menu as $name => $link)
- <li role="presentation" class="{{ Request::is($link[0]) ? 'active' : '' }}"><a href="{{ env('APP_URL') }}{{ $link[1] }}">{{ $name }}</a></li>
+ <li role="presentation" class="{{ Request::is($link[0]) ? 'active' : '' }}"><a href="{{ url($link[1]) }}">{{ $name }}</a></li>
@endforeach
+ @if(Auth::check())
+ <li role="presentation"><a href="{{ url('/logout') }}" onclick="event.preventDefault();document.getElementById('logout-form').submit();">Logout</a></li>
+ @endif
</ul>
</nav>
- <h2 class="text-muted"><a href="{{ env('APP_URL') }}">ParseTrainer</a></h2>
+ <h2 class="text-muted"><a href="{{ url('/') }}">ParseTrainer</a></h2>
</div>
@yield('master-content')
</div>
- <script src="{{ env('APP_URL') }}vendor/components/jquery/jquery.min.js"></script>
- <script src="{{ env('APP_URL') }}vendor/twbs/bootstrap/dist/js/bootstrap.min.js"></script>
- <script src="{{ env('APP_URL') }}public/js/alerts.js"></script>
- <script src="{{ env('APP_URL') }}public/js/hebrewparsetrainer.js"></script>
+ <script src="{{ asset('vendor/components/jquery/jquery.min.js') }}"></script>
+ <script src="{{ asset('vendor/twbs/bootstrap/dist/js/bootstrap.min.js') }}"></script>
+ <script src="{{ asset('public/js/alerts.js') }}"></script>
+ <script src="{{ asset('public/js/hebrewparsetrainer.js') }}"></script>
@if(Auth::check())
- <script src="{{ env('APP_URL') }}public/js/moderators.js"></script>
+ <script src="{{ asset('public/js/moderators.js') }}"></script>
+
+ <form id="logout-form" action="{{ url('/logout') }}" method="POST" style="display:none;">
+ {{ csrf_field() }}
+ </form>
@endif
</body>
</html>
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;
<h3 class="panel-title">Contribute!</h3>
</div>
<div class="panel-body">
- <p>If this app is useful to you, please consider <a href="{{ env('APP_URL') }}contribute">contributing</a> by adding more verbs to the database!</p>
+ <p>If this app is useful to you, please consider <a href="{{ url('/contribute') }}">contributing</a> by adding more verbs to the database!</p>
@if(!Auth::check())
- <a class="btn btn-success" href="{{ env('APP_URL') }}user/create">Sign up</a>
- or <a href="{{ env('APP_URL') }}contribute?login=yes">login</a>
+ <a class="btn btn-success" href="{{ url('/register') }}">Sign up</a>
+ or <a href="{{ url('/login') }}">login</a>
@endif
</div>
</div>