diff --git a/CHANGELOG.md b/CHANGELOG.md index 70129f179..5090a8383 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ - Updated AP helpers, fix statusFetch 404s. ([3419379a](https://github.com/pixelfed/pixelfed/commit/3419379a)) - Updated InternalApiController, update discoverPosts method to improve performance. ([9862a855](https://github.com/pixelfed/pixelfed/commit/9862a855)) - Updated DiscoverComponent, add blurhash and like/comment counts. ([a8ebdd2e](https://github.com/pixelfed/pixelfed/commit/a8ebdd2e)) +- Updated DiscoverComponent, add spinner loaders and remove deprecated sections. ([34869247](https://github.com/pixelfed/pixelfed/commit/34869247)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.10.10 (2021-01-28)](https://github.com/pixelfed/pixelfed/compare/v0.10.9...v0.10.10) diff --git a/app/Http/Controllers/DiscoverController.php b/app/Http/Controllers/DiscoverController.php index 41efc18a5..25386f702 100644 --- a/app/Http/Controllers/DiscoverController.php +++ b/app/Http/Controllers/DiscoverController.php @@ -54,63 +54,21 @@ class DiscoverController extends Controller public function showCategory(Request $request, $slug) { - abort_if(!Auth::check(), 403); - - $tag = DiscoverCategory::whereActive(true) - ->whereSlug($slug) - ->firstOrFail(); - - $posts = Cache::remember('discover:category-'.$tag->id.':posts', now()->addMinutes(15), function() use ($tag) { - $tagids = $tag->hashtags->pluck('id')->toArray(); - $sids = StatusHashtag::whereIn('hashtag_id', $tagids)->orderByDesc('status_id')->take(500)->pluck('status_id')->toArray(); - $posts = Status::whereScope('public')->whereIn('id', $sids)->whereNull('uri')->whereType('photo')->whereNull('in_reply_to_id')->whereNull('reblog_of_id')->orderByDesc('created_at')->take(39)->get(); - return $posts; - }); - $tag->posts_count = Cache::remember('discover:category-'.$tag->id.':posts_count', now()->addMinutes(30), function() use ($tag) { - return $tag->posts()->whereScope('public')->count(); - }); - return view('discover.tags.category', compact('tag', 'posts')); + abort(404); } public function showLoops(Request $request) { - if(config('exp.loops') != true) { - return redirect('/'); - } - return view('discover.loops.home'); + abort(404); } public function loopsApi(Request $request) { - abort_if(!config('exp.loops'), 403); - - // todo proper pagination, maybe LoopService - $res = Cache::remember('discover:loops:recent', now()->addHours(6), function() { - $loops = Status::whereType('video') - ->whereNull('uri') - ->whereScope('public') - ->latest() - ->take(18) - ->get(); - - $resource = new Fractal\Resource\Collection($loops, new StatusStatelessTransformer()); - return $this->fractal->createData($resource)->toArray(); - }); - return $res; + abort(404); } public function loopWatch(Request $request) { - abort_if(!Auth::check(), 403); - abort_if(!config('exp.loops'), 403); - - $this->validate($request, [ - 'id' => 'integer|min:1' - ]); - $id = $request->input('id'); - - // todo log loops - return response()->json(200); } @@ -144,35 +102,13 @@ class DiscoverController extends Controller public function profilesDirectory(Request $request) { - return redirect('/')->with('statusRedirect', 'The Profile Directory is unavailable at this time.'); - return view('discover.profiles.home'); + return redirect('/') + ->with('statusRedirect', 'The Profile Directory is unavailable at this time.'); } public function profilesDirectoryApi(Request $request) { return ['error' => 'Temporarily unavailable.']; - - $this->validate($request, [ - 'page' => 'integer|max:10' - ]); - - $page = $request->input('page') ?? 1; - $key = 'discover:profiles:page:' . $page; - $ttl = now()->addHours(12); - - $res = Cache::remember($key, $ttl, function() { - $profiles = Profile::whereNull('domain') - ->whereNull('status') - ->whereIsPrivate(false) - ->has('statuses') - ->whereIsSuggestable(true) - // ->inRandomOrder() - ->simplePaginate(8); - $resource = new Fractal\Resource\Collection($profiles, new AccountTransformer()); - return $this->fractal->createData($resource)->toArray(); - }); - - return $res; } public function trendingApi(Request $request) @@ -221,45 +157,10 @@ class DiscoverController extends Controller public function trendingHashtags(Request $request) { return []; - - $res = StatusHashtag::select('hashtag_id', \DB::raw('count(*) as total')) - ->groupBy('hashtag_id') - ->orderBy('total','desc') - ->where('created_at', '>', now()->subDays(4)) - ->take(9) - ->get() - ->map(function($h) { - $hashtag = $h->hashtag; - return [ - 'id' => $hashtag->id, - 'total' => $h->total, - 'name' => '#'.$hashtag->name, - 'url' => $hashtag->url('?src=dsh1') - ]; - }); - return $res; } public function trendingPlaces(Request $request) { return []; - - $res = Status::select('place_id',DB::raw('count(place_id) as total')) - ->whereNotNull('place_id') - ->where('created_at','>',now()->subDays(14)) - ->groupBy('place_id') - ->orderBy('total') - ->limit(4) - ->get() - ->map(function($s){ - $p = $s->place; - return [ - 'name' => $p->name, - 'country' => $p->country, - 'url' => $p->url() - ]; - }); - - return []; } } diff --git a/app/Services/StatusHashtagService.php b/app/Services/StatusHashtagService.php index be693a371..d656e436a 100644 --- a/app/Services/StatusHashtagService.php +++ b/app/Services/StatusHashtagService.php @@ -64,7 +64,7 @@ class StatusHashtagService { $key = 'pf:services:status-hashtag:count:' . $id; $ttl = now()->addMinutes(5); return Cache::remember($key, $ttl, function() use($id) { - return StatusHashtag::whereHashtagId($id)->count(); + return StatusHashtag::whereHashtagId($id)->has('media')->count(); }); } diff --git a/public/js/discover.js b/public/js/discover.js index 9ee5cab91..8b743ee6d 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)},3:function(t,e,n){t.exports=n("+nCD")},"68Ps":function(t,e,n){"use strict";var s=n("6P6l");n.n(s).a},"6P6l":function(t,e,n){var s=n("YRdF");"string"==typeof s&&(s=[[t.i,s,""]]);var a={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(s,a);s.locals&&(t.exports=s.locals)},"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 a,i=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?t:(a=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:s+i.replace(/^\.\//,""),"url("+JSON.stringify(a)+")")}))}},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 a=(r=s,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),i=s.sources.map((function(t){return"/*# sourceURL="+s.sourceRoot+t+" */"}));return[n].concat(i).concat([a]).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={},a=0;a1&&(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;a1&&(window.location.href="/i/results?q="+this.searchTerm)},loadTrending:function(){var t=this;"daily"==this.trendingRange&&this.trendingDaily.length&&(this.trending=this.trendingDaily,this.trendingLoading=!1),"monthly"==this.trendingRange&&this.trendingMonthly.length&&(this.trending=this.trendingMonthly,this.trendingLoading=!1),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,t.trendingLoading=!1}))},trendingRangeToggle:function(t){this.trendingLoading=!0,this.trendingRange=t,this.loadTrending()},formatCount:function(t){return App.util.format.count(t)}}},i=s("KHd+"),a=Object(i.a)(n,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[t.loaded?s("div",[s("div",{staticClass:"d-block d-md-none border-top-0 pt-3"},[s("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(" "),s("section",{staticClass:"mt-3 mb-5 section-explore"},[s("div",{staticClass:"profile-timeline"},[s("div",{staticClass:"row p-0 mt-5"},[s("div",{staticClass:"col-12 mb-3 d-flex justify-content-between align-items-center"},[s("p",{staticClass:"d-block d-md-none h1 font-weight-bold mb-0"},[t._v("Trending")]),t._v(" "),s("p",{staticClass:"d-none d-md-block display-4 font-weight-bold mb-0"},[t._v("Trending")]),t._v(" "),s("div",[s("div",{staticClass:"btn-group"},[s("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(" "),s("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(" "),t.trendingLoading?s("div",{staticClass:"row d-flex align-items-center justify-content-center bg-light border",staticStyle:{"min-height":"40vh"}},[t._m(1)]):s("div",{staticClass:"row p-0 d-flex"},t._l(t.trending.slice(0,12),(function(e,n){return t.trending.length?s("div",{staticClass:"col-4 p-1 p-sm-2 p-md-3 pt-0"},[s("a",{staticClass:"card info-overlay card-md-border-0",attrs:{href:e.url}},[s("div",{staticClass:"square"},[e.sensitive?s("div",{staticClass:"square-content"},[t._m(0,!0),t._v(" "),s("blur-hash-canvas",{attrs:{width:"32",height:"32",hash:e.media_attachments[0].blurhash}})],1):s("div",{staticClass:"square-content"},[s("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?s("span",{staticClass:"float-right mr-3 post-icon"},[s("i",{staticClass:"fas fa-images fa-2x"})]):t._e(),t._v(" "),"video"==e.pf_type?s("span",{staticClass:"float-right mr-3 post-icon"},[s("i",{staticClass:"fas fa-video fa-2x"})]):t._e(),t._v(" "),"video:album"==e.pf_type?s("span",{staticClass:"float-right mr-3 post-icon"},[s("i",{staticClass:"fas fa-film fa-2x"})]):t._e(),t._v(" "),s("div",{staticClass:"info-overlay-text"},[s("h5",{staticClass:"text-white m-auto font-weight-bold"},[s("span",[s("span",{staticClass:"far fa-heart fa-lg p-2 d-flex-inline"}),t._v(" "),s("span",{staticClass:"d-flex-inline"},[t._v(t._s(t.formatCount(e.favourites_count)))])]),t._v(" "),s("span",[s("span",{staticClass:"far fa-comment fa-lg p-2 d-flex-inline"}),t._v(" "),s("span",{staticClass:"d-flex-inline"},[t._v(t._s(t.formatCount(e.reply_count)))])])])])])])]):s("div",{staticClass:"col-12 d-flex align-items-center justify-content-center bg-light border",staticStyle:{"min-height":"40vh"}},[s("div",{staticClass:"h2"},[t._v("No posts found :(")])])})),0)])]),t._v(" "),s("section",{staticClass:"pt-5 mb-5 section-explore"},[s("div",{staticClass:"profile-timeline pt-3"},[t._m(2),t._v(" "),t.recommendedLoading?s("div",{staticClass:"row d-flex align-items-center justify-content-center bg-light border",staticStyle:{"min-height":"40vh"}},[t._m(4)]):s("div",{staticClass:"row p-0 d-flex"},t._l(t.posts,(function(e,n){return t.posts.length?s("div",{key:"rmki:"+n,staticClass:"col-4 p-1 p-sm-2 p-md-3 pt-0"},[s("a",{staticClass:"card info-overlay card-md-border-0",attrs:{href:e.url}},[s("div",{staticClass:"square"},[e.sensitive?s("div",{staticClass:"square-content"},[t._m(3,!0),t._v(" "),s("blur-hash-canvas",{attrs:{width:"32",height:"32",hash:e.media_attachments[0].blurhash}})],1):s("div",{staticClass:"square-content"},[s("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?s("span",{staticClass:"float-right mr-3 post-icon"},[s("i",{staticClass:"fas fa-images fa-2x"})]):t._e(),t._v(" "),"video"==e.pf_type?s("span",{staticClass:"float-right mr-3 post-icon"},[s("i",{staticClass:"fas fa-video fa-2x"})]):t._e(),t._v(" "),"video:album"==e.pf_type?s("span",{staticClass:"float-right mr-3 post-icon"},[s("i",{staticClass:"fas fa-film fa-2x"})]):t._e(),t._v(" "),s("div",{staticClass:"info-overlay-text"},[s("h5",{staticClass:"text-white m-auto font-weight-bold"},[s("span",[s("span",{staticClass:"far fa-heart fa-lg p-2 d-flex-inline"}),t._v(" "),s("span",{staticClass:"d-flex-inline"},[t._v(t._s(t.formatCount(e.favourites_count)))])]),t._v(" "),s("span",[s("span",{staticClass:"far fa-comment fa-lg p-2 d-flex-inline"}),t._v(" "),s("span",{staticClass:"d-flex-inline"},[t._v(t._s(t.formatCount(e.reply_count)))])])])])])])]):s("div",{staticClass:"col-12 d-flex align-items-center justify-content-center bg-light border",staticStyle:{"min-height":"40vh"}},[s("div",{staticClass:"h2"},[t._v("No posts found :(")])])})),0)])])]):s("div",{staticClass:"d-flex justify-content-center align-items-center",staticStyle:{height:"70vh"}},[s("img",{attrs:{src:"/img/pixelfed-icon-grey.svg"}})])])}),[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:"spinner-border",attrs:{role:"status"}},[e("span",{staticClass:"sr-only"},[this._v("Loading...")])])},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"})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"spinner-border",attrs:{role:"status"}},[e("span",{staticClass:"sr-only"},[this._v("Loading...")])])}],!1,null,null,null);e.default=a.exports}},[[3,0]]]); \ No newline at end of file diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 36c53962a..d522a6080 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -15,7 +15,7 @@ "/js/compose-classic.js": "/js/compose-classic.js?id=283f19c895f4118a2a8b", "/js/developers.js": "/js/developers.js?id=f75deca5ccf47d43eb07", "/js/direct.js": "/js/direct.js?id=e1e4a830bfedc1870db1", - "/js/discover.js": "/js/discover.js?id=d1e4f93017303f85a8da", + "/js/discover.js": "/js/discover.js?id=20cfec71be5a1e4c5fc5", "/js/hashtag.js": "/js/hashtag.js?id=f22994116815f17a4ad0", "/js/loops.js": "/js/loops.js?id=1dcb3790eb9ea4ea5848", "/js/memoryprofile.js": "/js/memoryprofile.js?id=75ea0503eca4f7ad3642", diff --git a/resources/assets/js/components/DiscoverComponent.vue b/resources/assets/js/components/DiscoverComponent.vue index 69140e672..e1fa217a4 100644 --- a/resources/assets/js/components/DiscoverComponent.vue +++ b/resources/assets/js/components/DiscoverComponent.vue @@ -7,24 +7,8 @@
-
-

DISCOVER

-

DISCOVER

-
- -
-
- - {{tag.name}} -
- -
- -
+
@@ -38,8 +22,8 @@
-
-
+
+
+
+
No posts found :(
+
+
+
+
+ Loading... +
-
+
-
-

Categories

-

Categories

-
-
-
- -

{{category.name}}

-
- -
-
-
-
-
-
-
-

Discover. Categories.

-

Discover. Categories.

-

Discover amazing posts, people, places and hashtags.

-
-
-
-
-
-
-
- -

For You

For You

-
-
+
+
+
+
No posts found :(
+
+
+
+
+ Loading... +
- - -