Merge pull request #199 from dansup/frontend-ui-refactor

Frontend UI tweaks
This commit is contained in:
daniel 2018-06-04 22:16:02 -06:00 committed by GitHub
commit 8d95796aa9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 350 additions and 61 deletions

View file

@ -14,7 +14,7 @@ class StatusController extends Controller
{
$user = Profile::whereUsername($username)->firstOrFail();
$status = Status::whereProfileId($user->id)
->withCount('likes')
->withCount(['likes', 'comments'])
->findOrFail($id);
if(!$status->media_path && $status->in_reply_to_id) {
return redirect($status->url());

View file

@ -7,7 +7,7 @@ class Hashtag {
public static function getHashtags($status)
{
$hashtags = false;
preg_match_all("/(#\w+)/u", $status, $matches);
preg_match_all("/(?<!&)(#\w+)/u", $status, $matches);
if ($matches) {
$res = array_count_values($matches[0]);
$hashtags = array_keys($res);

BIN
public/css/app.css vendored

Binary file not shown.

Binary file not shown.

View file

@ -1,3 +1,15 @@
html, body {
min-height:100vh;
}
body {
display: flex;
flex-flow: column;
}
#content {
margin-bottom: auto !important;
}
body, button, input, textarea {
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",
Roboto,Helvetica,Arial,sans-serif;

View file

@ -0,0 +1,19 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are used during authentication for various
| messages that we need to display to the user. You are free to modify
| these language lines according to your application's requirements.
|
*/
'failed' => 'Disse oplysninger stemmer ikke overens med nogen konto.',
'throttle' => 'For mange loginfors&oslash;g. V&aelig;r venlig at pr&oslash;ve igen om :seconds sekunder.',
];

View file

@ -0,0 +1,7 @@
<?php
return [
'likedPhoto' => 'syntes om dit billede.',
];

View file

@ -0,0 +1,19 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Pagination Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are used by the paginator library to build
| the simple pagination links. You are free to change them to anything
| you want to customize your views to better match your application.
|
*/
'previous' => '&laquo; forrige',
'next' => 'n&aelig;ste &raquo;',
];

View file

@ -0,0 +1,22 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Password Reset Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are the default lines which match reasons
| that are given by the password broker for a password update attempt
| has failed, such as for an invalid token or invalid new password.
|
*/
'password' => 'Adgangskode skal v&aelig;re mindst 6 tegn og skal matche bekr&aelig;ftelsen.',
'reset' => 'Din adgangskode er blevet nulstillet!',
'sent' => 'Vi har sendt dig en email med et link, hvor du kan nulstille din adgangskode!',
'token' => 'Dette nulstillingslink er ikke l&aelig;ngere gyldigt.',
'user' => "Vi kan ikke finde en bruger med den emailadresse.",
];

View file

@ -0,0 +1,5 @@
<?php
return [
'emptyTimeline' => 'Denne bruger har ikke postet noget endnu!',
];

View file

@ -0,0 +1,122 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Validation Language Lines
|--------------------------------------------------------------------------
|
| The following language lines contain the default error messages used by
| the validator class. Some of these rules have multiple versions such
| as the size rules. Feel free to tweak each of these messages here.
|
*/
'accepted' => ':attribute skal accepteres.',
'active_url' => ':attribute er ikke en gyldig URL.',
'after' => ':attribute skal v&aelig;re en dato efter :date.',
'after_or_equal' => ':attribute skal v&aelig;re en dato ens med, eller efter :date.',
'alpha' => ':attribute m&aring; kun indeholde bogstaver.',
'alpha_dash' => ':attribute m&aring; kun indeholde bogstaver, tal og bindestreger.',
'alpha_num' => ':attribute m&aring; kun indeholde bogstaver og tal.',
'array' => ':attribute skal v&aelig;re et Array.',
'before' => ':attribute skal v&aelig;re en dato f&oslash;r :date.',
'before_or_equal' => ':attribute skal v&aelig;re en dato f&oslash;r, eller det samme som :date.',
'between' => [
'numeric' => ':attribute skal v&aelig;re mellem :min og :max.',
'file' => ':attribute skal v&aelig;re mellem :min og :max kilobytes.',
'string' => ':attribute skal v&aelig;re mellem :min og :max tegn.',
'array' => ':attribute skal v&aelig;re mellem :min og :max elementer.',
],
'boolean' => ':attribute felt skal v&aelig;re sandt eller falsk.',
'confirmed' => ':attribute bekr&aelig;ftelse matcher ikke.',
'date' => ':attribute er ikke en gyldig dato.',
'date_format' => ':attribute matcher ikke formatet :format.',
'different' => ':attribute og :other skal v&aelig;re forskellige.',
'digits' => ':attribute skal v&aelig;re :digits tal.',
'digits_between' => ':attribute skal v&aelig;re mellem :min og :max tal.',
'dimensions' => ':attribute har ugyldige billeddimensioner.',
'distinct' => ':attribute-felt har en dobbeltv&aelig;rdi.',
'email' => ':attribute skal v&aelig;re en gyldig emailadresse.',
'exists' => 'Den valgte :attribute er ugyldig.',
'file' => ':attribute skal v&aelig;re en fil.',
'filled' => 'Feltet :attribute skal have en v&aelig;rdi.',
'image' => ':attribute skal v&aelig;re et billede.',
'in' => 'Den valgte :attribute er ugyldig.',
'in_array' => ':attribute feltet findes ikke i :other.',
'integer' => ':attribute skal v&aelig;re et heltal.',
'ip' => ':attribute skal v&aelig;re en gyldig IP-adresse.',
'ipv4' => ':attribute skal v&aelig;re en gyldig IPv4 adresse.',
'ipv6' => ':attribute skal v&aelig;re en gyldig IPv6 adresse.',
'json' => ':attribute skal v&aelig;re en gyldig JSON-streng.',
'max' => [
'numeric' => ':attribute m&aring; ikke v&aelig;re st&oslash;rre end :max.',
'file' => ':attribute m&aring; ikke v&aelig;re st&oslash;rre end :max kilobytes.',
'string' => ':attribute m&aring; ikke v&aelig;re st&oslash;rre end :max tegn.',
'array' => ':attribute m&aring; ikke have mere end :max elementer.',
],
'mimes' => ':attribute skal v&aelig;re en fil af typen: :values.',
'mimetypes' => ':attribute skal v&aelig;re en fil af typen: :values.',
'min' => [
'numeric' => ':attribute skal v&aelig;re mindst :min.',
'file' => ':attribute skal v&aelig;re mindst :min kilobytes.',
'string' => ':attribute skal v&aelig;re mindst :min tegn.',
'array' => ':attribute skal v&aelig;re mindst :min elementer.',
],
'not_in' => 'Den valgte :attribute er ugyldig.',
'not_regex' => ':attribute format er ugyldigt.',
'numeric' => ':attribute skal v&aelig;re et tal.',
'present' => ':attribute feltet skal v&aelig;re til stede.',
'regex' => ':attribute format er ugyldigt.',
'required' => ':attribute felt er p&aring;kr&aelig;vet.',
'required_if' => ':attribute felt er p&aring;kr&aelig;vet n&aring;r :other er :value.',
'required_unless' => ':attribute felt er p&aring;kr&aelig;vet medmindre :other er i :values.',
'required_with' => ':attribute felt er p&aring;kr&aelig;vet n&aring;r :values er tilstede.',
'required_with_all' => ':attribute felt er p&aring;kr&aelig;vet n&aring;r :values er tilstede.',
'required_without' => ':attribute felt er p&aring;kr&aelig;vet n&aring;r :values ikke er tilstede.',
'required_without_all' => ':attribute felt er p&aring;kr&aelig;vet n&aring;r ingen af :values er tilstede.',
'same' => ':attribute og :other skal v&aelig;re ens.',
'size' => [
'numeric' => ':attribute skal v&aelig;re :size.',
'file' => ':attribute skal v&aelig;re :size kilobytes.',
'string' => ':attribute skal v&aelig;re :size tegn.',
'array' => ':attribute skal indeholde :size elementer.',
],
'string' => ':attribute skal v&aelig;re en streng.',
'timezone' => ':attribute skal v&aelig;re en gyldig zone.',
'unique' => ':attribute er allerede taget.',
'uploaded' => ':attribute kunne ikke uploades.',
'url' => ':attribute format er ugyldigt.',
/*
|--------------------------------------------------------------------------
| Custom Validation Language Lines
|--------------------------------------------------------------------------
|
| Here you may specify custom validation messages for attributes using the
| convention "attribute.rule" to name the lines. This makes it quick to
| specify a specific custom language line for a given attribute rule.
|
*/
'custom' => [
'attribute-name' => [
'rule-name' => 'custom-message',
],
],
/*
|--------------------------------------------------------------------------
| Custom Validation Attributes
|--------------------------------------------------------------------------
|
| The following language lines are used to swap attribute place-holders
| with something more reader friendly such as E-Mail Address instead
| of "email". This simply helps us make messages a little cleaner.
|
*/
'attributes' => [],
];

View file

@ -6,11 +6,11 @@
</div>
<hr>
<div class="table-responsive">
<table class="table">
<thead class="thead-dark">
<tr>
<th scope="col">#</th>
<th scope="col">Username</th>
<th scope="col">Statuses</th>
<th scope="col">Storage</th>
<th scope="col">Role</th>
@ -21,8 +21,8 @@
@foreach($users as $user)
<tr>
<th scope="row">
<a href="/users/show/{{$user->id}}">
{{$user->id}}
<a href="{{$user->url()}}">
{{$user->username}}
</a>
</th>
<td>{{$user->profile->statuses->count()}}</td>
@ -33,6 +33,7 @@
@endforeach
</tbody>
</table>
</div>
<div class="d-flex justify-content-center mt-5 small">
{{$users->links()}}
</div>

View file

@ -42,3 +42,7 @@
</div>
@endsection
@push('meta')
<meta property="og:description" content="Discover People!">
@endpush

View file

@ -35,3 +35,7 @@
</div>
@endsection
@push('meta')
<meta property="og:description" content="Discover {{$tag->name}}">
@endpush

View file

@ -1,4 +1,4 @@
@extends('layouts.app')
@extends('layouts.app',['title' => 'Welcome to ' . config('app.name')])
@section('content')
<div class="container mt-4">
@ -29,7 +29,7 @@
@endsection
@push('meta')
<link rel="canonical" href="{{request()->url()}}">
<meta property="og:description" content="">
@endpush

View file

@ -7,10 +7,21 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'Laravel') }}</title>
<meta name="robots" content="noimageindex, noarchive">
<meta name="mobile-web-app-capable" content="yes">
<title>{{ $title or config('app.name', 'Laravel') }}</title>
<meta property="og:site_name" content="{{ config('app.name', 'Laravel') }}">
<meta property="og:title" content="{{ $title or config('app.name', 'Laravel') }}">
<meta property="og:type" content="article">
<meta property="og:url" content="{{request()->url()}}">
@stack('meta')
<meta name="medium" content="image">
<meta name="theme-color" content="#10c5f8">
<link rel="canonical" href="{{request()->url()}}">
<link rel="dns-prefetch" href="https://fonts.gstatic.com">
<link rel="dns-prefetch" href="https://cdnjs.cloudflare.com">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/simple-line-icons/2.4.1/css/simple-line-icons.min.css" integrity="sha256-7O1DfUu4pybYI7uAATw34eDrgQaWGOfMV/8erfDQz/Q=" crossorigin="anonymous" />
@ -19,12 +30,10 @@
</head>
<body class="">
@include('layouts.partial.nav')
<main class="">
<main id="content">
@yield('content')
</main>
<div class="align-items-end">
@include('layouts.partial.footer')
</div>
<script type="text/javascript" src="{{ mix('js/app.js') }}"></script>
@stack('scripts')
</body>

