From afe18e02ed417e712428320a1049589e447d2ac1 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 12 Feb 2019 01:13:38 -0700 Subject: [PATCH] Update admin views --- resources/views/admin/profiles/edit.blade.php | 234 ++++++++++++++ resources/views/admin/profiles/home.blade.php | 295 ++++++++++++++++-- resources/views/admin/reports/home.blade.php | 6 +- 3 files changed, 500 insertions(+), 35 deletions(-) create mode 100644 resources/views/admin/profiles/edit.blade.php diff --git a/resources/views/admin/profiles/edit.blade.php b/resources/views/admin/profiles/edit.blade.php new file mode 100644 index 000000000..7d96dfe90 --- /dev/null +++ b/resources/views/admin/profiles/edit.blade.php @@ -0,0 +1,234 @@ +@extends('admin.partial.template-full') + +@section('section') +
+ Back +

Edit Profile

+ Enable Editing +
+
+ +
+
+
+
+ +
+ {{-- --}} +
+
+
+ + + @if($user) + + + + + @endif + + + + + + + + + + + + + + + + + @if($user) + + + + + @endif + +
user id{{$user->id}}
profile id{{$profile->id}}
username + {{$profile->username}} + @if($user && $user->is_admin == true) + Admin + @endif +
display name{{$profile->name}}
joined{{$profile->created_at->format('M j Y')}}
email + {{$user->email}} + @if($user->email_verified_at) + Verified + @else + Unverified + @endif +
+ {{--
+

+ {{$profile->username}} +

+

+ {{$profile->emailUrl()}} +

+

+ Member Since: {{$profile->created_at->format('M Y')}} +

+
--}} +
+
+
+
+
+
+

{{$profile->statusCount()}}

+

Posts

+
+
+
+
+
+
+

{{$profile->followingCount()}}

+

Following

+
+
+
+
+
+
+

{{$profile->followerCount()}}

+

Followers

+
+
+
+
+
+
+

{{$profile->bookmarks()->count()}}

+

Bookmarks

+
+
+
+
+
+
+

{{$profile->likes()->count()}}

+

Likes

+
+
+
+
+
+
+

{{$profile->reports()->count()}}

+

Reports Made

+
+
+
+
+
+
+

{{PrettyNumber::size($profile->media()->sum('size'))}}

+

Storage Used

+
+
+
+
+ +
+ {{--
+
+ Account Settings +
+
+
+ + +
+
+ + +
+
+ + +

+ @if($user->email_verified_at) + Verified for {{$user->email_verified_at->diffForHumans()}} + @else + Unverified email. + @endif +

+
+
+
+
--}} +
+
+ Account Actions +
+
+ +
+
+ @csrf + + +

Adds a CW to every post made by this account.

+
+
+
+
+ @csrf + + +

Removes account from public/network timelines.

+
+
+
+
+ @csrf + + +

Do not transform mentions, hashtags or urls into HTML.

+
+
+
+
+ @csrf + + +

Temporarily disable account until next time user log in.

+
+
+ +
+
+ @csrf + + +

This prevents any new interactions, without deleting existing data.

+
+
+ +
+
+ @csrf + + +

This disables the account and changes the password, forcing account to reset password via verified email.

+
+
+ +
+
+ @csrf + + +

Permanently delete this account.

+
+
+
+
+@endsection \ No newline at end of file diff --git a/resources/views/admin/profiles/home.blade.php b/resources/views/admin/profiles/home.blade.php index dbcef56d2..80017bc61 100644 --- a/resources/views/admin/profiles/home.blade.php +++ b/resources/views/admin/profiles/home.blade.php @@ -4,10 +4,22 @@

Profiles

- + - + - -

- CW - Remote Media - Images - Videos - Stories - Banned - Reported - Unlisted -


-@if(request()->input('layout') == 'list') +@if(request()->input('layout') !== 'card') +
+
+ + + 0 + + items selected + + + + + Apply + + +
+
- + + - - - + + + @foreach($profiles as $profile) - + + + + + + + @endforeach
+
+ + +
+
- ID - - Username + + ID + @if(request()->filter && request()->filter == 'id' && request()->order == 'asc') + + @else + + @endif + - Statuses + + Username + @if(request()->filter && request()->filter == 'username' && request()->order == 'asc') + + @else + + @endif + - Storage + + + Followers + @if(request()->filter && request()->filter == 'followers_count' && request()->order == 'asc') + + @else + + @endif + + + + Likes + @if(request()->filter && request()->filter == 'likes_count' && request()->order == 'asc') + + @else + + @endif + + + + Statuses + @if(request()->filter && request()->filter == 'statuses_count' && request()->order == 'asc') + + @else + + @endif + + + + Storage + + Actions
- {{$profile->id}} + +
+ + +
+ {{$profile->id}} + + {{$profile->username}} + + {{$profile->followers()->count()}} + + {{$profile->likes()->count()}} + + {{$profile->statuses()->count()}} + +
{{$profile->media()->sum('size')}} bytes
+ +
+ Edit +
- {{$profiles->links()}} + {{$profiles->appends([ + 'layout'=>request()->layout, + 'search'=>request()->search, + 'filter'=>request()->filter, + 'order'=>request()->order + ])->links()}}
@else
@@ -84,7 +188,7 @@
- +

