added some icons, small cleaning, create table page stub, table controller

pull/26/head
Ondřej Hruška 6 years ago
parent 25cb60d377
commit eeaa837c29
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 4
      app/Http/Controllers/HomeController.php
  2. 18
      app/Http/Controllers/TableController.php
  3. 2
      app/Models/Concerns/Reportable.php
  4. 10
      app/Models/User.php
  5. 47
      public/fonts/fa-dtbl-1.css
  6. BIN
      public/fonts/fa-dtbl-1.eot
  7. 55
      public/fonts/fa-dtbl-1.svg
  8. BIN
      public/fonts/fa-dtbl-1.ttf
  9. BIN
      public/fonts/fa-dtbl-1.woff2
  10. 9
      resources/assets/sass/_variables.scss
  11. 17
      resources/assets/sass/app.scss
  12. 27
      resources/views/about/privacy.blade.php
  13. 0
      resources/views/about/terms.blade.php
  14. 19
      resources/views/auth/login.blade.php
  15. 7
      resources/views/auth/register.blade.php
  16. 59
      resources/views/home.blade.php
  17. 94
      resources/views/layouts/app.blade.php
  18. 13
      resources/views/layouts/footer.blade.php
  19. 57
      resources/views/layouts/main-nav.blade.php
  20. 37
      resources/views/privacy.blade.php
  21. 12
      resources/views/table/create.blade.php
  22. 67
      routes/login.php
  23. 69
      routes/web.php

@ -23,6 +23,8 @@ class HomeController extends Controller
*/ */
public function index() public function index()
{ {
return view('home'); $tables = \Auth::user()->tables()->paginate(10);
return view('home')->with(compact('tables'));
} }
} }

@ -0,0 +1,18 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class TableController extends Controller
{
/**
* SHow a form for creating a new table
*
* @return \Illuminate\Http\Response
*/
public function create()
{
return view('table.create');
}
}

