From 89ca18b14e1d8336c5308ab94e5278a8d653aa8a Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 22 Aug 2019 22:33:04 -0600 Subject: [PATCH] ComposeUI update --- .../Controllers/Api/AdminApiController.php | 2 + .../assets/js/components/ComposeClassic.vue | 523 ++++++++++++++++++ resources/assets/js/compose-classic.js | 4 + resources/views/status/compose.blade.php | 21 +- routes/web.php | 7 +- webpack.mix.js | 2 + 6 files changed, 549 insertions(+), 10 deletions(-) create mode 100644 resources/assets/js/components/ComposeClassic.vue create mode 100644 resources/assets/js/compose-classic.js diff --git a/app/Http/Controllers/Api/AdminApiController.php b/app/Http/Controllers/Api/AdminApiController.php index dfacf47ee..902b00536 100644 --- a/app/Http/Controllers/Api/AdminApiController.php +++ b/app/Http/Controllers/Api/AdminApiController.php @@ -68,6 +68,8 @@ class AdminApiController extends Controller public function moderateStatus(Request $request) { + abort(400, 'Unpublished API'); + return; $this->validate($request, [ 'type' => 'required|string|in:status,profile', 'id' => 'required|integer|min:1', diff --git a/resources/assets/js/components/ComposeClassic.vue b/resources/assets/js/components/ComposeClassic.vue new file mode 100644 index 000000000..df751cb71 --- /dev/null +++ b/resources/assets/js/components/ComposeClassic.vue @@ -0,0 +1,523 @@ + + + + \ No newline at end of file diff --git a/resources/assets/js/compose-classic.js b/resources/assets/js/compose-classic.js new file mode 100644 index 000000000..83cbc1174 --- /dev/null +++ b/resources/assets/js/compose-classic.js @@ -0,0 +1,4 @@ +Vue.component( + 'compose-classic', + require('./components/ComposeClassic.vue').default +); \ No newline at end of file diff --git a/resources/views/status/compose.blade.php b/resources/views/status/compose.blade.php index 8ced6f0df..fef86bc57 100644 --- a/resources/views/status/compose.blade.php +++ b/resources/views/status/compose.blade.php @@ -2,26 +2,31 @@ @section('content') -
+{{--
-

The Classic Compose UI has been retired.

+

Compose New Post

New Post

+
--}} + + @endsection @push('scripts') - + + @endpush \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index b04997e48..bd39084ed 100644 --- a/routes/web.php +++ b/routes/web.php @@ -102,13 +102,12 @@ Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofact Route::get('status/{id}/replies', 'InternalApiController@statusReplies'); Route::post('moderator/action', 'InternalApiController@modAction'); Route::get('discover/categories', 'InternalApiController@discoverCategories'); - Route::post('status/compose', 'InternalApiController@composePost')->middleware('throttle:maxPostsPerHour,60')->middleware('throttle:maxPostsPerDay,1440'); Route::get('loops', 'DiscoverController@loopsApi'); Route::post('loops/watch', 'DiscoverController@loopWatch'); Route::get('discover/tag', 'DiscoverController@getHashtags'); }); Route::group(['prefix' => 'local'], function () { - Route::post('status/compose', 'InternalApiController@compose')->middleware('throttle:maxPostsPerHour,60')->middleware('throttle:maxPostsPerDay,1440'); + Route::post('status/compose', 'InternalApiController@composePost')->middleware('throttle:maxPostsPerHour,60')->middleware('throttle:maxPostsPerDay,1440'); Route::get('exp/rec', 'ApiController@userRecommendations'); Route::post('discover/tag/subscribe', 'HashtagFollowController@store')->middleware('throttle:maxHashtagFollowsPerHour,60')->middleware('throttle:maxHashtagFollowsPerDay,1440');; Route::get('discover/tag/list', 'HashtagFollowController@getTags'); @@ -122,6 +121,10 @@ Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofact Route::post('collection/{id}/publish', 'CollectionController@publish')->middleware('throttle:maxCollectionsPerHour,60')->middleware('throttle:maxCollectionsPerDay,1440')->middleware('throttle:maxCollectionsPerMonth,43800'); Route::get('profile/collections/{id}', 'CollectionController@getUserCollections'); }); + Route::group(['prefix' => 'admin'], function () { + Route::post('moderate', 'Api\AdminApiController@moderate'); + }); + }); Route::get('discover/tags/{hashtag}', 'DiscoverController@showTags'); diff --git a/webpack.mix.js b/webpack.mix.js index 64ab467e4..faafe51b0 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -21,6 +21,7 @@ mix.js('resources/assets/js/app.js', 'public/js') .js('resources/assets/js/status.js', 'public/js') .js('resources/assets/js/timeline.js', 'public/js') .js('resources/assets/js/compose.js', 'public/js') +.js('resources/assets/js/compose-classic.js', 'public/js') .js('resources/assets/js/search.js', 'public/js') .js('resources/assets/js/developers.js', 'public/js') .js('resources/assets/js/loops.js', 'public/js') @@ -33,6 +34,7 @@ mix.js('resources/assets/js/app.js', 'public/js') .js('resources/assets/js/hashtag.js', 'public/js') .js('resources/assets/js/collectioncompose.js', 'public/js') .js('resources/assets/js/collections.js', 'public/js') +//.js('resources/assets/js/admin.js', 'public/js') .extract([ 'lodash',