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 82 additions and 6 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

BIN
public/js/app.js vendored

Binary file not shown.

BIN
public/js/compose.js vendored

Binary file not shown.

BIN
public/js/profile.js vendored

Binary file not shown.

Binary file not shown.

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