Merge pull request #2347 from pixelfed/staging

Update private profiles, add context menu to mute, block or report
This commit is contained in:
daniel 2020-07-25 21:04:58 -06:00 committed by GitHub
commit 6f3f4e9dbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 88 additions and 12 deletions

View File

@ -72,6 +72,9 @@
- Updated comments, fix remote reply bug. ([f330616](https://github.com/pixelfed/pixelfed/commit/f330616))
- Updated PostComponent, add tagged people to mobile layout. ([7a2c2e78](https://github.com/pixelfed/pixelfed/commit/7a2c2e78))
- Updated Tag People, allow untagging yourself. ([c9452639](https://github.com/pixelfed/pixelfed/commit/c9452639))
- Updated ComposeModal.vue, add 451 http code warning. ([b213dcda](https://github.com/pixelfed/pixelfed/commit/b213dcda))
- Updated Profile.vue, add empty follower modal placeholder. ([b542a3c5](https://github.com/pixelfed/pixelfed/commit/b542a3c5))
- Updated private profiles, add context menu to mute, block or report. ([487c4ffc](https://github.com/pixelfed/pixelfed/commit/487c4ffc))
## [v0.10.9 (2020-04-17)](https://github.com/pixelfed/pixelfed/compare/v0.10.8...v0.10.9)
### Added

2
public/js/app.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -3,7 +3,7 @@
"/js/vendor.js": "/js/vendor.js?id=cfad22cce459d8852936",
"/js/ace.js": "/js/ace.js?id=11e5550a450fece75c33",
"/js/activity.js": "/js/activity.js?id=69fa5dc5355caa260a13",
"/js/app.js": "/js/app.js?id=079456a2de46c4046c3b",
"/js/app.js": "/js/app.js?id=d1274e1bbd0cccd6089f",
"/css/app.css": "/css/app.css?id=984ae713647093adf63d",
"/css/appdark.css": "/css/appdark.css?id=464f0e4eef985b4bbf87",
"/css/landing.css": "/css/landing.css?id=e8239ddec8e3731cb474",
@ -11,14 +11,14 @@
"/js/collectioncompose.js": "/js/collectioncompose.js?id=3fd79944492361ec7347",
"/js/collections.js": "/js/collections.js?id=38be4150f3d2ebb15f50",
"/js/components.js": "/js/components.js?id=6fa3a327040cce89d04f",
"/js/compose.js": "/js/compose.js?id=5c64faeceb9f7e5032c3",
"/js/compose.js": "/js/compose.js?id=b1d8d2cd9ede424f210b",
"/js/compose-classic.js": "/js/compose-classic.js?id=283f19c895f4118a2a8b",
"/js/developers.js": "/js/developers.js?id=f75deca5ccf47d43eb07",
"/js/discover.js": "/js/discover.js?id=ea7279e1612a1989941d",
"/js/hashtag.js": "/js/hashtag.js?id=e6b41cab117cb03c7d2a",
"/js/loops.js": "/js/loops.js?id=ac610897b12207c829b9",
"/js/mode-dot.js": "/js/mode-dot.js?id=1225a9aac7a93d5d232f",
"/js/profile.js": "/js/profile.js?id=570db2b9099023739ad2",
"/js/profile.js": "/js/profile.js?id=985bcccda666453c4e7c",
"/js/profile-directory.js": "/js/profile-directory.js?id=611af669221ad8be3068",
"/js/quill.js": "/js/quill.js?id=00f2dca2463b3c9d3920",
"/js/rempos.js": "/js/rempos.js?id=b0e81561d85612cf9aab",

View File

@ -153,6 +153,10 @@ window.App.util = {
let u = url + '/embed';
return '<iframe src="'+u+'" class="pixelfed__embed" style="max-width: 100%; border: 0" width="400" allowfullscreen="allowfullscreen"></iframe><script async defer src="'+window.location.origin +'/embed.js"><\/script>';
})
}
},
clipboard: (function(data) {
return navigator.clipboard.writeText(data);
})
};

View File

@ -700,10 +700,21 @@ export default {
self.page = 2;
}, 300);
}).catch(function(e) {
self.uploading = false;
io.value = null;
swal('Oops, something went wrong!', 'An unexpected error occurred.', 'error');
self.page = 2;
switch(e.response.status) {
case 451:
self.uploading = false;
io.value = null;
swal('Banned Content', 'This content has been banned and cannot be uploaded.', 'error');
self.page = 2;
break;
default:
self.uploading = false;
io.value = null;
swal('Oops, something went wrong!', 'An unexpected error occurred.', 'error');
self.page = 2;
break;
}
});
io.value = null;
self.uploadProgress = 0;

View File

@ -434,6 +434,10 @@
dialog-class="follow-modal"
>
<div class="list-group">
<div v-if="followers.length == 0" class="list-group-item border-0">
<p class="text-center mb-0 font-weight-bold text-muted py-5">
<span class="text-dark">{{profileUsername}}</span> has no followers yet</p>
</div>
<div class="list-group-item border-0 py-1" v-for="(user, index) in followers" :key="'follower_'+index">
<div class="media mb-0">
<a :href="user.url">
@ -452,7 +456,7 @@
<!-- <button class="btn btn-primary font-weight-bold btn-sm py-1">FOLLOW</button> -->
</div>
</div>
<div v-if="followerMore" class="list-group-item text-center" v-on:click="followersLoadMore()">
<div v-if="followers.length && followerMore" class="list-group-item text-center" v-on:click="followersLoadMore()">
<p class="mb-0 small text-muted font-weight-light cursor-pointer">Load more</p>
</div>
</div>

View File

@ -31,6 +31,34 @@
</form>
</span>
@endif
<span class="pl-4">
<i class="fas fa-cog fa-lg text-muted cursor-pointer" data-toggle="modal" data-target="#ctxProfileMenu"></i>
<div class="modal" tabindex="-1" role="dialog" id="ctxProfileMenu">
<div class="modal-dialog modal-dialog-centered modal-sm">
<div class="modal-content">
<div class="modal-body p-0">
<div class="list-group-item cursor-pointer text-center rounded text-dark" onclick="window.App.util.clipboard('{{$user->url()}}');$('#ctxProfileMenu').modal('hide')">
Copy Link
</div>
@auth
<div class="list-group-item cursor-pointer text-center rounded text-dark" onclick="muteProfile()">
Mute
</div>
<a class="list-group-item cursor-pointer text-center rounded text-dark text-decoration-none" href="i/report?type=user&id={{$user->id}}">
Report User
</a>
<div class="list-group-item cursor-pointer text-center rounded text-dark" onclick="blockProfile()">
Block
</div>
@endauth
<div class="list-group-item cursor-pointer text-center rounded text-muted" onclick="$('#ctxProfileMenu').modal('hide')">
Close
</div>
</div>
</div>
</div>
</div>
</span>
</div>
<div class="profile-stats pb-3 d-inline-flex lead">
<div class="font-weight-light pr-5">
@ -51,3 +79,29 @@
</div>
</div>
</div>
@push('scripts')
<script type="text/javascript">
function muteProfile() {
axios.post('/i/mute', {
type: 'user',
item: '{{$user->id}}'
}).then(res => {
$('#ctxProfileMenu').modal('hide');
$('#ctxProfileMenu').hide();
swal('Muted Profile', 'You have successfully muted this profile.', 'success');
});
}
function blockProfile() {
axios.post('/i/block', {
type: 'user',
item: '{{$user->id}}'
}).then(res => {
$('#ctxProfileMenu').modal('hide');
$('#ctxProfileMenu').hide();
swal('Blocked Profile', 'You have successfully blocked this profile.', 'success');
});
}
</script>
@endpush