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 = {
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() {
return new Date;
}),

View file

@ -4,16 +4,16 @@
<div class="card-header bg-white">
<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 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>
</p>
</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">
<span class="sr-only">Loading...</span>
</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">
<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">

View file

@ -280,6 +280,10 @@
</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 class="card border shadow-none mb-3" style="max-width: 18rem;">
<div class="card-body">
@ -561,6 +565,7 @@
beforeMount() {
this.fetchProfile();
this.fetchTimelineApi();
},
mounted() {
@ -591,7 +596,11 @@
}
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
return [
'search' => 'Search',
'home' => 'Home',
'local' => 'Local',
@ -16,5 +15,5 @@ return [
'admin' => 'Admin',
'logout' => 'Logout',
'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>
</li>
<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 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>

View file

@ -47,26 +47,21 @@
</a>
</li>
</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">
<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>
</a>
<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">
<span class="far fa-user pr-1"></span>
{{__('navmenu.myProfile')}}
</a>
<div class="dropdown-divider"></div>
<a class="d-block d-md-none dropdown-item font-weight-bold" href="{{route('discover')}}">
<span class="far fa-compass pr-1"></span>
{{__('navmenu.discover')}}
@ -75,16 +70,10 @@
<span class="far fa-bell pr-1"></span>
Notifications
</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')}}">
<span class="far fa-map pr-1"></span>
{{__('navmenu.publicTimeline')}}
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item font-weight-bold" href="{{route('settings')}}">
<span class="fas fa-cog pr-1"></span>
{{__('navmenu.settings')}}
@ -94,8 +83,8 @@
<span class="fas fa-cogs pr-1"></span>
{{__('navmenu.admin')}}
</a>
<div class="dropdown-divider"></div>
@endif
<div class="dropdown-divider"></div>
<a class="dropdown-item font-weight-bold" href="{{ route('logout') }}"
onclick="event.preventDefault();
document.getElementById('logout-form').submit();">