{{$profile->username}}

@@ -112,7 +216,12 @@ @endforeach
- {{$profiles->links()}} + {{$profiles->appends([ + 'layout'=>request()->layout, + 'search'=>request()->search, + 'filter'=>request()->filter, + 'order'=>request()->order + ])->links()}}
@endif @endsection @@ -124,7 +233,8 @@ display: none; } -.user-row:hover { +.user-row:hover, +.user-row-active { background-color: #eff8ff; } .user-row:hover .action-row { @@ -140,5 +250,128 @@ $('.filesize').each(function(k,v) { $(this).text(filesize(v.getAttribute('data-size'), {unix:true, round:0})) }); + $('.col-ord').on('click', function(e) { + e.preventDefault(); + let el = $(this); + let ord = el.data('dir'); + let col = el.data('col'); + let wurl = new URL(window.location.href); + let query_string = wurl.search; + let search_params = new URLSearchParams(query_string); + + if(ord == 'asc') { + search_params.set('filter', col); + search_params.set('order', ord); + wurl.search = search_params.toString(); + el.find('i').removeClass('fa-chevron-up').addClass('fa-chevron-down'); + el.data('dir', 'desc'); + } else { + search_params.set('filter', col); + search_params.set('order', ord); + wurl.search = search_params.toString(); + el.find('i').removeClass('fa-chevron-down').addClass('fa-chevron-up'); + el.data('dir', 'asc'); + } + window.location.href = wurl.toString(); + }); + + + $(document).on('click', '#row-check-all', function(e) { + return; + let el = $(this); + let attr = el.attr('checked'); + + if (typeof attr !== typeof undefined && attr !== false) { + $('tbody .user-row').removeClass('user-row-active'); + $('.bulk-actions').addClass('d-none'); + $('.row-check-item').removeAttr('checked').prop('checked', false); + el.removeAttr('checked').prop('checked', false); + } else { + $('tbody .user-row').addClass('user-row-active'); + $('.bulk-actions').removeClass('d-none'); + el.attr('checked', '').prop('checked', true); + $('.row-check-item').attr('checked', '').prop('checked', true); + } + + let len = $('.row-check-item:checked').length; + if(attr == true) { + len--; + } + $('.bulk-count').text(len).attr('data-count', len); + }); + + + $(document).on('click', '.row-check-item', function(e) { + return; + var el = $(this)[0]; + let len = $('.row-check-item:checked').length; + if($('#row-check-all:checked').length > 0) { + len--; + } + if($(this).hasClass('row-check-all')) { + return; + }; + if(el.checked == true) { + $(this).parents().eq(2).addClass('user-row-active'); + $('.bulk-actions').removeClass('d-none'); + $('.bulk-count').text(len).attr('data-count', len); + } else { + $(this).parents().eq(2).removeClass('user-row-active'); + if(len == 0) { + $('.bulk-actions').addClass('d-none'); + } else { + $('.bulk-count').text(len).attr('data-count', len); + } + } + if(len == 0) { + $('.bulk-actions').addClass('d-none'); + $('#row-check-all').prop('checked', false); + } else { + $('.bulk-actions').removeClass('d-none'); + } + }); + + $(document).on('click', '.apply-bulk', function(e) { + return; + e.preventDefault(); + let len = $('.row-check-item:checked').length; + if($('#row-check-all:checked').length > 0) { + len--; + } + if(len == 0) { + return; + } + let action = $('.bulk-action').val(); + let ids = $('.row-check-item:checked').get().filter(i => { + let el = $(i); + if(el.hasClass('row-check-all')) { + return false; + } + return true; + }).map(i => { + return $(i).data('id'); + }); + let actions = [ + '', + 'review', + 'cw', + 'unlist', + 'noautolink', + 'suspend', + 'delete' + ]; + action = actions[action]; + if(!action) { + return; + } + swal( + 'Confirm', + 'Are you sure you want to perform this action?', + 'warning' + ).then(res => { + console.log(action); + console.log(ids); + }) + }); @endpush diff --git a/resources/views/admin/reports/home.blade.php b/resources/views/admin/reports/home.blade.php index b7099514c..569ee9d65 100644 --- a/resources/views/admin/reports/home.blade.php +++ b/resources/views/admin/reports/home.blade.php @@ -66,12 +66,10 @@ -
-
# Reporter @@ -84,14 +82,14 @@ @foreach($reports as $report) - +
- + {{$report->id}}