mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-30 08:20:46 +00:00
Update privacy settings views
This commit is contained in:
parent
eaecde7af6
commit
ebaa9980cd
2 changed files with 97 additions and 4 deletions
|
@ -10,10 +10,81 @@
|
|||
<p>
|
||||
<a class="btn btn-outline-secondary py-0 font-weight-bold" href="{{route('settings.privacy.muted-users')}}">Muted Users</a>
|
||||
<a class="btn btn-outline-secondary py-0 font-weight-bold" href="{{route('settings.privacy.blocked-users')}}">Blocked Users</a>
|
||||
<a class="btn btn-outline-primary py-0 font-weight-bold" href="{{route('settings.privacy.blocked-instances')}}">Blocked Instances</a>
|
||||
<a class="btn btn-outline-secondary py-0 font-weight-bold" href="{{route('settings.privacy.blocked-keywords')}}">Blocked keywords</a>
|
||||
<a class="btn btn-outline-primary py-0 font-weight-bold" href="{{route('settings.privacy.blocked-instances')}}">Blocked instances</a>
|
||||
</p>
|
||||
</div>
|
||||
<form method="post">
|
||||
</form>
|
||||
@if($filters->count() > 0)
|
||||
<ul class="list-group list-group-flush">
|
||||
@foreach($filters as $filter)
|
||||
<li class="list-group-item">
|
||||
<div class="d-flex justify-content-between align-items-center font-weight-bold">
|
||||
<span>
|
||||
<span class="pr-5">{{$filter->id}}</span>
|
||||
<span>{{$filter->instance->domain}}</span>
|
||||
</span>
|
||||
<span class="btn-group">
|
||||
<form action="{{route('settings.privacy.blocked-instances.unblock')}}" method="POST">
|
||||
@csrf
|
||||
<input type="hidden" name="id" value="{{$filter->id}}">
|
||||
<button type="submit" class="btn btn-outline-secondary btn-sm px-3 font-weight-bold">Unblock</button>
|
||||
</form>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
<div class="d-flex justify-content-center mt-3 font-weight-bold">
|
||||
{{$filters->links()}}
|
||||
</div>
|
||||
<p>
|
||||
<button type="button" class="btn btn-primary font-weight-bold px-3 blockInstance">Block Instance</button>
|
||||
</p>
|
||||
@else
|
||||
<p>You can block entire instances, this prevents users on that instance from interacting with your content. To understand how blocking works, <a href="#">read more</a> in the Help Center.</p>
|
||||
<p class="lead mb-4">You are not blocking any instances. For a list of instances banned by the admin, click <a href="#">here</a>.</p>
|
||||
<p>
|
||||
<button type="button" class="btn btn-primary font-weight-bold px-3 blockInstance">Block Instance</button>
|
||||
</p>
|
||||
@endif
|
||||
|
||||
@endsection
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('.blockInstance').on('click', function() {
|
||||
swal({
|
||||
text: 'Add domain to block.',
|
||||
content: "input",
|
||||
button: {
|
||||
text: "Block",
|
||||
closeModal: false,
|
||||
},
|
||||
})
|
||||
.then(val => {
|
||||
if (!val) throw null;
|
||||
try {
|
||||
let validator = new URL(val);
|
||||
if(!validator.hostname) throw null;
|
||||
axios.post(window.location.href, {
|
||||
domain: validator.hostname
|
||||
}).then(res => {
|
||||
window.location.href = window.location.href;
|
||||
}).catch(err => {
|
||||
swal.stopLoading();
|
||||
swal.close();
|
||||
swal('An Error Occured', 'An error occured, please try again later.', 'error');
|
||||
});
|
||||
} catch(e) {
|
||||
swal.stopLoading();
|
||||
swal.close();
|
||||
swal('An Error Occured', 'An error occured, please try again later.', 'error');
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@endpush
|
22
resources/views/settings/privacy/blocked-keywords.blade.php
Normal file
22
resources/views/settings/privacy/blocked-keywords.blade.php
Normal file
|
@ -0,0 +1,22 @@
|
|||
@extends('settings.template')
|
||||
|
||||
@section('section')
|
||||
|
||||
<div class="title">
|
||||
<h3 class="font-weight-bold">Blocked Keywords</h3>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="form-group pb-1">
|
||||
<p>
|
||||
<a class="btn btn-outline-secondary py-0 font-weight-bold" href="{{route('settings.privacy.muted-users')}}">Muted Users</a>
|
||||
<a class="btn btn-outline-secondary py-0 font-weight-bold" href="{{route('settings.privacy.blocked-users')}}">Blocked Users</a>
|
||||
<a class="btn btn-outline-primary py-0 font-weight-bold" href="{{route('settings.privacy.blocked-keywords')}}">Blocked keywords</a>
|
||||
<a class="btn btn-outline-secondary py-0 font-weight-bold" href="{{route('settings.privacy.blocked-instances')}}">Blocked instances</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="alert alert-warning border-0">
|
||||
<p class="font-weight-bold mb-0">Unavailable</p>
|
||||
<p class="mb-0">This setting will be released in a future version.</p>
|
||||
</div>
|
||||
|
||||
@endsection
|
Loading…
Reference in a new issue