From 2281727ac035bfd09753bab685ba3ba8033e7c86 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 30 Jan 2021 19:45:02 -0700 Subject: [PATCH 1/9] Update nav partial --- resources/views/layouts/partial/nav.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/layouts/partial/nav.blade.php b/resources/views/layouts/partial/nav.blade.php index 9f336327a..28e1a28d0 100644 --- a/resources/views/layouts/partial/nav.blade.php +++ b/resources/views/layouts/partial/nav.blade.php @@ -52,7 +52,7 @@ From 090b6d033626438fd1748620909e986743460326 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 30 Jan 2021 19:56:10 -0700 Subject: [PATCH 2/9] Update SeasonalController --- app/Http/Controllers/SeasonalController.php | 25 +++++++++++---------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/SeasonalController.php b/app/Http/Controllers/SeasonalController.php index d1077276d..a9f1f98cb 100644 --- a/app/Http/Controllers/SeasonalController.php +++ b/app/Http/Controllers/SeasonalController.php @@ -219,20 +219,21 @@ class SeasonalController extends Controller { abort_if(now()->gt('2021-03-01 00:00:00'), 404); abort_if(config('database.default') != 'mysql', 404); - $this->validate($request, [ - 'profile_id' => 'required', - 'type' => 'required|string|in:view,hide' - ]); $user = $request->user(); - $log = new AccountLog(); - $log->user_id = $user->id; - $log->item_type = 'App\User'; - $log->item_id = $user->id; - $log->action = $request->input('type') == 'view' ? 'seasonal.my2020.view' : 'seasonal.my2020.hide'; - $log->ip_address = $request->ip(); - $log->user_agent = $request->user_agent(); - $log->save(); + $log = AccountLog::firstOrCreate([ + [ + 'item_type' => 'App\User', + 'item_id' => $user->id, + 'user_id' => $user->id, + 'action' => 'seasonal.my2020.view' + ], + [ + 'ip_address' => $request->ip(), + 'user_agent' => $request->userAgent() + ] + ]); + return response()->json(200); } } From 1ac60173af34d397df2b227574e380c97327c117 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 30 Jan 2021 19:56:31 -0700 Subject: [PATCH 3/9] Update AccountLog model, add fillable attribute --- app/AccountLog.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/AccountLog.php b/app/AccountLog.php index 3f7521f3b..039accb90 100644 --- a/app/AccountLog.php +++ b/app/AccountLog.php @@ -6,6 +6,9 @@ use Illuminate\Database\Eloquent\Model; class AccountLog extends Model { + + protected $fillable = ['*']; + public function user() { return $this->belongsTo(User::class); From 9862a855996657236f060bf13b09dbad53ae8056 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 30 Jan 2021 21:39:31 -0700 Subject: [PATCH 4/9] Update InternalApiController, update discoverPosts method to improve performance --- .../Controllers/InternalApiController.php | 132 +----------------- 1 file changed, 7 insertions(+), 125 deletions(-) diff --git a/app/Http/Controllers/InternalApiController.php b/app/Http/Controllers/InternalApiController.php index e3fc8c757..1a0af7d1a 100644 --- a/app/Http/Controllers/InternalApiController.php +++ b/app/Http/Controllers/InternalApiController.php @@ -35,6 +35,8 @@ use Illuminate\Support\Str; use App\Services\MediaTagService; use App\Services\ModLogService; use App\Services\PublicTimelineService; +use App\Services\SnowflakeService; +use App\Services\StatusService; class InternalApiController extends Controller { @@ -82,37 +84,27 @@ class InternalApiController extends Controller $following = array_merge($following, $filters); $sql = config('database.default') !== 'pgsql'; - + $min_id = SnowflakeService::byDate(now()->subMonths(3)); $posts = Status::select( 'id', - 'caption', 'is_nsfw', 'profile_id', 'type', 'uri', - 'created_at' ) ->whereNull('uri') ->whereIn('type', ['photo','photo:album', 'video']) ->whereIsNsfw(false) ->whereVisibility('public') ->whereNotIn('profile_id', $following) - ->when($sql, function($q, $s) { - return $q->where('created_at', '>', now()->subMonths(3)); - }) - ->with('media') + ->where('id', '>', $min_id) ->inRandomOrder() - ->latest() ->take(39) - ->get(); + ->pluck('id'); $res = [ 'posts' => $posts->map(function($post) { - return [ - 'type' => $post->type, - 'url' => $post->url(), - 'thumb' => $post->thumb(), - ]; + return StatusService::get($post); }) ]; return response()->json($res); @@ -323,117 +315,7 @@ class InternalApiController extends Controller public function composePost(Request $request) { - $this->validate($request, [ - 'caption' => 'nullable|string|max:'.config('pixelfed.max_caption_length', 500), - 'media.*' => 'required', - 'media.*.id' => 'required|integer|min:1', - 'media.*.filter_class' => 'nullable|alpha_dash|max:30', - 'media.*.license' => 'nullable|string|max:140', - 'media.*.alt' => 'nullable|string|max:140', - 'cw' => 'nullable|boolean', - 'visibility' => 'required|string|in:public,private,unlisted|min:2|max:10', - 'place' => 'nullable', - 'comments_disabled' => 'nullable', - 'tagged' => 'nullable' - ]); - - if(config('costar.enabled') == true) { - $blockedKeywords = config('costar.keyword.block'); - if($blockedKeywords !== null && $request->caption) { - $keywords = config('costar.keyword.block'); - foreach($keywords as $kw) { - if(Str::contains($request->caption, $kw) == true) { - abort(400, 'Invalid object'); - } - } - } - } - - $user = Auth::user(); - $profile = $user->profile; - $visibility = $request->input('visibility'); - $medias = $request->input('media'); - $attachments = []; - $status = new Status; - $mimes = []; - $place = $request->input('place'); - $cw = $request->input('cw'); - $tagged = $request->input('tagged'); - - foreach($medias as $k => $media) { - if($k + 1 > config('pixelfed.max_album_length')) { - continue; - } - $m = Media::findOrFail($media['id']); - if($m->profile_id !== $profile->id || $m->status_id) { - abort(403, 'Invalid media id'); - } - $m->filter_class = in_array($media['filter_class'], Filter::classes()) ? $media['filter_class'] : null; - $m->license = $media['license']; - $m->caption = isset($media['alt']) ? strip_tags($media['alt']) : null; - $m->order = isset($media['cursor']) && is_int($media['cursor']) ? (int) $media['cursor'] : $k; - if($cw == true || $profile->cw == true) { - $m->is_nsfw = $cw; - $status->is_nsfw = $cw; - } - $m->save(); - $attachments[] = $m; - array_push($mimes, $m->mime); - } - - $mediaType = StatusController::mimeTypeCheck($mimes); - - if(in_array($mediaType, ['photo', 'video', 'photo:album']) == false) { - abort(400, __('exception.compose.invalid.album')); - } - - if($place && is_array($place)) { - $status->place_id = $place['id']; - } - - if($request->filled('comments_disabled')) { - $status->comments_disabled = (bool) $request->input('comments_disabled'); - } - - $status->caption = strip_tags($request->caption); - $status->scope = 'draft'; - $status->profile_id = $profile->id; - $status->save(); - - foreach($attachments as $media) { - $media->status_id = $status->id; - $media->save(); - } - - $visibility = $profile->unlisted == true && $visibility == 'public' ? 'unlisted' : $visibility; - $cw = $profile->cw == true ? true : $cw; - $status->is_nsfw = $cw; - $status->visibility = $visibility; - $status->scope = $visibility; - $status->type = $mediaType; - $status->save(); - - foreach($tagged as $tg) { - $mt = new MediaTag; - $mt->status_id = $status->id; - $mt->media_id = $status->media->first()->id; - $mt->profile_id = $tg['id']; - $mt->tagged_username = $tg['name']; - $mt->is_public = true; // (bool) $tg['privacy'] ?? 1; - $mt->metadata = json_encode([ - '_v' => 1, - ]); - $mt->save(); - MediaTagService::set($mt->status_id, $mt->profile_id); - MediaTagService::sendNotification($mt); - } - - NewStatusPipeline::dispatch($status); - Cache::forget('user:account:id:'.$profile->user_id); - Cache::forget('_api:statuses:recent_9:'.$profile->id); - Cache::forget('profile:status_count:'.$profile->id); - Cache::forget($user->storageUsedKey()); - return $status->url(); + abort(400, 'Endpoint deprecated'); } public function bookmarks(Request $request) From a8ebdd2e399dcbefbade8e76619912923589f5b0 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 30 Jan 2021 21:56:50 -0700 Subject: [PATCH 5/9] Update DiscoverComponent, add blurhash and like/comment counts --- .../js/components/DiscoverComponent.vue | 94 ++++++++++++++++--- 1 file changed, 82 insertions(+), 12 deletions(-) diff --git a/resources/assets/js/components/DiscoverComponent.vue b/resources/assets/js/components/DiscoverComponent.vue index 6ad5cd537..69140e672 100644 --- a/resources/assets/js/components/DiscoverComponent.vue +++ b/resources/assets/js/components/DiscoverComponent.vue @@ -39,13 +39,46 @@
-
- +
-
- +
+
- - - -
+
+
+
+ + + +
+
+ +
+
+ + +
+ + + +
+
+ + + {{formatCount(s.favourites_count)}} + + + + {{formatCount(s.reply_count)}} + +
@@ -314,6 +380,10 @@ .then(res => { this.places = res.data; }); + }, + + formatCount(s) { + return App.util.format.count(s); } } } From 7075b7f83eadbff9564d064e500e34d26f3a72a2 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 30 Jan 2021 21:58:37 -0700 Subject: [PATCH 6/9] Update compiled assets --- public/js/discover.js | 2 +- public/mix-manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/js/discover.js b/public/js/discover.js index fd516e6ca..9ee5cab91 100644 --- a/public/js/discover.js +++ b/public/js/discover.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{"+nCD":function(t,e,n){Vue.component("discover-component",n("RlRG").default)},"/5oI":function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n.discover-bar[data-v-67532657]::-webkit-scrollbar { \n\tdisplay: none;\n}\n.card-disc[data-v-67532657] {\n\t-webkit-box-flex: 0;\n\t flex: 0 0 160px;\n\twidth:160px;\n\theight:100px;\n\tbackground-size: cover !important;\n}\n.post-icon[data-v-67532657] {\n\tcolor: #fff;\n\tposition:relative;\n\tmargin-top: 10px;\n\tz-index: 9;\n\topacity: 0.6;\n\ttext-shadow: 3px 3px 16px #272634;\n}\n",""])},3:function(t,e,n){t.exports=n("+nCD")},"9tPo":function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,s=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var i,a=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(a)?t:(i=0===a.indexOf("//")?a:0===a.indexOf("/")?n+a:s+a.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")}))}},I1BE:function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",s=t[3];if(!s)return n;if(e&&"function"==typeof btoa){var i=(r=s,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),a=s.sources.map((function(t){return"/*# sourceURL="+s.sourceRoot+t+" */"}));return[n].concat(a).concat([i]).join("\n")}var r;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var s={},i=0;i1&&(window.location.href="/i/results?q="+this.searchTerm)},loadTrending:function(){var t=this;"daily"==this.trendingRange&&this.trendingDaily.length?this.trending=this.trendingDaily:"monthly"==this.trendingRange&&this.trendingMonthly.length?this.trending=this.trendingMonthly:axios.get("/api/pixelfed/v2/discover/posts/trending",{params:{range:this.trendingRange}}).then((function(e){"daily"==t.trendingRange&&(t.trendingDaily=e.data.filter((function(t){return 0==t.sensitive}))),"monthly"==t.trendingRange&&(t.trendingMonthly=e.data.filter((function(t){return 0==t.sensitive}))),t.trending=e.data}))},trendingRangeToggle:function(t){this.trendingRange=t,this.loadTrending()},loadTrendingHashtags:function(){var t=this;axios.get("/api/pixelfed/v2/discover/posts/hashtags").then((function(e){t.hashtags=e.data}))},loadTrendingPlaces:function(){var t=this;axios.get("/api/pixelfed/v2/discover/posts/places").then((function(e){t.places=e.data}))}}},i=(n("MxLl"),n("KHd+")),a=Object(i.a)(s,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.loaded?n("div",[n("div",{staticClass:"d-block d-md-none border-top-0 pt-3"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.searchTerm,expression:"searchTerm"}],staticClass:"form-control rounded-pill shadow-sm",attrs:{placeholder:"Search"},domProps:{value:t.searchTerm},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.searchSubmit(e)},input:function(e){e.target.composing||(t.searchTerm=e.target.value)}}})]),t._v(" "),t._m(0),t._v(" "),t.hashtags.length?n("section",{staticClass:"mb-4 pb-5 section-explore mt-4 pt-4"},[n("div",{staticClass:"lead"},[n("i",{staticClass:"fas fa-hashtag text-lighter fa-lg mr-3"}),t._v(" "),t._l(t.hashtags,(function(e,s){return n("a",{staticClass:"badge badge-light rounded-pill border py-2 px-3 mr-2 mb-2 shadow-sm border-danger text-danger",attrs:{href:e.url}},[t._v(t._s(e.name))])}))],2),t._v(" "),n("div",{staticClass:"lead mt-4"},[n("i",{staticClass:"fas fa-map-marker-alt text-lighter fa-lg mr-3"}),t._v(" "),t._l(t.places,(function(e,s){return n("a",{staticClass:"badge badge-light rounded-pill border py-2 px-3 mr-2 mb-2 shadow-sm border-danger text-danger",attrs:{href:e.url}},[t._v(t._s(e.name)+", "+t._s(e.country))])}))],2)]):t._e(),t._v(" "),t.trending.length?n("section",{staticClass:"mb-5 section-explore"},[n("div",{staticClass:"profile-timeline"},[n("div",{staticClass:"row p-0 mt-5"},[n("div",{staticClass:"col-12 mb-3 d-flex justify-content-between align-items-center"},[n("p",{staticClass:"d-block d-md-none h1 font-weight-bold mb-0"},[t._v("Trending")]),t._v(" "),n("p",{staticClass:"d-none d-md-block display-4 font-weight-bold mb-0"},[t._v("Trending")]),t._v(" "),n("div",[n("div",{staticClass:"btn-group"},[n("button",{class:"daily"==t.trendingRange?"btn py-1 font-weight-bold px-3 text-uppercase btn-sm btn-danger":"btn py-1 font-weight-bold px-3 text-uppercase btn-sm btn-outline-danger",on:{click:function(e){return t.trendingRangeToggle("daily")}}},[t._v("Daily")]),t._v(" "),n("button",{class:"monthly"==t.trendingRange?"btn py-1 font-weight-bold px-3 text-uppercase btn-sm btn-danger":"btn py-1 font-weight-bold px-3 text-uppercase btn-sm btn-outline-danger",on:{click:function(e){return t.trendingRangeToggle("monthly")}}},[t._v("Monthly")])])])])]),t._v(" "),n("div",{staticClass:"row p-0",staticStyle:{display:"flex"}},t._l(t.trending.slice(0,12),(function(e,s){return n("div",{staticClass:"col-4 p-1 p-sm-2 p-md-3 pt-0"},[n("a",{staticClass:"card info-overlay card-md-border-0",attrs:{href:e.url}},[n("div",{staticClass:"square"},["photo:album"==e.pf_type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-images fa-2x"})]):t._e(),t._v(" "),"video"==e.pf_type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-video fa-2x"})]):t._e(),t._v(" "),"video:album"==e.pf_type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-film fa-2x"})]):t._e(),t._v(" "),n("div",{staticClass:"square-content",style:{"background-image":"url("+e.media_attachments[0].preview_url+")"}})])])])})),0)])]):t._e(),t._v(" "),t.categories.length>0?n("section",{staticClass:"mb-5 section-explore"},[n("div",{staticClass:"profile-timeline pt-3"},[t._m(1),t._v(" "),n("section",{staticClass:"d-none d-md-flex mb-md-2 discover-bar",staticStyle:{width:"auto",overflow:"auto hidden"}},t._l(t.categories,(function(e,s){return n("a",{key:s+"_cat_",staticClass:"bg-dark rounded d-inline-flex align-items-end justify-content-center mr-3 box-shadow card-disc text-decoration-none",style:"background: linear-gradient(rgba(0, 0, 0, 0.3),rgba(0, 0, 0, 0.3)),url("+e.thumb+");",attrs:{href:e.url}},[n("p",{staticClass:"text-white font-weight-bold",staticStyle:{"text-shadow":"3px 3px 16px #272634"}},[t._v(t._s(e.name))])])})),0)])]):t._e(),t._v(" "),t.categories.length>0?n("section",{staticClass:"py-5 mb-5 section-explore bg-warning rounded"},[t._m(2)]):t._e(),t._v(" "),t.posts.length?n("section",{staticClass:"pt-5 mb-5 section-explore"},[n("div",{staticClass:"profile-timeline pt-3"},[t._m(3),t._v(" "),n("div",{staticClass:"row p-0",staticStyle:{display:"flex"}},t._l(t.posts,(function(e,s){return n("div",{staticClass:"col-4 p-1 p-sm-2 p-md-3 pt-0"},[n("a",{staticClass:"card info-overlay card-md-border-0",attrs:{href:e.url}},[n("div",{staticClass:"square"},["photo:album"==e.type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-images fa-2x"})]):t._e(),t._v(" "),"video"==e.type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-video fa-2x"})]):t._e(),t._v(" "),"video:album"==e.type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-film fa-2x"})]):t._e(),t._v(" "),n("div",{staticClass:"square-content",style:{"background-image":"url("+e.thumb+")"}})])])])})),0)])]):t._e()]):n("div",{staticClass:"d-flex justify-content-center align-items-center",staticStyle:{height:"70vh"}},[n("img",{attrs:{src:"/img/pixelfed-icon-grey.svg"}})])])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"pt-3"},[e("p",{staticClass:"d-block d-md-none h1 font-weight-bold text-lighter pt-3",staticStyle:{opacity:"0.4"}},[e("i",{staticClass:"far fa-compass"}),this._v(" DISCOVER")]),this._v(" "),e("p",{staticClass:"d-none d-md-block display-3 font-weight-bold text-lighter pt-3",staticStyle:{opacity:"0.4"}},[e("i",{staticClass:"far fa-compass"}),this._v(" DISCOVER")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"row p-0 mt-5"},[e("div",{staticClass:"col-12 mb-4 d-flex justify-content-between align-items-center"},[e("p",{staticClass:"d-block d-md-none h1 font-weight-bold mb-0"},[this._v("Categories")]),this._v(" "),e("p",{staticClass:"d-none d-md-block display-4 font-weight-bold mb-0"},[this._v("Categories")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"profile-timeline py-3"},[e("div",{staticClass:"row p-0 my-5"},[e("div",{staticClass:"col-12 mb-3 text-center text-dark"},[e("p",{staticClass:"d-none d-md-block display-3 font-weight-bold"},[this._v("Discover. Categories.")]),this._v(" "),e("p",{staticClass:"d-block d-md-none h1 font-weight-bold"},[this._v("Discover. Categories.")]),this._v(" "),e("p",{staticClass:"h4 font-weight-light mb-0"},[this._v("Discover amazing posts, people, places and hashtags.")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"row p-0 mt-5"},[e("div",{staticClass:"col-12 mb-3 d-flex justify-content-between align-items-center"},[e("p",{staticClass:"d-block d-md-none h1 font-weight-bold mb-0"},[this._v("For You")]),this._v(" "),e("p",{staticClass:"d-none d-md-block display-4 font-weight-bold mb-0"},[this._v("For You")])])])}],!1,null,"67532657",null);e.default=a.exports},"aET+":function(t,e,n){var s,i,a={},r=(s=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===i&&(i=s.apply(this,arguments)),i}),o=function(t,e){return e?e.querySelector(t):document.querySelector(t)},l=function(t){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var s=o.call(this,t,n);if(window.HTMLIFrameElement&&s instanceof window.HTMLIFrameElement)try{s=s.contentDocument.head}catch(t){s=null}e[t]=s}return e[t]}}(),c=null,d=0,f=[],p=n("9tPo");function u(t,e){for(var n=0;n=0&&f.splice(e,1)}function m(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var s=function(){0;return n.nc}();s&&(t.attrs.nonce=s)}return b(e,t.attrs),g(t,e),e}function b(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function y(t,e){var n,s,i,a;if(e.transform&&t.css){if(!(a="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=a}if(e.singleton){var r=d++;n=c||(c=m(e)),s=x.bind(null,n,r,!1),i=x.bind(null,n,r,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",b(e,t.attrs),g(t,e),e}(e),s=R.bind(null,n,e),i=function(){v(n),n.href&&URL.revokeObjectURL(n.href)}):(n=m(e),s=w.bind(null,n),i=function(){v(n)});return s(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;s(t=e)}else i()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=r()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=h(t,e);return u(n,e),function(t){for(var s=[],i=0;i1&&(window.location.href="/i/results?q="+this.searchTerm)},loadTrending:function(){var t=this;"daily"==this.trendingRange&&this.trendingDaily.length?this.trending=this.trendingDaily:"monthly"==this.trendingRange&&this.trendingMonthly.length?this.trending=this.trendingMonthly:axios.get("/api/pixelfed/v2/discover/posts/trending",{params:{range:this.trendingRange}}).then((function(e){"daily"==t.trendingRange&&(t.trendingDaily=e.data.filter((function(t){return 0==t.sensitive}))),"monthly"==t.trendingRange&&(t.trendingMonthly=e.data.filter((function(t){return 0==t.sensitive}))),t.trending=e.data}))},trendingRangeToggle:function(t){this.trendingRange=t,this.loadTrending()},loadTrendingHashtags:function(){var t=this;axios.get("/api/pixelfed/v2/discover/posts/hashtags").then((function(e){t.hashtags=e.data}))},loadTrendingPlaces:function(){var t=this;axios.get("/api/pixelfed/v2/discover/posts/places").then((function(e){t.places=e.data}))},formatCount:function(t){return App.util.format.count(t)}}},a=(n("68Ps"),n("KHd+")),i=Object(a.a)(s,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.loaded?n("div",[n("div",{staticClass:"d-block d-md-none border-top-0 pt-3"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.searchTerm,expression:"searchTerm"}],staticClass:"form-control rounded-pill shadow-sm",attrs:{placeholder:"Search"},domProps:{value:t.searchTerm},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.searchSubmit(e)},input:function(e){e.target.composing||(t.searchTerm=e.target.value)}}})]),t._v(" "),t._m(0),t._v(" "),t.hashtags.length?n("section",{staticClass:"mb-4 pb-5 section-explore mt-4 pt-4"},[n("div",{staticClass:"lead"},[n("i",{staticClass:"fas fa-hashtag text-lighter fa-lg mr-3"}),t._v(" "),t._l(t.hashtags,(function(e,s){return n("a",{staticClass:"badge badge-light rounded-pill border py-2 px-3 mr-2 mb-2 shadow-sm border-danger text-danger",attrs:{href:e.url}},[t._v(t._s(e.name))])}))],2),t._v(" "),n("div",{staticClass:"lead mt-4"},[n("i",{staticClass:"fas fa-map-marker-alt text-lighter fa-lg mr-3"}),t._v(" "),t._l(t.places,(function(e,s){return n("a",{staticClass:"badge badge-light rounded-pill border py-2 px-3 mr-2 mb-2 shadow-sm border-danger text-danger",attrs:{href:e.url}},[t._v(t._s(e.name)+", "+t._s(e.country))])}))],2)]):t._e(),t._v(" "),t.trending.length?n("section",{staticClass:"mb-5 section-explore"},[n("div",{staticClass:"profile-timeline"},[n("div",{staticClass:"row p-0 mt-5"},[n("div",{staticClass:"col-12 mb-3 d-flex justify-content-between align-items-center"},[n("p",{staticClass:"d-block d-md-none h1 font-weight-bold mb-0"},[t._v("Trending")]),t._v(" "),n("p",{staticClass:"d-none d-md-block display-4 font-weight-bold mb-0"},[t._v("Trending")]),t._v(" "),n("div",[n("div",{staticClass:"btn-group"},[n("button",{class:"daily"==t.trendingRange?"btn py-1 font-weight-bold px-3 text-uppercase btn-sm btn-danger":"btn py-1 font-weight-bold px-3 text-uppercase btn-sm btn-outline-danger",on:{click:function(e){return t.trendingRangeToggle("daily")}}},[t._v("Daily")]),t._v(" "),n("button",{class:"monthly"==t.trendingRange?"btn py-1 font-weight-bold px-3 text-uppercase btn-sm btn-danger":"btn py-1 font-weight-bold px-3 text-uppercase btn-sm btn-outline-danger",on:{click:function(e){return t.trendingRangeToggle("monthly")}}},[t._v("Monthly")])])])])]),t._v(" "),n("div",{staticClass:"row p-0",staticStyle:{display:"flex"}},t._l(t.trending.slice(0,12),(function(e,s){return n("div",{staticClass:"col-4 p-1 p-sm-2 p-md-3 pt-0"},[n("a",{staticClass:"card info-overlay card-md-border-0",attrs:{href:e.url}},[n("div",{staticClass:"square"},[e.sensitive?n("div",{staticClass:"square-content"},[t._m(1,!0),t._v(" "),n("blur-hash-canvas",{attrs:{width:"32",height:"32",hash:e.media_attachments[0].blurhash}})],1):n("div",{staticClass:"square-content"},[n("blur-hash-image",{attrs:{width:"32",height:"32",hash:e.media_attachments[0].blurhash,src:e.media_attachments[0].preview_url}})],1),t._v(" "),"photo:album"==e.pf_type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-images fa-2x"})]):t._e(),t._v(" "),"video"==e.pf_type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-video fa-2x"})]):t._e(),t._v(" "),"video:album"==e.pf_type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-film fa-2x"})]):t._e(),t._v(" "),n("div",{staticClass:"info-overlay-text"},[n("h5",{staticClass:"text-white m-auto font-weight-bold"},[n("span",[n("span",{staticClass:"far fa-heart fa-lg p-2 d-flex-inline"}),t._v(" "),n("span",{staticClass:"d-flex-inline"},[t._v(t._s(t.formatCount(e.favourites_count)))])]),t._v(" "),n("span",[n("span",{staticClass:"far fa-comment fa-lg p-2 d-flex-inline"}),t._v(" "),n("span",{staticClass:"d-flex-inline"},[t._v(t._s(t.formatCount(e.reply_count)))])])])])])])])})),0)])]):t._e(),t._v(" "),t.categories.length>0?n("section",{staticClass:"mb-5 section-explore"},[n("div",{staticClass:"profile-timeline pt-3"},[t._m(2),t._v(" "),n("section",{staticClass:"d-none d-md-flex mb-md-2 discover-bar",staticStyle:{width:"auto",overflow:"auto hidden"}},t._l(t.categories,(function(e,s){return n("a",{key:s+"_cat_",staticClass:"bg-dark rounded d-inline-flex align-items-end justify-content-center mr-3 box-shadow card-disc text-decoration-none",style:"background: linear-gradient(rgba(0, 0, 0, 0.3),rgba(0, 0, 0, 0.3)),url("+e.thumb+");",attrs:{href:e.url}},[n("p",{staticClass:"text-white font-weight-bold",staticStyle:{"text-shadow":"3px 3px 16px #272634"}},[t._v(t._s(e.name))])])})),0)])]):t._e(),t._v(" "),t.categories.length>0?n("section",{staticClass:"py-5 mb-5 section-explore bg-warning rounded"},[t._m(3)]):t._e(),t._v(" "),t.posts.length?n("section",{staticClass:"pt-5 mb-5 section-explore"},[n("div",{staticClass:"profile-timeline pt-3"},[t._m(4),t._v(" "),n("div",{staticClass:"row p-0",staticStyle:{display:"flex"}},t._l(t.posts,(function(e,s){return n("div",{staticClass:"col-4 p-1 p-sm-2 p-md-3 pt-0"},[n("a",{staticClass:"card info-overlay card-md-border-0",attrs:{href:e.url}},[n("div",{staticClass:"square"},[e.sensitive?n("div",{staticClass:"square-content"},[t._m(5,!0),t._v(" "),n("blur-hash-canvas",{attrs:{width:"32",height:"32",hash:e.media_attachments[0].blurhash}})],1):n("div",{staticClass:"square-content"},[n("blur-hash-image",{attrs:{width:"32",height:"32",hash:e.media_attachments[0].blurhash,src:e.media_attachments[0].preview_url}})],1),t._v(" "),"photo:album"==e.pf_type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-images fa-2x"})]):t._e(),t._v(" "),"video"==e.pf_type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-video fa-2x"})]):t._e(),t._v(" "),"video:album"==e.pf_type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-film fa-2x"})]):t._e(),t._v(" "),n("div",{staticClass:"info-overlay-text"},[n("h5",{staticClass:"text-white m-auto font-weight-bold"},[n("span",[n("span",{staticClass:"far fa-heart fa-lg p-2 d-flex-inline"}),t._v(" "),n("span",{staticClass:"d-flex-inline"},[t._v(t._s(t.formatCount(e.favourites_count)))])]),t._v(" "),n("span",[n("span",{staticClass:"far fa-comment fa-lg p-2 d-flex-inline"}),t._v(" "),n("span",{staticClass:"d-flex-inline"},[t._v(t._s(t.formatCount(e.reply_count)))])])])])])])])})),0)])]):t._e()]):n("div",{staticClass:"d-flex justify-content-center align-items-center",staticStyle:{height:"70vh"}},[n("img",{attrs:{src:"/img/pixelfed-icon-grey.svg"}})])])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"pt-3"},[e("p",{staticClass:"d-block d-md-none h1 font-weight-bold text-lighter pt-3",staticStyle:{opacity:"0.4"}},[e("i",{staticClass:"far fa-compass"}),this._v(" DISCOVER")]),this._v(" "),e("p",{staticClass:"d-none d-md-block display-3 font-weight-bold text-lighter pt-3",staticStyle:{opacity:"0.4"}},[e("i",{staticClass:"far fa-compass"}),this._v(" DISCOVER")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"info-overlay-text-label"},[e("h5",{staticClass:"text-white m-auto font-weight-bold"},[e("span",[e("span",{staticClass:"far fa-eye-slash fa-lg p-2 d-flex-inline"})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"row p-0 mt-5"},[e("div",{staticClass:"col-12 mb-4 d-flex justify-content-between align-items-center"},[e("p",{staticClass:"d-block d-md-none h1 font-weight-bold mb-0"},[this._v("Categories")]),this._v(" "),e("p",{staticClass:"d-none d-md-block display-4 font-weight-bold mb-0"},[this._v("Categories")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"profile-timeline py-3"},[e("div",{staticClass:"row p-0 my-5"},[e("div",{staticClass:"col-12 mb-3 text-center text-dark"},[e("p",{staticClass:"d-none d-md-block display-3 font-weight-bold"},[this._v("Discover. Categories.")]),this._v(" "),e("p",{staticClass:"d-block d-md-none h1 font-weight-bold"},[this._v("Discover. Categories.")]),this._v(" "),e("p",{staticClass:"h4 font-weight-light mb-0"},[this._v("Discover amazing posts, people, places and hashtags.")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"row p-0 mt-5"},[e("div",{staticClass:"col-12 mb-3 d-flex justify-content-between align-items-center"},[e("p",{staticClass:"d-block d-md-none h1 font-weight-bold mb-0"},[this._v("For You")]),this._v(" "),e("p",{staticClass:"d-none d-md-block display-4 font-weight-bold mb-0"},[this._v("For You")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"info-overlay-text-label"},[e("h5",{staticClass:"text-white m-auto font-weight-bold"},[e("span",[e("span",{staticClass:"far fa-eye-slash fa-lg p-2 d-flex-inline"})])])])}],!1,null,"66a58a32",null);e.default=i.exports},YRdF:function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n.discover-bar[data-v-66a58a32]::-webkit-scrollbar { \n\tdisplay: none;\n}\n.card-disc[data-v-66a58a32] {\n\t-webkit-box-flex: 0;\n\t flex: 0 0 160px;\n\twidth:160px;\n\theight:100px;\n\tbackground-size: cover !important;\n}\n.post-icon[data-v-66a58a32] {\n\tcolor: #fff;\n\tposition:relative;\n\tmargin-top: 10px;\n\tz-index: 9;\n\topacity: 0.6;\n\ttext-shadow: 3px 3px 16px #272634;\n}\n",""])},"aET+":function(t,e,n){var s,a,i={},r=(s=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===a&&(a=s.apply(this,arguments)),a}),o=function(t,e){return e?e.querySelector(t):document.querySelector(t)},l=function(t){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var s=o.call(this,t,n);if(window.HTMLIFrameElement&&s instanceof window.HTMLIFrameElement)try{s=s.contentDocument.head}catch(t){s=null}e[t]=s}return e[t]}}(),c=null,d=0,f=[],p=n("9tPo");function h(t,e){for(var n=0;n=0&&f.splice(e,1)}function m(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var s=function(){0;return n.nc}();s&&(t.attrs.nonce=s)}return b(e,t.attrs),v(t,e),e}function b(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function _(t,e){var n,s,a,i;if(e.transform&&t.css){if(!(i="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=i}if(e.singleton){var r=d++;n=c||(c=m(e)),s=x.bind(null,n,r,!1),a=x.bind(null,n,r,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",b(e,t.attrs),v(t,e),e}(e),s=R.bind(null,n,e),a=function(){g(n),n.href&&URL.revokeObjectURL(n.href)}):(n=m(e),s=w.bind(null,n),a=function(){g(n)});return s(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;s(t=e)}else a()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=r()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=u(t,e);return h(n,e),function(t){for(var s=[],a=0;a Date: Sat, 30 Jan 2021 22:11:12 -0700 Subject: [PATCH 7/9] Update footer --- .../views/layouts/partial/footer.blade.php | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/resources/views/layouts/partial/footer.blade.php b/resources/views/layouts/partial/footer.blade.php index 24e3fe322..86ef1de02 100644 --- a/resources/views/layouts/partial/footer.blade.php +++ b/resources/views/layouts/partial/footer.blade.php @@ -1,17 +1,19 @@ @if(config('instance.restricted.enabled') == false) From eadf0c3b6c9e824af5b4df50c610d96fe5ee01fd Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 30 Jan 2021 22:15:54 -0700 Subject: [PATCH 8/9] Update nav partial --- resources/views/layouts/partial/nav.blade.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/views/layouts/partial/nav.blade.php b/resources/views/layouts/partial/nav.blade.php index 28e1a28d0..79f498e8b 100644 --- a/resources/views/layouts/partial/nav.blade.php +++ b/resources/views/layouts/partial/nav.blade.php @@ -18,16 +18,16 @@