logo, improved listing, some helpers, mail confirms table, confirmed flag, user title column..

This commit is contained in:
2018-07-22 15:43:17 +02:00
parent 9081b38425
commit a3ba68ea98
47 changed files with 1462 additions and 292 deletions
+2 -2
View File
@@ -10,12 +10,12 @@
@import "~bootstrap/scss/transitions";
@import "~bootstrap/scss/dropdown";
@import "~bootstrap/scss/button-group";
//@import "~bootstrap/scss/input-group";
@import "~bootstrap/scss/input-group";
@import "~bootstrap/scss/custom-forms";
//@import "~bootstrap/scss/nav";
@import "~bootstrap/scss/navbar";
@import "~bootstrap/scss/card";
//@import "~bootstrap/scss/breadcrumb";
@import "~bootstrap/scss/breadcrumb";
@import "~bootstrap/scss/pagination";
@import "~bootstrap/scss/badge";
//@import "~bootstrap/scss/jumbotron";
+19
View File
@@ -7,15 +7,33 @@
@import "variables";
@import "bst-modules";
// generic hiding class
.hidden {
display: none !important;
}
// padding right for icons (must not use space next to it!)
.fa-pr::before {
margin-right: ($spacer*.5);
}
// button in card header, adjusting margins to not stretch the header
.card-header .btn {
margin-top: -3px;
margin-bottom: -10px;
}
html {
overflow-y: scroll;
}
// help bubble icon
.form-help {
display: inline-block;
margin-top: $form-text-margin-top;
}
// tooltip tweaking
.tooltip-inner {
text-align: left;
}
@@ -24,6 +42,7 @@ html {
box-shadow: 0 2px 5px rgba(black, .3);
}
// layout tweaks
.page-navbar {
background: white;
border-bottom: 1px solid $primary;
+4 -4
View File
@@ -13,12 +13,12 @@
@php(Widget::setLayout(4, 6))
{!! Widget::text('name', 'Name')->required()->autofocus()
{!! Widget::text('name', 'Username')->required()->prepend('@')
->help('This will be part of your vanity URL; only letters, digits and
some symbols are allowed. You can always change this later, and even
set a different Display Name.') !!}
some symbols are allowed. You can always change this later.') !!}
{!! Widget::email('email', 'E-Mail Address')->required()->autofocus() !!}
{!! Widget::email('email', 'E-Mail Address')->required()->autofocus()
->help('Used to login and for password reset e-mails') !!}
{!! Widget::password('password', 'Password')->required() !!}
{!! Widget::password('password_confirmation', 'Confirm Password')->required() !!}
+1 -1
View File
@@ -1,4 +1,4 @@
<div class="col-md-1 pl-0">
<div class="col-md-1 {{$mobile ? 'd-inline pl-1 d-md-none':'d-none d-md-block'}} pl-0">
@if($w->help)
<i class="fa-question-circle form-help"
data-toggle="tooltip"
+5 -2
View File
@@ -9,7 +9,10 @@
id="field-{{ $w->name }}"
{{+$w->value?'checked':''}}
name="{{ $w->name }}">
<label class="custom-control-label" for="field-{{ $w->name }}">{{ $w->label }}</label>
<label class="custom-control-label" for="field-{{ $w->name }}">
{{ $w->label }}
</label>
@include('form._help', ['mobile' => true])
</div>
@if ($errors->has($w->name))
@@ -18,5 +21,5 @@
</span>
@endif
</div>
@include('form._help')
@include('form._help', ['mobile' => false])
</div>
+29 -12
View File
@@ -3,19 +3,36 @@
@endphp
<div class="row form-group">
<label for="field-{{ $w->name }}" class="col-md-{{$w->labelCols}} col-form-label text-md-right">{{ $w->label }}</label>
<label for="field-{{ $w->name }}" class="col-md-{{$w->labelCols}} col-form-label text-md-right">
{{ $w->label }}
@include('form._help', ['mobile' => true])
</label>
<div class="col-md-{{$w->fieldCols}}">
<input id="field-{{ $w->name }}"
name="{{ $w->name }}"
class="form-control{{ $errors->has($w->name) ? ' is-invalid' : '' }}"
value="{{ $w->value }}"
{!! $w->attributes !!}>
<div class="input-group">
@if($w->prepend)
<div class="input-group-prepend">
<span class="input-group-text">{{$w->prepend}}</span>
</div>
@endif
@if ($errors->has($w->name))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first($w->name) }}</strong>
</span>
@endif
<input id="field-{{ $w->name }}"
name="{{ $w->name }}"
class="form-control{{ $errors->has($w->name) ? ' is-invalid' : '' }}"
value="{{ $w->value }}"
{!! $w->attributes !!}>
@if($w->append)
<div class="input-group-append">
<span class="input-group-text">{{$w->append}}</span>
</div>
@endif
@if ($errors->has($w->name))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first($w->name) }}</strong>
</span>
@endif
</div>
</div>
@include('form._help')
@include('form._help', ['mobile' => false])
</div>
+5 -2
View File
@@ -3,7 +3,10 @@
@endphp
<div class="row form-group">
<label for="field-{{ $w->name }}" class="col-md-{{$w->labelCols}} col-form-label text-md-right">{{ $w->label }}</label>
<label for="field-{{ $w->name }}" class="col-md-{{$w->labelCols}} col-form-label text-md-right">
{{ $w->label }}
@include('form._help', ['mobile' => true])
</label>
<div class="col-md-{{$w->fieldCols}}">
<textarea id="field-{{ $w->name }}"
name="{{ $w->name }}"
@@ -16,5 +19,5 @@
</span>
@endif
</div>
@include('form._help')
@include('form._help', ['mobile' => false])
</div>
-52
View File
@@ -1,52 +0,0 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
{{-- Dash card --}}
<div class="col-md-8">
<div class="card">
<div class="card-header">Dashboard</div>
<div class="card-body">
@if (session('status'))
<div class="alert alert-success" role="alert">
{{ session('status') }}
</div>
@endif
<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="{{route('table.view', ['user' => Auth::user()->name, 'table' => $table->name])}}">{{
$table->title
}}</a>
@endforeach
{{ $tables->links() }}
@endif
</div>
</div>
</div>
</div>
</div>
@endsection
+2
View File
@@ -1,3 +1,5 @@
{{-- Global footer --}}
<footer class="page-footer text-muted mt-2">
<div class="container py-2 py-md-4">
<ul class="d-flex p-0">
+10 -7
View File
@@ -1,7 +1,10 @@
{{-- Global navbar --}}
<nav class="navbar navbar-expand-md navbar-light page-navbar">
<div class="container">
<a class="navbar-brand" href="{{ url('/') }}">
{{ config('app.name', 'Laravel') }}
<img src="/images/logo.svg" alt="Logo" height="32px" style="margin: -10px 0" class="mr-2">{{--
--}}datatable.directory
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
@@ -17,7 +20,7 @@
<!-- Right Side Of Navbar -->
<ul class="navbar-nav ml-auto">
<!-- Authentication Links -->
@guest
@guest()
<li class="nav-item">
<a class="nav-link" href="{{ route('login') }}">
<i class="fa-sign-in pr-1"></i>
@@ -34,15 +37,15 @@
<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>
<i class="fa-user-circle-o fa-pr"></i>{{--
--}}{{ user()->title }} <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') }}
<i class="fa-sign-out fa-pr"></i>{{--
--}}{{ __('Logout') }}
</a>
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
@@ -50,7 +53,7 @@
</form>
</div>
</li>
@endguest
@endif
</ul>
</div>
</div>
+15 -6
View File
@@ -1,24 +1,33 @@
{{-- New table form --}}
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="row">
<h2 class="col-md-8 offset-md-3">New Table</h2>
</div>
</div>
</div>
<form method="POST" action="{{route('table.storeNew')}}" class="row justify-content-center"
aria-label="New Table">
<h2>New Table</h2>
@csrf
<div class="col-md-8">
@php(Widget::setLayout(3, 8))
{!! Widget::text('title', 'Title')->autoAlias('name', '-')
->help('Unique among your tables') !!}
{!! Widget::text('name', 'Name')->value('molluscs-'.uniqid())
{!! Widget::text('name', 'Name')->value('')->prepend(user()->handle.' /')
->help('Unique among your tables, and part of the URL; only letters, digits and
some symbols are allowed.') !!}
{!! Widget::textarea('description', 'Description')->height('8em')
->help('Description what data is in the table. Please use the dedicated
fields for License and data source. URLs in a full format will be clickable.') !!}
->help('Description of the table. URLs in a full format will be clickable.') !!}
{!! Widget::text('license', 'License')
->help('License applicable to the table\'s data, if any. By default, all
@@ -47,7 +56,7 @@
<div class="row form-group">
<div class="col-md-8 offset-md-3">
<button type="submit" class="btn btn-primary">
<i class="fa-save pr-2"></i>Create New Table
<i class="fa-save pr-2"></i>Create Table
</button>
</div>
</div>
+2
View File
@@ -1,3 +1,5 @@
{{-- Basic table view --}}
@extends('layouts.app')
@php
+120
View File
@@ -0,0 +1,120 @@
{{-- User's dashboard / profile page --}}
@extends('layouts.app')
@php
/** @var \App\Models\Table[] $tables */
/** @var \App\Models\User $user */
@endphp
@section('content')
<div class="container">
<div class="row justify-content-center">
{{-- Dash card --}}
<div class="col-md-4">
<div class="card">
<div class="card-header">
<i class="fa-user-circle-o pr-1"></i>
{{ $user->title }}
@if(authed() && user()->is($user))
<a href="{{route('user.edit')}}" class="btn btn-sm btn-outline-light float-right">Edit</a>
@endif
</div>
<div class="card-body">
@if (session('status'))
<div class="alert alert-success" role="alert">
{{ session('status') }}
</div>
@endif
@if($user->bio)
@if(mb_strlen($user->bio) > 250)
<p id="bio-short" aria-hidden=true>
{{mb_substr($user->bio, 0, 250)}}…
<a class="text-muted small" title="Show more" href="#" onclick="$('#bio-short').addClass('hidden'); $('#bio-full').removeClass('hidden'); return false;">
[more]
</a>
</p>
<p id="bio-full" class="hidden">
{{ $user->bio }}
<a class="text-muted small" title="Collapse" href="#" onclick="$('#bio-full').addClass('hidden'); $('#bio-short').removeClass('hidden'); return false;">
[collapse]
</a>
</p>
@else
<p>
{{ $user->bio }}
</p>
@endif
@endif
@if($user->website)
<p>
<i class="fa-link fa-pr" aria-label="User's Website" title="User's Website"></i>{{--
--}}<a href="{{ $user->website }}">{{ $user->website }}</a>
</p>
@endif
<p class="mb-0">
<i class="fa-calendar fa-pr" aria-hidden=true></i>{{--
--}}Joined {{ $user->created_at->diffForHumans() }}
</p>
</div>
</div>
</div>
{{-- Table list card --}}
<div class="col-md-8">
<div class="card">
<div class="card-header">
<span class="d-inline-block">
@if(authed() && user()->is($user))
Your Tables
@else
User's Tables
@endif
</span>
@if(authed() && user()->is($user))
<a href="{{route('table.create')}}" class="btn btn-sm btn-outline-light float-right">New</a>
@endif
</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="{{route('table.view', ['user' => $user->name, 'table' => $table->name])}}">
<span class="d-block row">
<span class="d-inline-block col-10">
<i class="fa-table fa-pr"></i>{{ $table->title }}
</span>{{--
--}}<span class="d-inline-block col-2 small text-right">
{{ $table->revision->row_count }} rows
</span>
</span>
<span class="d-block small row">
<span class="d-inline-block col-8">
{{ ellipsis($table->description, 215) }}
</span>{{--
--}}<span class="d-inline-block col-4 text-right text-muted">
Last change {{ $table->updated_at->diffForHumans() }}
</span>
</span>
</a>
@endforeach
{{ $tables->links() }}
@endif
</div>
</div>
</div>
</div>
</div>
@endsection
+14 -12
View File
@@ -1,17 +1,19 @@
{{-- Public landing page --}}
@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">Dashboard</div>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">Dashboard</div>
<div class="card-body">
<h1>Welcome to the public landing page.</h1>
</div>
</div>
</div>
</div>
</div>
<div class="card-body">
<h1>Welcome to the public landing page.</h1>
</div>
</div>
</div>
</div>
</div>
@endsection