mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-23 06:51:27 +00:00
Merge pull request #218 from dansup/frontend-ui-refactor
Frontend ui refactor
This commit is contained in:
commit
6f4e596343
38 changed files with 3137 additions and 184 deletions
|
@ -2,9 +2,17 @@
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class SiteController extends Controller
|
class SiteController extends Controller
|
||||||
{
|
{
|
||||||
|
public function changeLocale(Request $request, $locale)
|
||||||
|
{
|
||||||
|
if(!App::isLocale($locale)) {
|
||||||
|
return redirect()->back();
|
||||||
|
}
|
||||||
|
App::setLocale($locale);
|
||||||
|
return redirect()->back();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,10 @@ class CommentPipeline implements ShouldQueue
|
||||||
$target = $status->profile;
|
$target = $status->profile;
|
||||||
$actor = $comment->profile;
|
$actor = $comment->profile;
|
||||||
|
|
||||||
|
if($actor->id === $target->id) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$notification = new Notification;
|
$notification = new Notification;
|
||||||
|
|
|
@ -42,8 +42,10 @@ class Status extends Model
|
||||||
|
|
||||||
public function mediaUrl()
|
public function mediaUrl()
|
||||||
{
|
{
|
||||||
$path = $this->firstMedia()->media_path;
|
$media = $this->firstMedia();
|
||||||
$url = Storage::url($path);
|
$path = $media->media_path;
|
||||||
|
$hash = is_null($media->processed_at) ? md5('unprocessed') : md5($media->created_at);
|
||||||
|
$url = Storage::url($path) . "?v={$hash}";
|
||||||
return url($url);
|
return url($url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
BIN
public/css/app.css
vendored
BIN
public/css/app.css
vendored
Binary file not shown.
BIN
public/fonts/fa-brands-400.eot
Normal file
BIN
public/fonts/fa-brands-400.eot
Normal file
Binary file not shown.
BIN
public/fonts/fa-brands-400.svg
Normal file
BIN
public/fonts/fa-brands-400.svg
Normal file
Binary file not shown.
After Width: | Height: | Size: 586 KiB |
BIN
public/fonts/fa-brands-400.ttf
Normal file
BIN
public/fonts/fa-brands-400.ttf
Normal file
Binary file not shown.
BIN
public/fonts/fa-brands-400.woff
Normal file
BIN
public/fonts/fa-brands-400.woff
Normal file
Binary file not shown.
BIN
public/fonts/fa-brands-400.woff2
Normal file
BIN
public/fonts/fa-brands-400.woff2
Normal file
Binary file not shown.
BIN
public/fonts/fa-regular-400.eot
Normal file
BIN
public/fonts/fa-regular-400.eot
Normal file
Binary file not shown.
BIN
public/fonts/fa-regular-400.svg
Normal file
BIN
public/fonts/fa-regular-400.svg
Normal file
Binary file not shown.
After Width: | Height: | Size: 102 KiB |
BIN
public/fonts/fa-regular-400.ttf
Normal file
BIN
public/fonts/fa-regular-400.ttf
Normal file
Binary file not shown.
BIN
public/fonts/fa-regular-400.woff
Normal file
BIN
public/fonts/fa-regular-400.woff
Normal file
Binary file not shown.
BIN
public/fonts/fa-regular-400.woff2
Normal file
BIN
public/fonts/fa-regular-400.woff2
Normal file
Binary file not shown.
BIN
public/fonts/fa-solid-900.eot
Normal file
BIN
public/fonts/fa-solid-900.eot
Normal file
Binary file not shown.
BIN
public/fonts/fa-solid-900.svg
Normal file
BIN
public/fonts/fa-solid-900.svg
Normal file
Binary file not shown.
After Width: | Height: | Size: 477 KiB |
BIN
public/fonts/fa-solid-900.ttf
Normal file
BIN
public/fonts/fa-solid-900.ttf
Normal file
Binary file not shown.
BIN
public/fonts/fa-solid-900.woff
Normal file
BIN
public/fonts/fa-solid-900.woff
Normal file
Binary file not shown.
BIN
public/fonts/fa-solid-900.woff2
Normal file
BIN
public/fonts/fa-solid-900.woff2
Normal file
Binary file not shown.
BIN
public/js/app.js
vendored
BIN
public/js/app.js
vendored
Binary file not shown.
BIN
public/js/timeline.js
vendored
BIN
public/js/timeline.js
vendored
Binary file not shown.
Binary file not shown.
1
resources/assets/js/bootstrap.js
vendored
1
resources/assets/js/bootstrap.js
vendored
|
@ -17,7 +17,6 @@ try {
|
||||||
window.typeahead = require('./lib/typeahead');
|
window.typeahead = require('./lib/typeahead');
|
||||||
window.Bloodhound = require('./lib/bloodhound');
|
window.Bloodhound = require('./lib/bloodhound');
|
||||||
|
|
||||||
require('./lib/fontawesome-all');
|
|
||||||
require('./components/localstorage');
|
require('./components/localstorage');
|
||||||
require('./components/likebutton');
|
require('./components/likebutton');
|
||||||
require('./components/commentform');
|
require('./components/commentform');
|
||||||
|
|
6
resources/assets/js/components/likebutton.js
vendored
6
resources/assets/js/components/likebutton.js
vendored
|
@ -20,7 +20,7 @@ $(document).ready(function() {
|
||||||
var heart = el.find('.status-heart');
|
var heart = el.find('.status-heart');
|
||||||
|
|
||||||
if(likes.indexOf(id) != -1) {
|
if(likes.indexOf(id) != -1) {
|
||||||
heart.addClass('fas fa-heart').removeClass('far fa-heart');
|
heart.removeClass('far fa-heart').addClass('fas fa-heart');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -40,14 +40,14 @@ $(document).ready(function() {
|
||||||
var heart = el.find('.status-heart');
|
var heart = el.find('.status-heart');
|
||||||
|
|
||||||
if(likes.indexOf(id) > -1) {
|
if(likes.indexOf(id) > -1) {
|
||||||
heart.addClass('far fa-heart').removeClass('fas fa-heart');
|
heart.removeClass('fas fa-heart').addClass('far fa-heart');
|
||||||
likes = likes.filter(function(item) {
|
likes = likes.filter(function(item) {
|
||||||
return item !== id
|
return item !== id
|
||||||
});
|
});
|
||||||
counter.text(count);
|
counter.text(count);
|
||||||
action = 'unlike';
|
action = 'unlike';
|
||||||
} else {
|
} else {
|
||||||
heart.addClass('fas fa-heart').removeClass('far fa-heart');
|
heart.removeClass('far fa-heart').addClass('fas fa-heart');
|
||||||
likes.push(id);
|
likes.push(id);
|
||||||
counter.text(count);
|
counter.text(count);
|
||||||
action = 'like';
|
action = 'like';
|
||||||
|
|
1
resources/assets/js/timeline.js
vendored
1
resources/assets/js/timeline.js
vendored
|
@ -4,6 +4,7 @@ $(document).ready(function() {
|
||||||
let infScroll = new InfiniteScroll( elem, {
|
let infScroll = new InfiniteScroll( elem, {
|
||||||
path: '.pagination__next',
|
path: '.pagination__next',
|
||||||
append: '.timeline-feed',
|
append: '.timeline-feed',
|
||||||
|
status: '.page-load-status',
|
||||||
history: false,
|
history: false,
|
||||||
});
|
});
|
||||||
infScroll.on( 'append', function( response, path, items ) {
|
infScroll.on( 'append', function( response, path, items ) {
|
||||||
|
|
27
resources/assets/sass/custom.scss
vendored
27
resources/assets/sass/custom.scss
vendored
|
@ -172,22 +172,11 @@ body, button, input, textarea {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.fas, .far {
|
|
||||||
font-size: 25px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.far.fa-heart {
|
|
||||||
color: #343a40;
|
|
||||||
}
|
|
||||||
|
|
||||||
.svg-inline--fa.fa-heart.fa-w-16.status-heart.fa-2x {
|
|
||||||
color: #f70ec4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fas.fa-heart {
|
.fas.fa-heart {
|
||||||
|
color: #f70ec4!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@media (max-width: map-get($grid-breakpoints, "md")) {
|
@media (max-width: map-get($grid-breakpoints, "md")) {
|
||||||
.border-md-left-0 {
|
.border-md-left-0 {
|
||||||
border-left:0!important
|
border-left:0!important
|
||||||
|
@ -202,3 +191,15 @@ body, button, input, textarea {
|
||||||
z-index:1020
|
z-index:1020
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes loading-bar {
|
||||||
|
from { background-position: 0 0; }
|
||||||
|
to { background-position: 100vw 0; }
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-page {
|
||||||
|
background-image: linear-gradient(to right, #6736dd, #10c5f8, #10c5f8, #6736dd);
|
||||||
|
width: 100vw;
|
||||||
|
height: .25rem;
|
||||||
|
animation: loading-bar 3s linear infinite;
|
||||||
|
}
|
||||||
|
|
3178
resources/assets/sass/lib/fontawesome.scss
vendored
3178
resources/assets/sass/lib/fontawesome.scss
vendored
File diff suppressed because it is too large
Load diff
|
@ -3,5 +3,7 @@
|
||||||
return [
|
return [
|
||||||
|
|
||||||
'likedPhoto' => 'gefällt dein Foto.',
|
'likedPhoto' => 'gefällt dein Foto.',
|
||||||
|
'startedFollowingYou' => 'folgt dir nun.',
|
||||||
|
'commented' => 'hat deinen Post kommentiert.',
|
||||||
|
|
||||||
];
|
];
|
|
@ -1,5 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'emptyTimeline' => 'Dieser Benutzer hat noch keine Fotos hochgeladen!',
|
'emptyTimeline' => 'Dieser Benutzer hat noch nichts gepostet!',
|
||||||
|
'emptyFollowers' => 'Diesem Benutzer folgt noch niemand!',
|
||||||
|
'emptyFollowing' => 'Dieser Benutzer folgt noch niemanden!',
|
||||||
|
'savedWarning' => 'Nur du kannst sehen was du gespeichert hast',
|
||||||
];
|
];
|
7
resources/lang/de/timeline.php
Normal file
7
resources/lang/de/timeline.php
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
'emptyPersonalTimeline' => 'Deine Timeline ist leer.'
|
||||||
|
|
||||||
|
];
|
|
@ -3,5 +3,7 @@
|
||||||
return [
|
return [
|
||||||
|
|
||||||
'likedPhoto' => 'אהבו את התמונה שלך.',
|
'likedPhoto' => 'אהבו את התמונה שלך.',
|
||||||
|
'startedFollowingYou' => 'התחיל לעקוב אחריך.',
|
||||||
|
'commented' => 'הגיב על הפוסט שלך.',
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="container notification-page" style="min-height: 60vh;">
|
<div class="container notification-page" style="min-height: 60vh;">
|
||||||
<div class="col-12 col-md-8 offset-2">
|
<div class="col-12 col-md-8 offset-md-2">
|
||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
|
|
||||||
@foreach($notifications as $notification)
|
@foreach($notifications as $notification)
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<a href="#" class="text-primary pr-2">Directory</a>
|
<a href="#" class="text-primary pr-2">Directory</a>
|
||||||
<a href="#" class="text-primary pr-2">Profiles</a>
|
<a href="#" class="text-primary pr-2">Profiles</a>
|
||||||
<a href="#" class="text-primary pr-2">Hashtags</a>
|
<a href="#" class="text-primary pr-2">Hashtags</a>
|
||||||
<a href="#" class="text-primary ">Language</a>
|
<a href="{{route('site.language')}}" class="text-primary">Language</a>
|
||||||
<a href="#" class="text-dark float-right">© {{date('Y')}} PixelFed.org</a>
|
<a href="#" class="text-dark float-right">© {{date('Y')}} PixelFed.org</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
19
resources/views/site/language.blade.php
Normal file
19
resources/views/site/language.blade.php
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
@extends('site.partial.template')
|
||||||
|
|
||||||
|
@section('section')
|
||||||
|
|
||||||
|
<div class="title">
|
||||||
|
<h3 class="font-weight-bold">Language</h3>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
<div class="alert alert-info font-weight-bold">We're still working on localization support!</div>
|
||||||
|
<p class="lead">Current Locale: <span class="font-weight-bold">{{App::getLocale()}}</span></p>
|
||||||
|
<p class="lead">Select from one of the supported languages:</p>
|
||||||
|
<ul class="list-group">
|
||||||
|
<a class="list-group-item font-weight-bold" href="/i/lang/en">English</a>
|
||||||
|
</ul>
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@push('meta')
|
||||||
|
<meta property="og:description" content="Language">
|
||||||
|
@endpush
|
|
@ -9,6 +9,9 @@
|
||||||
<li class="nav-item pl-3 {{request()->is('site/help')?'active':''}}">
|
<li class="nav-item pl-3 {{request()->is('site/help')?'active':''}}">
|
||||||
<a class="nav-link lead text-muted" href="{{route('site.help')}}">Help</a>
|
<a class="nav-link lead text-muted" href="{{route('site.help')}}">Help</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item pl-3 {{request()->is('site/language')?'active':''}}">
|
||||||
|
<a class="nav-link lead text-muted" href="{{route('site.language')}}">Language</a>
|
||||||
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<hr>
|
<hr>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -36,6 +36,27 @@
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="page-load-status">
|
||||||
|
<div class="infinite-scroll-request">
|
||||||
|
<div class="d-none fixed-top loading-page"></div>
|
||||||
|
</div>
|
||||||
|
<div class="infinite-scroll-last">
|
||||||
|
<h3>No more content</h3>
|
||||||
|
<p class="text-muted">
|
||||||
|
Maybe you could try
|
||||||
|
<a href="{{route('discover')}}">discovering</a>
|
||||||
|
more people you can follow.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="infinite-scroll-error">
|
||||||
|
<h3>Whoops, an error</h3>
|
||||||
|
<p class="text-muted">
|
||||||
|
Try reloading the page
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="d-flex justify-content-center">
|
<div class="d-flex justify-content-center">
|
||||||
{{$timeline->links()}}
|
{{$timeline->links()}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -27,6 +27,27 @@
|
||||||
|
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="page-load-status">
|
||||||
|
<div class="infinite-scroll-request">
|
||||||
|
<div class="d-none fixed-top loading-page"></div>
|
||||||
|
</div>
|
||||||
|
<div class="infinite-scroll-last">
|
||||||
|
<h3>No more content</h3>
|
||||||
|
<p class="text-muted">
|
||||||
|
Maybe you could try
|
||||||
|
<a href="{{route('discover')}}">discovering</a>
|
||||||
|
more people you can follow.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="infinite-scroll-error">
|
||||||
|
<h3>Whoops, an error</h3>
|
||||||
|
<p class="text-muted">
|
||||||
|
Try reloading the page
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="d-flex justify-content-center">
|
<div class="d-flex justify-content-center">
|
||||||
{{$timeline->links()}}
|
{{$timeline->links()}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -61,6 +61,7 @@ Route::domain(config('pixelfed.domain.app'))->group(function() {
|
||||||
Route::post('like', 'LikeController@store');
|
Route::post('like', 'LikeController@store');
|
||||||
Route::post('follow', 'FollowerController@store');
|
Route::post('follow', 'FollowerController@store');
|
||||||
Route::post('bookmark', 'BookmarkController@store');
|
Route::post('bookmark', 'BookmarkController@store');
|
||||||
|
Route::get('lang/{locale}', 'SiteController@changeLocale');
|
||||||
|
|
||||||
Route::group(['prefix' => 'report'], function() {
|
Route::group(['prefix' => 'report'], function() {
|
||||||
Route::get('/', 'ReportController@showForm')->name('report.form');
|
Route::get('/', 'ReportController@showForm')->name('report.form');
|
||||||
|
@ -123,6 +124,7 @@ Route::domain(config('pixelfed.domain.app'))->group(function() {
|
||||||
Route::view('privacy', 'site.privacy')->name('site.privacy');
|
Route::view('privacy', 'site.privacy')->name('site.privacy');
|
||||||
Route::view('platform', 'site.platform')->name('site.platform');
|
Route::view('platform', 'site.platform')->name('site.platform');
|
||||||
Route::view('libraries', 'site.libraries')->name('site.libraries');
|
Route::view('libraries', 'site.libraries')->name('site.libraries');
|
||||||
|
Route::view('language', 'site.language')->name('site.language');
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::get('p/{username}/{id}/c/{cid}', 'CommentController@show');
|
Route::get('p/{username}/{id}/c/{cid}', 'CommentController@show');
|
||||||
|
|
Loading…
Reference in a new issue