View file

@ -1,6 +1,6 @@
<footer>
<div class="container mt-5">
<p class="text-uppercase font-weight-bold small">
<div class="container py-3">
<p class="mb-0 text-uppercase font-weight-bold small">
<a href="{{route('site.about')}}" class="text-primary pr-2">About Us</a>
<a href="{{route('site.help')}}" class="text-primary pr-2">Support</a>
<a href="" class="text-primary pr-2">API</a>

View file

@ -17,13 +17,13 @@
<li><a class="nav-link font-weight-bold text-primary" href="{{ route('login') }}">{{ __('Login') }}</a></li>
<li><a class="nav-link font-weight-bold" href="{{ route('register') }}">{{ __('Register') }}</a></li>
@else
<li class="nav-item">
<li class="nav-item px-2">
<a class="nav-link" href="{{route('discover')}}"><i class="lead icon-compass"></i></a>
</li>
<li class="nav-item px-3">
<li class="nav-item px-2">
<a class="nav-link" href="{{route('notifications')}}"><i class="lead icon-heart"></i></a>
</li>
<li class="nav-item dropdown">
<li class="nav-item dropdown px-2">
<a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
<i class="lead icon-user"></i> <span class="caret"></span>
</a>

View file

@ -1,4 +1,4 @@
@extends('layouts.app')
@extends('layouts.app',['title' => $user->username . "'s followers"])
@section('content')
@ -95,3 +95,8 @@
</div>
</div>
@endsection
@push('meta')
<meta property="og:description" content="{{$user->bio}}">
<meta property="og:image" content="{{$user->avatarUrl()}}">
@endpush

