Merge pull request #1878 from pixelfed/staging

Staging
This commit is contained in:
daniel 2019-12-05 21:12:39 -07:00 committed by GitHub
commit 82f2e5ec2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 47 additions and 24 deletions

BIN
public/js/app.js vendored

Binary file not shown.

BIN
public/js/timeline.js vendored

Binary file not shown.

Binary file not shown.

View file

@ -33,6 +33,32 @@ window.App.boot = function() {
} }
window.App.util = { window.App.util = {
compose: {
post: (function() {
let path = window.location.pathname;
let whitelist = [
'/',
'/timeline/public'
];
if(whitelist.includes(path)) {
$('#composeModal').modal('show');
} else {
window.location.href = '/?a=co';
}
}),
circle: (function() {
console.log('Unsupported method.');
}),
collection: (function() {
console.log('Unsupported method.');
}),
loop: (function() {
console.log('Unsupported method.');
}),
story: (function() {
console.log('Unsupported method.');
}),
},
time: (function() { time: (function() {
return new Date; return new Date;
}), }),

View file

@ -4,16 +4,16 @@
<div class="card-header bg-white"> <div class="card-header bg-white">
<p class="mb-0 d-flex align-items-center justify-content-between"> <p class="mb-0 d-flex align-items-center justify-content-between">
<span><i class="far fa-bell fa-lg text-white"></i></span> <span><i class="far fa-bell fa-lg text-white"></i></span>
<span class="small text-dark text-uppercase font-weight-bold">Notifications</span> <span class="small text-dark text-uppercase font-weight-bold">Alerts</span>
<a class="text-decoration-none text-muted" href="/account/activity"><i class="fas fa-inbox fa-lg"></i></a> <a class="text-decoration-none text-muted" href="/account/activity"><i class="fas fa-inbox fa-lg"></i></a>
</p> </p>
</div> </div>
<div class="card-body loader text-center" style="height: 230px;"> <div class="card-body loader text-center" style="height: 200px;">
<div class="spinner-border" role="status"> <div class="spinner-border" role="status">
<span class="sr-only">Loading...</span> <span class="sr-only">Loading...</span>
</div> </div>
</div> </div>
<div class="card-body pt-2 px-0 py-0 contents" style="max-height: 230px; overflow-y: scroll;"> <div class="card-body pt-2 px-0 py-0 contents" style="max-height: 200px; overflow-y: scroll;">
<div v-if="notifications.length > 0" class="media align-items-center px-3 py-2 border-bottom border-light" v-for="(n, index) in notifications"> <div v-if="notifications.length > 0" class="media align-items-center px-3 py-2 border-bottom border-light" v-for="(n, index) in notifications">
<img class="mr-2 rounded-circle" style="border:1px solid #ccc" :src="n.account.avatar" alt="" width="32px" height="32px" onerror="this.onerror=null;this.src='/storage/avatars/default.png';"> <img class="mr-2 rounded-circle" style="border:1px solid #ccc" :src="n.account.avatar" alt="" width="32px" height="32px" onerror="this.onerror=null;this.src='/storage/avatars/default.png';">
<div class="media-body font-weight-light small"> <div class="media-body font-weight-light small">

View file

@ -280,6 +280,10 @@
</div> </div>
</div> </div>
<div class="mb-4">
<a class="btn btn-light btn-block btn-sm font-weight-bold text-dark mb-3 border" href="/i/compose" data-toggle="modal" data-target="#composeModal"><i class="far fa-plus-square pr-3 fa-lg pt-1"></i> Compose Post</a>
</div>
<div v-if="showTips" class="mb-4 card-tips"> <div v-if="showTips" class="mb-4 card-tips">
<div class="card border shadow-none mb-3" style="max-width: 18rem;"> <div class="card border shadow-none mb-3" style="max-width: 18rem;">
<div class="card-body"> <div class="card-body">
@ -561,6 +565,7 @@
beforeMount() { beforeMount() {
this.fetchProfile(); this.fetchProfile();
this.fetchTimelineApi(); this.fetchTimelineApi();
}, },
mounted() { mounted() {
@ -591,7 +596,11 @@
} }
this.$nextTick(function () { this.$nextTick(function () {
$('[data-toggle="tooltip"]').tooltip() $('[data-toggle="tooltip"]').tooltip();
let u = new URLSearchParams(window.location.search);
if(u.has('a') && u.get('a') == 'co') {
$('#composeModal').modal('show');
}
}); });
}, },

View file

