public dash and view counting

This commit is contained in:
2018-07-29 11:52:29 +02:00
parent f77b1789fa
commit a79b5ae7d8
37 changed files with 415 additions and 663 deletions
@@ -0,0 +1,9 @@
@if($help)
<i class="fa-question-circle form-help"
data-toggle="tooltip"
data-placement="right"
@if(false!==strpos($help, '<'))
data-html="true"
@endif
title="{{ $help }}"></i>
@endif
+2 -10
View File
@@ -1,11 +1,3 @@
<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"
data-placement="right"
@if(false!==strpos($w->help, '<'))
data-html="true"
@endif
title="{{ $w->help }}"></i>
@endif
<div class="form-help-wrapper col-md-1 {{$mobile ? 'd-inline pl-1 d-md-none':'d-none d-md-block'}} pl-0">
@include('form._help-inner', ['help' => $w->help])
</div>
+1 -1
View File
@@ -2,7 +2,7 @@
<nav class="navbar navbar-expand-md navbar-light page-navbar">
<div class="container">
<a class="navbar-brand" href="{{ url('/') }}" aria-label="Go to Dashboard">
<a class="navbar-brand" href="{{ route('dash') }}" aria-label="Go to Dashboard">
<img src="/images/logo.svg" aria-hidden=true alt="LOGO" height="32px" style="margin: -10px 0" class="mr-2">{{--
--}}datatable.directory
</a>
@@ -6,7 +6,7 @@ $aclass = $dropdown ? 'dropdown-item' : 'nav-link';
@endphp
{!! $li !!}
<a class="{{ $aclass }}" href="{{ route('profile.view', user()->name) }}">
<a class="{{ $aclass }}" href="{{ route('home') }}">
<i class="fa-home fa-pr"></i>{{ __('Your Profile') }}
</a>
@@ -4,9 +4,9 @@
@else
@foreach($tables as $table)
@php
$forks = $table->forks()->count();
$faves = $table->favouritingUsers()->count();
$revs = $table->revisions()->count();
$forks = $table->forks_count;
$faves = $table->favourites_count;
$revs = $table->revisions_count;
$rows = $table->revision->row_count;
@endphp
<a class="list-group-item list-group-item-action"
@@ -16,6 +16,9 @@
@icon(fa-table fa-pr){{ $table->title }}
</div>{{--
--}}<div class="d-inline-block col-5 small text-right">{{--
--}}<span title="Visits" class="d-inline-block" style="min-width: 60px;">
{{ $table->visits }}@icon(fa-eye fa-pl, ~Visits~~)
</span>{{--
--}}<span title="Forks" class="d-inline-block {{$forks==0?'hidden':''}}" style="min-width: 60px;">
{{ $forks }}@icon(fa-code-fork fa-pl, ~Forks~~)
</span>{{--
+1
View File
@@ -63,6 +63,7 @@
<div class="col-md-8 mt-2 mt-md-0">
<div class="card">
<div class="card-header card-header-extra">
@icon(fa-table fa-pr fa-large)
<h2>
@if(authed() && user()->is($user))
Your Tables
+22 -9
View File
@@ -23,13 +23,13 @@
@if(guest() || user()->ownsTable($table))
<a href="" class="btn btn-outline-primary py-1 btn-sm" title="Forks"
data-toggle="tooltip" data-placement="top">
{{ $table->forks()->count() ?: '' }}&nbsp;
{{ $table->forks_count ?: '' }}&nbsp;
@icon(fa-code-fork, sr:Forks)
</a>
<a href="#" class="btn btn-outline-primary py-1 btn-sm"
title="Favourites" data-toggle="tooltip" data-placement="top">
{{ $table->favouritingUsers()->count() ?: '' }}&nbsp;
{{ $table->favourites_count ?: '' }}&nbsp;
@icon(fa-star, sr:Favourites)
</a>
@else
@@ -40,7 +40,7 @@
</a>
<a href="" class="btn btn-outline-primary py-1 btn-sm" title="Fork Count"
data-toggle="tooltip" data-placement="top">
{{ $table->forks()->count() ?: '' }}
{{ $table->forks_count ?: '' }}
</a>
</div>
@@ -59,14 +59,14 @@
<a href="" class="btn btn-outline-primary py-1 btn-sm" title="Favourite Count"
data-toggle="tooltip" data-placement="top">
{{ $table->favouritingUsers()->count() ?: '' }}
{{ $table->favourites_count ?: '' }}
</a>
</div>
@endif
<a href="" class="btn btn-outline-primary py-1 btn-sm" title="Comments"
data-toggle="tooltip" data-placement="top">
{{ $table->comments()->count() ?: '' }}&nbsp;
{{ $table->comments_count ?: '' }}&nbsp;
@icon(fa-comment, sr:Comments)
</a>
</nav>
@@ -91,7 +91,7 @@
@endif
@if($table->origin)
<p class="last-p-mb-0">
<p>
<b>Adapted From</b><br>
{!! Widget::tryLink($table->origin) !!}
</p>
@@ -118,17 +118,30 @@
<tr>
<th class="text-right pr-2">Created</th>
<td>{{ $table->created_at->format("M j, Y") }}</td>
<td>
<span data-toggle="tooltip" data-placement="right" title="{{ $table->created_at->format("G:i:s") }}">
{{ $table->created_at->format("M j, Y") }}
</span>
</td>
</tr>
<tr>
<th class="text-right pr-2">Updated</th>
<td>{{ $table->updated_at->format("M j, Y") }}</td>
<td>
<span data-toggle="tooltip" data-placement="right" title="{{ $table->updated_at->format("G:i:s") }}">
{{ $table->updated_at->format("M j, Y") }}
</span>
</td>
</tr>
<tr>
<th class="text-right pr-2">Revisions</th>
<td>{{ $table->revisions()->count() }}</td>
<td>{{ $table->revisions_count }}</td>
</tr>
<tr>
<th class="text-right pr-2">Visits</th>
<td>{{ $table->visits }}&nbsp;&nbsp;{!! Widget::help('Visitors counted once per day') !!}</td>
</tr>
</tbody>
+72 -6
View File
@@ -3,15 +3,81 @@
@extends('layouts.app')
@section('content')
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">Dashboard</div>
@guest
<div class="row justify-content-center">
<div class="col-md-12 mb-2 mb-md-4">
<div class="card">
<div class="card-body">
<a href="" class="button close" aria-label="Close">
<span aria-hidden="true">&times;</span>@sr(Close)
</a>
<div class="card-body">
<h1>Welcome to the public landing page.</h1>
<h2>Welcome to datatable.directory!</h2>
<p>
This website is a place for sharing useful tables of structured data.
These can be cipher tables, character maps, lists of electronic components,
paper grades, page formats, or scientific datasets, such as lists of countries,
geographic features, celestial bodies, elements, nutrition values, etc.
Anything you can put in a table can be shared here, as long as it conforms to our
<a href="{{route('terms')}}">Terms of Service</a>. You can search, filter, and export
data from our tables to many different formats, such as JSON, XML, C structs, or CSV.
</p>
<p>
The table directory is open to anyone, and can be used without login. However,
you will miss out on some features, like the ability to create or edit tables,
post comments, or save export presets. You can <a href="/register">register</a> using
your e-mail and a password, or through <a href="{{route('oauth-google-authorize')}}">Google</a>,
<a href="{{route('oauth-github-authorize')}}">GitHub</a>,
or <a href="{{route('oauth-facebook-authorize')}}">Facebook</a>.
</p>
</div>
</div>
</div>
</div>
@endif
<div class="row justify-content-center">
<div class="col-md-4">
<div class="card">
<div class="card-header card-header-extra">
@icon(fa-users fa-pr fa-large)
<h2>Users</h2>
<nav class="ml-auto" aria-label="Pages of the user list">
{{ $users->links(null, ['ulClass' => 'pagination-sm mb-0 pagination-outline-light']) }}
</nav>
</div>
<div class="list-group list-group-flush">
@if(count($users) == 0)
<span class="list-group-item">No users yet.</span>
@else
@foreach($users as $user)
<a class="list-group-item list-group-item-action"
href="{{ route('profile.view', $user->name) }}">
@icon(fa-user-circle-o fa-pr){{ $user->title }}<br>
<small>{{ $user->handle }}</small>
</a>
@endforeach
@endif
</div>
</div>
</div>
<div class="col-md-8 mt-2 mt-md-0">
<div class="card">
<div class="card-header card-header-extra">
@icon(fa-table fa-pr fa-large)
<h2>Popular Tables</h2>
<nav class="ml-auto" aria-label="Pages of the table list">
{{ $tables->links(null, ['ulClass' => 'pagination-sm mb-0 pagination-outline-light']) }}
</nav>
</div>
@include('profile._table-list')
</div>
</div>
</div>
@endsection