View file

@ -1,4 +1,4 @@
@extends('layouts.app')
@extends('layouts.app',['title' => $user->username . "'s follows"])
@section('content')
@ -95,3 +95,8 @@
</div>
</div>
@endsection
@push('meta')
<meta property="og:description" content="{{$user->bio}}">
<meta property="og:image" content="{{$user->avatarUrl()}}">
@endpush

View file

@ -1,4 +1,4 @@
@extends('layouts.app')
@extends('layouts.app',['title' => $user->username . " on " . config('app.name')])
@section('content')
@ -133,3 +133,9 @@
</div>
@endsection
@push('meta')
<meta property="og:description" content="{{$user->bio}}">
<meta property="og:image" content="{{$user->avatarUrl()}}">
@endpush

View file

@ -10,3 +10,7 @@
<p class="lead">PixelFed is a federated image sharing platform, powered by the <a href="#">ActivityPub</a> protocol.</p>
</section>
@endsection
@push('meta')
<meta property="og:description" content="PixelFed is a federated image sharing platform, powered by the ActivityPub protocol.">
@endpush

View file

@ -7,3 +7,7 @@
</div>
<hr>
@endsection
@push('meta')
<meta property="og:description" content="Banned Instances">
@endpush

View file

@ -7,3 +7,7 @@
</div>
<hr>
@endsection
@push('meta')
<meta property="og:description" content="Features">
@endpush