@ -12,7 +12,7 @@ use Illuminate\Database\Eloquent\Relations\MorphMany;
*/ */
trait Reportable trait Reportable
{ {
public function bootReportable() public static function bootReportable()
{ {
static::deleting(function(Reportable $self) { static::deleting(function(Reportable $self) {
$self->reportsOf()->delete(); $self->reportsOf()->delete();

@ -7,6 +7,7 @@ use App\Models\Concerns\Reportable;
use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Collection;
use Illuminate\Notifications\Notifiable; use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notification;
/** /**
* A user in the application * A user in the application
@ -126,4 +127,13 @@ class User extends Authenticatable
{ {
$this->followedDiscussions()->detach($table); $this->followedDiscussions()->detach($table);
} }
public function fakeTables()
{
return [
(object)['title' => 'Table 1'],
(object)['title' => 'Table 2'],
(object)['title' => 'Table 3']
];
}
} }

@ -0,0 +1,47 @@
/*!
* Based on Fork Awesome 1.1.0, originaly by Dave Gandy - http://forkawesome.github.io/Fork-Awesome/
* License - http://forkawesome.github.io/Fork-Awesome//license (Font: SIL OFL 1.1, CSS: MIT License)
*/
@font-face {
font-family: 'fa-dtbl-1';
src: url('./fa-dtbl-1.eot?v=1.1.0');
src: url('./fa-dtbl-1.eot?#iefix&v=1.1.0') format('embedded-opentype'),
url('./fa-dtbl-1.woff2?v=1.1.0') format('woff2'),
url('./fa-dtbl-1.ttf?v=1.1.0') format('truetype'),
url('./fa-dtbl-1.svg?v=1.1.0#fa-dtbl-1') format('svg');
font-weight: normal;
font-style: normal;
}
@media screen and (-webkit-min-device-pixel-ratio:0) {
@font-face {
font-family: "fa-dtbl-1";
src: url("./fa-dtbl-1.svg#fa-dtbl-1") format("svg");
}
}
[data-icon]::before { content: attr(data-icon); }
[data-icon]::before, [class^="fa-"]::before, [class*=" fa-"]::before {
display: inline-block;
font-family: "fa-dtbl-1";
font-style: normal;
font-weight: normal;
font-variant: normal;
line-height: 1;
text-decoration: inherit;
font-size: inherit;
text-rendering: optimizeLegibility;
text-transform: none;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-smoothing: antialiased;
}
.fa-facebook-square::before { content: "\f100"; }
.fa-github::before { content: "\f101"; }
.fa-google::before { content: "\f102"; }
.fa-sign-in::before { content: "\f103"; }
.fa-sign-out::before { content: "\f104"; }
.fa-user-circle-o::before { content: "\f105"; }
.fa-user-plus::before { content: "\f106"; }

Binary file not shown.

@ -0,0 +1,55 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<!--
2018-7-16: Created with FontForge (http://fontforge.org)
-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
<metadata>
Created by FontForge 20170805 at Mon Jul 16 22:14:13 2018
By ondra
The Fork Awesome font is licensed under the SIL OFL 1.1 (http://scripts.sil.org/OFL). Fork Awesome is a fork based of off Font Awesome 4.7.0 by Dave Gandy. More info on licenses at https://forkawesome.github.io
</metadata>
<defs>
<font id="fa-dtbl-1" horiz-adv-x="1536" >
<font-face
font-family="fa-dtbl-1"
font-weight="400"
font-stretch="normal"
units-per-em="1792"
panose-1="2 0 5 3 0 0 0 0 0 0"
ascent="1536"
descent="-256"
bbox="0 -256 2048 1536"
underline-thickness="89.6"
underline-position="-179.2"
unicode-range="U+0020-F106"
/>
<missing-glyph />
<glyph glyph-name="space" unicode=" " horiz-adv-x="200"
/>
<glyph glyph-name="facebook-square" unicode="&#xf100;"
d="M1248 1408c159 0 288 -129 288 -288v-960c0 -159 -129 -288 -288 -288h-188v595h199l30 232h-229v148c0 67 18 112 115 112l122 1v207c-21 3 -94 9 -178 9c-177 0 -299 -108 -299 -306v-171h-200v-232h200v-595h-532c-159 0 -288 129 -288 288v960c0 159 129 288 288 288
h960z" />
<glyph glyph-name="github" unicode="&#xf101;"
d="M768 1408c424 0 768 -344 768 -768c0 -339 -220 -627 -525 -729c-39 -7 -53 17 -53 37c0 25 1 108 1 211c0 72 -24 118 -52 142c171 19 351 84 351 379c0 84 -30 152 -79 206c8 20 34 98 -8 204c-64 20 -211 -79 -211 -79c-61 17 -127 26 -192 26s-131 -9 -192 -26
c0 0 -147 99 -211 79c-42 -106 -16 -184 -8 -204c-49 -54 -79 -122 -79 -206c0 -294 179 -360 350 -379c-22 -20 -42 -54 -49 -103c-44 -20 -156 -54 -223 64c-42 73 -118 79 -118 79c-75 1 -5 -47 -5 -47c50 -23 85 -112 85 -112c45 -137 259 -91 259 -91
c0 -64 1 -124 1 -143c0 -20 -14 -44 -53 -37c-305 102 -525 390 -525 729c0 424 344 768 768 768zM291 305c-2 -4 -8 -5 -13 -2c-6 3 -9 8 -7 12c2 3 7 4 13 2c6 -3 9 -8 7 -12zM322 271c-4 -4 -11 -2 -16 3c-5 6 -6 13 -2 16c4 4 11 2 16 -3c5 -6 6 -13 2 -16zM352 226
c-4 -3 -12 0 -17 7s-5 15 0 18c5 4 13 1 17 -6c5 -7 5 -15 0 -19zM394 184c-4 -5 -13 -4 -20 3c-7 6 -9 15 -4 19c4 5 13 4 20 -3c6 -6 8 -15 4 -19zM451 159c-2 -6 -11 -9 -19 -6c-9 2 -15 9 -13 15s11 9 19 7c9 -3 15 -10 13 -16zM514 154c0 -6 -7 -11 -16 -11
c-10 -1 -17 4 -17 11c0 6 7 11 16 11c9 1 17 -4 17 -11zM572 164c1 -6 -5 -12 -14 -14s-17 2 -18 8c-1 7 5 13 14 15c9 1 17 -3 18 -9z" />
<glyph glyph-name="google" unicode="&#xf102;" horiz-adv-x="1505"
d="M768 750h725c7 -39 12 -77 12 -128c0 -438 -294 -750 -737 -750c-425 0 -768 343 -768 768s343 768 768 768c207 0 381 -76 515 -201l-209 -201c-57 55 -157 119 -306 119c-262 0 -476 -217 -476 -485s214 -485 476 -485c304 0 418 218 436 331h-436v264z" />
<glyph glyph-name="sign-in" unicode="&#xf103;"
d="M1184 640c0 -17 -7 -33 -19 -45l-544 -544c-12 -12 -28 -19 -45 -19c-35 0 -64 29 -64 64v288h-448c-35 0 -64 29 -64 64v384c0 35 29 64 64 64h448v288c0 35 29 64 64 64c17 0 33 -7 45 -19l544 -544c12 -12 19 -28 19 -45zM1536 992v-704c0 -159 -129 -288 -288 -288
h-320c-17 0 -32 15 -32 32c0 28 -13 96 32 96h320c88 0 160 72 160 160v704c0 88 -72 160 -160 160h-288c-25 0 -64 -5 -64 32c0 28 -13 96 32 96h320c159 0 288 -129 288 -288z" />
<glyph glyph-name="sign-out" unicode="&#xf104;" horiz-adv-x="1568"
d="M640 96c0 -28 13 -96 -32 -96h-320c-159 0 -288 129 -288 288v704c0 159 129 288 288 288h320c17 0 32 -15 32 -32c0 -28 13 -96 -32 -96h-320c-88 0 -160 -72 -160 -160v-704c0 -88 72 -160 160 -160h288c25 0 64 5 64 -32zM1568 640c0 -17 -7 -33 -19 -45l-544 -544
c-12 -12 -28 -19 -45 -19c-35 0 -64 29 -64 64v288h-448c-35 0 -64 29 -64 64v384c0 35 29 64 64 64h448v288c0 35 29 64 64 64c17 0 33 -7 45 -19l544 -544c12 -12 19 -28 19 -45z" />
<glyph glyph-name="user-circle-o" unicode="&#xf105;" horiz-adv-x="1792"
d="M896 1536c495 0 896 -401 896 -896c0 -492 -399 -896 -896 -896c-496 0 -896 403 -896 896c0 495 401 896 896 896zM1515 185c93 128 149 285 149 455c0 423 -345 768 -768 768s-768 -345 -768 -768c0 -170 56 -327 149 -455c36 179 123 327 306 327
c81 -79 191 -128 313 -128s232 49 313 128c183 0 270 -148 306 -327zM1280 832c0 -212 -172 -384 -384 -384s-384 172 -384 384s172 384 384 384s384 -172 384 -384z" />
<glyph glyph-name="user-plus" unicode="&#xf106;" horiz-adv-x="2048"
d="M704 640c-212 0 -384 172 -384 384s172 384 384 384s384 -172 384 -384s-172 -384 -384 -384zM1664 512h352c17 0 32 -15 32 -32v-192c0 -17 -15 -32 -32 -32h-352v-352c0 -17 -15 -32 -32 -32h-192c-17 0 -32 15 -32 32v352h-352c-17 0 -32 15 -32 32v192
c0 17 15 32 32 32h352v352c0 17 15 32 32 32h192c17 0 32 -15 32 -32v-352zM928 288c0 -70 58 -128 128 -128h256v-238c-49 -36 -111 -50 -171 -50h-874c-160 0 -267 96 -267 259c0 226 53 573 346 573c16 0 27 -7 39 -17c98 -75 193 -122 319 -122s221 47 319 122
c12 10 23 17 39 17c85 0 160 -32 217 -96h-223c-70 0 -128 -58 -128 -128v-192z" />
</font>
</defs></svg>

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Binary file not shown.

@ -1,6 +1,6 @@
// Body // Body
$body-bg: #f5f8fa; $body-bg: white;//$gray-300;
// Typography // Typography
$font-family-sans-serif: "IBM Plex Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif; $font-family-sans-serif: "IBM Plex Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
@ -12,3 +12,10 @@ $link-decoration: none;
$link-hover-color: darken($link-color, 15%); $link-hover-color: darken($link-color, 15%);
$link-hover-decoration: underline; $link-hover-decoration: underline;
$card-cap-bg: lighten($primary, 5);
$card-border-color: $primary;
//$card-border-width: 2px;
$card-border-radius: 5px;
$card-inner-border-radius: 2px;
$list-group-hover-bg: rgba($primary, .1);

@ -1,6 +1,6 @@
// Fonts // Fonts
@import url("https://fonts.googleapis.com/css?family=Raleway:300,400,600"); //@import url("https://fonts.googleapis.com/css?family=Raleway:300,400,600");
// Variables // Variables
@import "bst-base"; @import "bst-base";
@ -9,11 +9,22 @@
.page-navbar { .page-navbar {
background: white; background: white;
border-bottom: 1px solid $gray-400; border-bottom: 1px solid $primary;
box-shadow: 0 -3px 8px rgba(black, 1);
} }
.page-footer { .page-footer {
font-size: 95%; font-size: 95%;
background: $body-bg; background: $body-bg;
border-top: 2px solid white; border-top: 2px dotted $gray-200;
}
.card-header {
color: white;
font-weight: bold;
}
.card {
box-shadow: 0 2px 3px rgba(black, .3);
} }

@ -0,0 +1,27 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">Privacy Statement</div>
<div class="card-body">
<p>
<i>datatable.directory</i> does not collect anything beyond what users
themselves enter in the application, plus limited data from OAuth providers
when a social login is used. User IP addresses and other data, such as the
user agent, are briefly stored in the web server log as a byproduct of the
server operation, and serve debugging purposes only.
</p>
<p>
We do not share private data with any third parties.
</p>
</div>
</div>
</div>
</div>
</div>
@endsection

@ -53,10 +53,14 @@
<div class="col-md-8 offset-md-4"> <div class="col-md-8 offset-md-4">
<button type="submit" class="btn btn-primary"> <button type="submit" class="btn btn-primary">
{{ __('Login') }} {{ __('Login') }}
</button> </button>{{--
<a class="btn btn-link" href="{{ route('password.request') }}"> --}}<a class="btn btn-link" href="{{ route('password.request') }}">
{{ __('Forgot Your Password?') }} {{ __('Forgot Your Password?') }}
</a>{{--
--}}<a class="btn btn-link pl-0" href="{{ route('register') }}">
{{ __('Register') }}
</a> </a>
</div> </div>
</div> </div>
@ -65,29 +69,26 @@
<div class="card-footer bg-white"> <div class="card-footer bg-white">
<div class="form-group row mb-0"> <div class="form-group row mb-0">
<span class="col-md-2 col-form-label text-md-right">{{ __('Log in with') }}</span> <span class="col-md-2 col-form-label text-md-right">{{ __('Login with') }}</span>
<div class="col-md-8"> <div class="col-md-8">
@set('services.oauth_providers.github.client_id') @set('services.oauth_providers.github.client_id')
<a type="submit" href="{{route('oauth-github-authorize')}}" class="btn btn-dark"> <a type="submit" href="{{route('oauth-github-authorize')}}" class="btn btn-dark">
<i class="fa-github pr-1"></i>
{{ __('GitHub') }} {{ __('GitHub') }}
</a> </a>
@endset @endset
{{--@set('services.oauth_providers.stack.client_id')
<a type="submit" href="{{route('oauth-stack-authorize')}}" class="btn btn-dark">
{{ __('StackOverflow') }}
</a>
@endset--}}
@set('services.oauth_providers.google.client_id') @set('services.oauth_providers.google.client_id')
<a type="submit" href="{{route('oauth-google-authorize')}}" class="btn btn-dark"> <a type="submit" href="{{route('oauth-google-authorize')}}" class="btn btn-dark">
<i class="fa-google pr-1"></i>
{{ __('Google') }} {{ __('Google') }}
</a> </a>
@endset @endset
@set('services.oauth_providers.facebook.client_id') @set('services.oauth_providers.facebook.client_id')
<a type="submit" href="{{route('oauth-facebook-authorize')}}" class="btn btn-dark"> <a type="submit" href="{{route('oauth-facebook-authorize')}}" class="btn btn-dark">
<i class="fa-facebook-square pr-1"></i>
{{ __('Facebook') }} {{ __('Facebook') }}
</a> </a>
@endset @endset

@ -71,12 +71,11 @@
</form> </form>
</div> </div>
<div class="card-footer text-muted"> <div class="card-footer bg-white text-muted">
You can also log in with You can also register by logging in with
<a href="{{route('oauth-google-authorize')}}">Google</a>, <a href="{{route('oauth-google-authorize')}}">Google</a>,
<a href="{{route('oauth-github-authorize')}}">GitHub</a>, <a href="{{route('oauth-github-authorize')}}">GitHub</a>,
or <a href="{{route('oauth-facebook-authorize')}}">Facebook</a>, or <a href="{{route('oauth-facebook-authorize')}}">Facebook</a>.
without the need to register.
</div> </div>
</div> </div>
</div> </div>

@ -1,23 +1,50 @@
@extends('layouts.app') @extends('layouts.app')
@section('content') @section('content')
<div class="container"> <div class="container">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-8">
<div class="card"> {{-- Dash card --}}
<div class="card-header">Dashboard</div> <div class="col-md-8">
<div class="card">
<div class="card-body"> <div class="card-header">Dashboard</div>
@if (session('status'))
<div class="alert alert-success" role="alert"> <div class="card-body">
{{ session('status') }} @if (session('status'))
</div> <div class="alert alert-success" role="alert">
@endif {{ session('status') }}
</div>
You are logged in! @endif
</div>
</div> <p>You are logged in!</p>
<p>blabla dashboard things ...</p>
</div>
</div>
</div>
{{-- Table list card --}}
<div class="col-md-4">
<div class="card">
<div class="card-header">
<span class="d-inline-block">Your Tables</span>
<a href="{{route('table.create')}}" class="btn btn-sm btn-outline-light float-right"
style="margin-top:-2px; margin-bottom:-2px;">New</a>
</div>
<div class="list-group list-group-flush">
@if(count($tables) == 0)
<span class="list-group-item">No tables yet.</span>
@else
@foreach($tables as $table)
<a class="list-group-item list-group-item-action" href="">{{ $table->title }}</a>
@endforeach
{{ $tables->links() }}
@endif
</div>
</div> </div>
</div>
</div> </div>
</div> </div>
@endsection @endsection

@ -1,89 +1,31 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> <html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token --> <!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}"> <meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'Laravel') }}</title> <title>{{ config('app.name', 'Laravel') }}</title>
<!-- Scripts --> <!-- Scripts -->
<script src="{{ asset('js/app.js') }}" defer></script> <script src="{{ asset('js/app.js') }}" defer></script>
<!-- Styles --> <!-- Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet"> <link href="{{ asset('css/app.css') }}" rel="stylesheet">
<link href="{{ asset('fonts/fa-dtbl-1.css') }}" rel="stylesheet">
</head> </head>
<body> <body>
<div id="app"> <div id="app">
<nav class="navbar navbar-expand-md navbar-light page-navbar"> @include('layouts.main-nav')
<div class="container">
<a class="navbar-brand" href="{{ url('/') }}">
{{ config('app.name', 'Laravel') }}
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent"> <main class="py-4">
<!-- Left Side Of Navbar --> @yield('content')
<ul class="navbar-nav mr-auto"> </main>
</ul> @include('layouts.footer')
</div>
<!-- Right Side Of Navbar -->
<ul class="navbar-nav ml-auto">
<!-- Authentication Links -->
@guest
<li class="nav-item">
<a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a>
</li>
@else
<li class="nav-item dropdown">
<a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
{{ Auth::user()->name }} <span class="caret"></span>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="{{ route('logout') }}"
onclick="event.preventDefault();
document.getElementById('logout-form').submit();">
{{ __('Logout') }}
</a>
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
@csrf
</form>
</div>
</li>
@endguest
</ul>
</div>
</div>
</nav>
<main class="py-4">
@yield('content')
</main>
<footer class="page-footer text-muted mt-2">
<div class="container py-2 py-md-4">
<ul class="d-flex p-0">
<li class="d-inline-block mr-3"><a href="/about/privacy">Privacy Statement</a>
<li class="d-inline-block mr-3"><a href="/about/terms">Terms of Service</a>
</ul>
<p>
Maintained by <a href="https://www.ondrovo.com/">Ondřej Hruška</a>
(<a href="mailto:ondra@ondrovo.com">ondra@ondrovo.com</a>).<br>
Data tables are licensed CC0 (public domain), unless specified otherwise.
</p>
</div>
</footer>
</div>
</body> </body>
</html> </html>

@ -0,0 +1,13 @@
<footer class="page-footer text-muted mt-2">
<div class="container py-2 py-md-4">
<ul class="d-flex p-0">
<li class="d-inline-block mr-3"><a href="/about/privacy">Privacy Statement</a>
<li class="d-inline-block mr-3"><a href="/about/terms">Terms of Service</a>
</ul>
<p>
Maintained by <a href="https://www.ondrovo.com/">Ondřej Hruška</a>
(<a href="mailto:ondra@ondrovo.com">ondra@ondrovo.com</a>).<br>
Data tables are licensed CC0 (public domain), unless specified otherwise.
</p>
</div>
</footer>

@ -0,0 +1,57 @@
<nav class="navbar navbar-expand-md navbar-light page-navbar">
<div class="container">
<a class="navbar-brand" href="{{ url('/') }}">
{{ config('app.name', 'Laravel') }}
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<!-- Left Side Of Navbar -->
<ul class="navbar-nav mr-auto">
</ul>
<!-- Right Side Of Navbar -->
<ul class="navbar-nav ml-auto">
<!-- Authentication Links -->
@guest
<li class="nav-item">
<a class="nav-link" href="{{ route('login') }}">
<i class="fa-sign-in pr-1"></i>
{{ __('Login') }}
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ route('register') }}">
<i class="fa-user-plus pr-1"></i>
{{ __('Register') }}
</a>
</li>
@else
<li class="nav-item dropdown">
<a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false" v-pre>
<i class="fa-user-circle-o pr-1"></i>
{{ Auth::user()->name }} <span class="caret"></span>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="{{ route('logout') }}"
onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
<i class="fa-sign-out pr-1"></i>
{{ __('Logout') }}
</a>
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
@csrf
</form>
</div>
</li>
@endguest
</ul>
</div>
</div>
</nav>

@ -1,37 +0,0 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">Privacy Statement</div>
<div class="card-body">
<p>
<i>datatable.directory</i> collects visit counts the purpose of submission
popularity ranking and internal statistics. User IP addresses and other
data, such as the user agent string, is briefly stored in the web server
log. This data is the byproduct of the server operation and serves debugging
purposes only.
</p>
<p>
We store users' e-mail addresses for the purpose of login authentication,
together with other profile information entered by the user. Passwords
are securely hashed in the database; nonetheless users are encouraged to
use a unique password generated by a password manager, or use one of the
social login options, which removes the use of a password altogether.
</p>
<p>
We do not share any data with any third parties, and do not use advertising
that would compromise user privacy. The website is supported entirely by
donations.
</p>
</div>
</div>
</div>
</div>
</div>
@endsection

@ -0,0 +1,12 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
{{-- Dash card --}}
<div class="col-md-8">
asdf
</div>
</div>
</div>
@endsection

@ -0,0 +1,67 @@
<?php
use SocialNorm\Exceptions\ApplicationRejectedException;
use SocialNorm\Exceptions\InvalidAuthorizationCodeException;
use SocialNorm\ProviderUser;
Auth::routes();
// ----------------- SOCIAL LOGIN --------------------
function _loginVia($method) {
try {
SocialAuth::login($method, function (\App\Models\User $user, ProviderUser $details) {
// update user name first time user logs in
if (!$user->exists) {
$user->name = $details->nickname ?: ($details->full_name ?: $details->email);
}
// set e-mail from provider data, only if user e-mail is empty
if ("$user->email" === "") {
$user->email = $details->email;
}
});
} catch (ApplicationRejectedException $e) {
abort(401, $e->getMessage());
} catch (InvalidAuthorizationCodeException $e) {
abort(401, $e->getMessage());
}
return Redirect::intended();
};
Route::get('/auth/github/authorize', function() {
return SocialAuth::authorize('github');
})->name('oauth-github-authorize');
Route::get('/auth/github/callback', function() {
return _loginVia('github');
})->name('oauth-github-callback');
Route::get('/auth/google/authorize', function() {
return SocialAuth::authorize('google');
})->name('oauth-google-authorize');
Route::get('/auth/google/callback', function() {
return _loginVia('google');
})->name('oauth-google-callback');
Route::get('/auth/facebook/authorize', function() {
return SocialAuth::authorize('facebook');
})->name('oauth-facebook-authorize');
Route::get('/auth/facebook/callback', function() {
return _loginVia('facebook');
})->name('oauth-facebook-callback');
/*
Route::get('/auth/stack/authorize', function() {
return SocialAuth::authorize('stack');
})->name('oauth-stack-authorize');
Route::get('/auth/stack/callback', function() {
return _loginVia('stack');
})->name('oauth-stack-callback');
*/

@ -1,7 +1,4 @@
<?php <?php
use SocialNorm\Exceptions\ApplicationRejectedException;
use SocialNorm\Exceptions\InvalidAuthorizationCodeException;
use SocialNorm\ProviderUser;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -14,14 +11,14 @@ use SocialNorm\ProviderUser;
| |
*/ */
Auth::routes(); require "login.php";
Route::get('/about/terms', function () { Route::get('/about/terms', function () {
return view('terms'); return view('about.terms');
}); });
Route::get('/about/privacy', function () { Route::get('/about/privacy', function () {
return view('privacy'); return view('about.privacy');
}); });
@ -34,62 +31,4 @@ Route::get('/', function () {
Route::get('/home', 'HomeController@index')->name('home'); Route::get('/home', 'HomeController@index')->name('home');
// ----------------- SOCIAL LOGIN -------------------- Route::get('/table/create', 'TableController@create')->name('table.create');
function _loginVia($method) {
try {
SocialAuth::login($method, function (\App\Models\User $user, ProviderUser $details) {
// update user name first time user logs in
if (!$user->exists) {
$user->name = $details->nickname ?: ($details->full_name ?: $details->email);
}
// set e-mail from provider data, only if user e-mail is empty
if ("$user->email" === "") {
$user->email = $details->email;
}
});
} catch (ApplicationRejectedException $e) {
abort(401, $e->getMessage());
} catch (InvalidAuthorizationCodeException $e) {
abort(401, $e->getMessage());
}
return Redirect::intended();
};
Route::get('/auth/github/authorize', function() {
return SocialAuth::authorize('github');
})->name('oauth-github-authorize');
Route::get('/auth/github/callback', function() {
return _loginVia('github');
})->name('oauth-github-callback');
Route::get('/auth/google/authorize', function() {
return SocialAuth::authorize('google');
})->name('oauth-google-authorize');
Route::get('/auth/google/callback', function() {
return _loginVia('google');
})->name('oauth-google-callback');
Route::get('/auth/facebook/authorize', function() {
return SocialAuth::authorize('facebook');
})->name('oauth-facebook-authorize');
Route::get('/auth/facebook/callback', function() {
return _loginVia('facebook');
})->name('oauth-facebook-callback');
/*
Route::get('/auth/stack/authorize', function() {
return SocialAuth::authorize('stack');
})->name('oauth-stack-authorize');
Route::get('/auth/stack/callback', function() {
return _loginVia('stack');
})->name('oauth-stack-callback');
*/

Loading…
Cancel
Save