@ -1,7 +1,6 @@
<?php <?php
return [ return [
'search' => 'Search', 'search' => 'Search',
'home' => 'Home', 'home' => 'Home',
'local' => 'Local', 'local' => 'Local',
@ -16,5 +15,5 @@ return [
'admin' => 'Admin', 'admin' => 'Admin',
'logout' => 'Logout', 'logout' => 'Logout',
'directMessages' => 'Direct Messages', 'directMessages' => 'Direct Messages',
'composePost' => 'Compose Post',
]; ];

View file

@ -66,7 +66,7 @@
<a class="nav-link {{request()->is('discover')?'text-dark':'text-lighter'}}" href="/discover"><i class="fas fa-search fa-lg"></i></a> <a class="nav-link {{request()->is('discover')?'text-dark':'text-lighter'}}" href="/discover"><i class="fas fa-search fa-lg"></i></a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<div class="nav-link text-lighter cursor-pointer" data-toggle="modal" data-target="#composeModal"><i class="fas fa-camera fa-lg"></i></div> <div class="nav-link text-lighter cursor-pointer" onclick="App.util.compose.post()"><i class="fas fa-camera fa-lg"></i></div>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link {{request()->is('account/activity')?'text-dark':'text-lighter'}}" href="/account/activity"><i class="far fa-heart fa-lg"></i></a> <a class="nav-link {{request()->is('account/activity')?'text-dark':'text-lighter'}}" href="/account/activity"><i class="far fa-heart fa-lg"></i></a>

View file

@ -47,26 +47,21 @@
</a> </a>
</li> </li>
</div> </div>
<div class="d-none d-md-block">
<li class="nav-item px-md-2">
<div title="Create new post" data-toggle="tooltip" data-placement="bottom">
<a href="{{route('compose')}}" class="nav-link" data-toggle="modal" data-target="#composeModal">
<i class="fas fa-camera-retro fa-lg text-muted"></i>
</a>
</div>
</li>
</div>
<li class="nav-item dropdown ml-2"> <li class="nav-item dropdown ml-2">
<a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="User Menu" data-toggle="tooltip" data-placement="bottom"> <a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="User Menu" data-toggle="tooltip" data-placement="bottom">
<i class="far fa-user fa-lg text-muted"></i> <i class="far fa-user fa-lg text-muted"></i>
</a> </a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown"> <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
<div class="dropdown-item font-weight-bold cursor-pointer" onclick="App.util.compose.post()">
<span class="fas fa-camera-retro pr-1"></span>
{{__('navmenu.composePost')}}
</div>
<div class="dropdown-divider"></div>
<a class="dropdown-item font-weight-bold" href="/i/me"> <a class="dropdown-item font-weight-bold" href="/i/me">
<span class="far fa-user pr-1"></span> <span class="far fa-user pr-1"></span>
{{__('navmenu.myProfile')}} {{__('navmenu.myProfile')}}
</a> </a>
<div class="dropdown-divider"></div>
<a class="d-block d-md-none dropdown-item font-weight-bold" href="{{route('discover')}}"> <a class="d-block d-md-none dropdown-item font-weight-bold" href="{{route('discover')}}">
<span class="far fa-compass pr-1"></span> <span class="far fa-compass pr-1"></span>
{{__('navmenu.discover')}} {{__('navmenu.discover')}}
@ -75,16 +70,10 @@
<span class="far fa-bell pr-1"></span> <span class="far fa-bell pr-1"></span>
Notifications Notifications
</a> </a>
<div class="dropdown-divider"></div>
<a class="dropdown-item font-weight-bold" href="{{route('timeline.personal')}}">
<span class="fas fa-home pr-1"></span>
{{__('navmenu.myTimeline')}}
</a>
<a class="dropdown-item font-weight-bold" href="{{route('timeline.public')}}"> <a class="dropdown-item font-weight-bold" href="{{route('timeline.public')}}">
<span class="far fa-map pr-1"></span> <span class="far fa-map pr-1"></span>
{{__('navmenu.publicTimeline')}} {{__('navmenu.publicTimeline')}}
</a> </a>
<div class="dropdown-divider"></div>
<a class="dropdown-item font-weight-bold" href="{{route('settings')}}"> <a class="dropdown-item font-weight-bold" href="{{route('settings')}}">
<span class="fas fa-cog pr-1"></span> <span class="fas fa-cog pr-1"></span>
{{__('navmenu.settings')}} {{__('navmenu.settings')}}
@ -94,8 +83,8 @@
<span class="fas fa-cogs pr-1"></span> <span class="fas fa-cogs pr-1"></span>
{{__('navmenu.admin')}} {{__('navmenu.admin')}}
</a> </a>
<div class="dropdown-divider"></div>
@endif @endif
<div class="dropdown-divider"></div>
<a class="dropdown-item font-weight-bold" href="{{ route('logout') }}" <a class="dropdown-item font-weight-bold" href="{{ route('logout') }}"
onclick="event.preventDefault(); onclick="event.preventDefault();
document.getElementById('logout-form').submit();"> document.getElementById('logout-form').submit();">