View file

@ -15,3 +15,7 @@
</ul>
</section>
@endsection
@push('meta')
<meta property="og:description" content="What's Fediverse">
@endpush

View file

@ -7,3 +7,7 @@
</div>
<hr>
@endsection
@push('meta')
<meta property="og:description" content="Help">
@endpush

View file

@ -7,3 +7,7 @@
</div>
<hr>
@endsection
@push('meta')
<meta property="og:description" content="Libraries">
@endpush

View file

@ -10,3 +10,7 @@
<p class="lead">The software that powers this website is called <a href="https://pixelfed.org">PixelFed</a> and anyone can <a href="https://github.com/dansup/pixelfed">download</a> the source code and run their own instance!</p>
</section>
@endsection
@push('meta')
<meta property="og:description" content="Open source in PixelFed">
@endpush

View file

@ -1,4 +1,4 @@
@extends('layouts.app')
@extends('layouts.app',['title' => 'About ' . config('app.name')])
@section('content')

View file

@ -7,3 +7,7 @@
</div>
<hr>
@endsection
@push('meta')
<meta property="og:description" content="Platform/API Terms of Use">
@endpush

View file

@ -78,3 +78,7 @@
</div>
@endsection
@push('meta')
<meta property="og:description" content="Privacy Policy">
@endpush

View file

@ -7,3 +7,7 @@
</div>
<hr>
@endsection
@push('meta')
<meta property="og:description" content="Terms of Use">
@endpush

View file

@ -1,4 +1,4 @@
@extends('layouts.app')
@extends('layouts.app',['title' => $user->username . " posted a photo: " . $status->likes_count . " likes, " . $status->comments_count . " comments" ])
@section('content')
@ -87,3 +87,8 @@
</div>
@endsection
@push('meta')
<meta property="og:description" content="{!! $status->rendered ?? e($status->caption) !!}">
<meta property="og:image" content="{{$status->mediaUrl()}}">
@endpush

View file

@ -8,3 +8,7 @@
</div>
</div>
@endsection
@push('meta')
<meta property="og:description" content="Federated Image Sharing">
@endpush