1
0
Fork 0

Merge pull request #4563 from pixelfed/staging

Reblogs in feeds
This commit is contained in:
daniel 2023-07-30 04:11:47 -06:00 committed by GitHub
commit e559187411
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 771 additions and 565 deletions

View File

@ -6,6 +6,7 @@
- Import from Instagram ([#4466](https://github.com/pixelfed/pixelfed/pull/4466)) ([cf3078c5](https://github.com/pixelfed/pixelfed/commit/cf3078c5))
- Sign-in with Mastodon ([#4545](https://github.com/pixelfed/pixelfed/pull/4545)) ([45b9404e](https://github.com/pixelfed/pixelfed/commit/45b9404e))
- Health check endpoint at /api/service/health-check ([ff58f970](https://github.com/pixelfed/pixelfed/commit/ff58f970))
- Reblogs in home feed ([#4563](https://github.com/pixelfed/pixelfed/pull/4563)) ([b86d47bf](https://github.com/pixelfed/pixelfed/commit/b86d47bf))
### Updates
- Update Notifications.vue component, fix filtering logic to prevent endless spinner ([3df9b53f](https://github.com/pixelfed/pixelfed/commit/3df9b53f))
@ -42,6 +43,9 @@
- Update FanoutDeletePipeline, fix AP object ([0d802c31](https://github.com/pixelfed/pixelfed/commit/0d802c31))
- Update Remote Auth feature, fix custom domain bug and enforce banned domains ([acabf603](https://github.com/pixelfed/pixelfed/commit/acabf603))
- Update StatusService, reduce cache ttl from 7 days to 6 hours ([59b64378](https://github.com/pixelfed/pixelfed/commit/59b64378))
- Update ProfileController, allow albums in atom feed. Closes #4561. Fixes #4526 ([1c105a6c](https://github.com/pixelfed/pixelfed/commit/1c105a6c))
- Update admin users view, fix website value. Closes #4557 ([c469d475](https://github.com/pixelfed/pixelfed/commit/c469d475))
- Update StatusStatelessTransformer, allow unlisted reblogs ([1c13b518](https://github.com/pixelfed/pixelfed/commit/1c13b518))
- ([](https://github.com/pixelfed/pixelfed/commit/))
## [v0.11.8 (2023-05-29)](https://github.com/pixelfed/pixelfed/compare/v0.11.7...v0.11.8)

View File

@ -17,6 +17,7 @@ use App\Report;
use App\Profile;
use App\StatusArchived;
use App\User;
use App\UserSetting;
use App\Services\AccountService;
use App\Services\StatusService;
use App\Services\ProfileStatusService;
@ -845,4 +846,41 @@ class ApiV1Dot1Controller extends Controller
return StatusService::get($status->id, false);
}
public function getWebSettings(Request $request)
{
abort_if(!$request->user(), 403);
$uid = $request->user()->id;
$settings = UserSetting::firstOrCreate([
'user_id' => $uid
]);
if(!$settings->other) {
return [];
}
return $settings->other;
}
public function setWebSettings(Request $request)
{
abort_if(!$request->user(), 403);
$this->validate($request, [
'field' => 'required|in:enable_reblogs,hide_reblog_banner',
'value' => 'required'
]);
$field = $request->input('field');
$value = $request->input('value');
$settings = UserSetting::firstOrCreate([
'user_id' => $request->user()->id
]);
if(!$settings->other) {
$other = [];
} else {
$other = $settings->other;
}
$other[$field] = $value;
$settings->other = $other;
$settings->save();
return [200];
}
}

View File

@ -230,29 +230,43 @@ class SettingsController extends Controller
public function timelineSettings(Request $request)
{
$uid = $request->user()->id;
$pid = $request->user()->profile_id;
$top = Redis::zscore('pf:tl:top', $pid) != false;
$replies = Redis::zscore('pf:tl:replies', $pid) != false;
return view('settings.timeline', compact('top', 'replies'));
$userSettings = UserSetting::firstOrCreate([
'user_id' => $uid
]);
if(!$userSettings || !$userSettings->other) {
$userSettings = [
'enable_reblogs' => false,
];
} else {
$userSettings = $userSettings->other;
}
return view('settings.timeline', compact('top', 'replies', 'userSettings'));
}
public function updateTimelineSettings(Request $request)
{
$pid = $request->user()->profile_id;
$top = $request->has('top') && $request->input('top') === 'on';
$replies = $request->has('replies') && $request->input('replies') === 'on';
if($top) {
Redis::zadd('pf:tl:top', $pid, $pid);
} else {
$uid = $request->user()->id;
$this->validate($request, [
'enable_reblogs' => 'sometimes'
]);
Redis::zrem('pf:tl:top', $pid);
}
if($replies) {
Redis::zadd('pf:tl:replies', $pid, $pid);
} else {
Redis::zrem('pf:tl:replies', $pid);
$userSettings = UserSetting::firstOrCreate([
'user_id' => $uid
]);
if($userSettings->other) {
$other = $userSettings->other;
$other['enable_reblogs'] = $request->has('enable_reblogs');
} else {
$other['enable_reblogs'] = $request->has('enable_reblogs');
}
$userSettings->other = $other;
$userSettings->save();
return redirect(route('settings'))->with('status', 'Timeline settings successfully updated!');
}

View File

@ -33,7 +33,7 @@ class StatusStatelessTransformer extends Fractal\TransformerAbstract
'url' => $status->url(),
'in_reply_to_id' => $status->in_reply_to_id ? (string) $status->in_reply_to_id : null,
'in_reply_to_account_id' => $status->in_reply_to_profile_id ? (string) $status->in_reply_to_profile_id : null,
'reblog' => $status->reblog_of_id ? StatusService::get($status->reblog_of_id) : null,
'reblog' => $status->reblog_of_id ? StatusService::get($status->reblog_of_id, false) : null,
'content' => $status->rendered ?? $status->caption,
'content_text' => $status->caption,
'created_at' => str_replace('+00:00', 'Z', $status->created_at->format(DATE_RFC3339_EXTENDED)),

2
public/css/spa.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(()=>{"use strict";var e,r,n,o={},t={};function c(e){var r=t[e];if(void 0!==r)return r.exports;var n=t[e]={id:e,loaded:!1,exports:{}};return o[e].call(n.exports,n,n.exports,c),n.loaded=!0,n.exports}c.m=o,e=[],c.O=(r,n,o,t)=>{if(!n){var d=1/0;for(f=0;f<e.length;f++){for(var[n,o,t]=e[f],i=!0,a=0;a<n.length;a++)(!1&t||d>=t)&&Object.keys(c.O).every((e=>c.O[e](n[a])))?n.splice(a--,1):(i=!1,t<d&&(d=t));if(i){e.splice(f--,1);var s=o();void 0!==s&&(r=s)}}return r}t=t||0;for(var f=e.length;f>0&&e[f-1][2]>t;f--)e[f]=e[f-1];e[f]=[n,o,t]},c.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return c.d(r,{a:r}),r},c.d=(e,r)=>{for(var n in r)c.o(r,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce(((r,n)=>(c.f[n](e,r),r)),[])),c.u=e=>"js/"+{1084:"profile~followers.bundle",2470:"home.chunk",2530:"discover~myhashtags.chunk",2586:"compose.chunk",2732:"dms~message.chunk",3351:"discover~settings.chunk",3365:"dms.chunk",3623:"discover~findfriends.chunk",4028:"error404.bundle",4958:"discover.chunk",4965:"discover~memories.chunk",5865:"post.chunk",6053:"notifications.chunk",6869:"profile.chunk",7019:"discover~hashtag.bundle",8250:"i18n.bundle",8517:"daci.chunk",8600:"changelog.bundle",8625:"profile~following.bundle",8900:"discover~serverfeed.chunk"}[e]+"."+{1084:"f088062414c3b014",2470:"2d93b527d492e6de",2530:"70e91906f0ce857a",2586:"6464688bf5b5ef97",2732:"990c68dfc266b0cf",3351:"72cc15c7b87b662d",3365:"98e12cf9137ddd87",3623:"006f0079e9f5a3eb",4028:"182d0aaa2da9ed23",4958:"56d2d8cfbbecc761",4965:"4c0973f4400f25b4",5865:"cd535334efc77c34",6053:"bf0c641eb1fd9cde",6869:"2fefc77fa8b9e0d3",7019:"54f2ac43c55bf328",8250:"4a5ff18de549ac4e",8517:"914d307d69fcfcd4",8600:"c4c82057f9628c72",8625:"57cbb89efa73e324",8900:"017fd16f00c55e60"}[e]+".js",c.miniCssF=e=>({138:"css/spa",703:"css/admin",1242:"css/appdark",6170:"css/app",8737:"css/portfolio",9994:"css/landing"}[e]+".css"),c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r={},n="pixelfed:",c.l=(e,o,t,d)=>{if(r[e])r[e].push(o);else{var i,a;if(void 0!==t)for(var s=document.getElementsByTagName("script"),f=0;f<s.length;f++){var l=s[f];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==n+t){i=l;break}}i||(a=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,c.nc&&i.setAttribute("nonce",c.nc),i.setAttribute("data-webpack",n+t),i.src=e),r[e]=[o];var u=(n,o)=>{i.onerror=i.onload=null,clearTimeout(b);var t=r[e];if(delete r[e],i.parentNode&&i.parentNode.removeChild(i),t&&t.forEach((e=>e(o))),n)return n(o)},b=setTimeout(u.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=u.bind(null,i.onerror),i.onload=u.bind(null,i.onload),a&&document.head.appendChild(i)}},c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),c.p="/",(()=>{var e={8929:0,1242:0,6170:0,8737:0,703:0,9994:0,138:0};c.f.j=(r,n)=>{var o=c.o(e,r)?e[r]:void 0;if(0!==o)if(o)n.push(o[2]);else if(/^(1242|138|6170|703|8737|8929|9994)$/.test(r))e[r]=0;else{var t=new Promise(((n,t)=>o=e[r]=[n,t]));n.push(o[2]=t);var d=c.p+c.u(r),i=new Error;c.l(d,(n=>{if(c.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var t=n&&("load"===n.type?"missing":n.type),d=n&&n.target&&n.target.src;i.message="Loading chunk "+r+" failed.\n("+t+": "+d+")",i.name="ChunkLoadError",i.type=t,i.request=d,o[1](i)}}),"chunk-"+r,r)}},c.O.j=r=>0===e[r];var r=(r,n)=>{var o,t,[d,i,a]=n,s=0;if(d.some((r=>0!==e[r]))){for(o in i)c.o(i,o)&&(c.m[o]=i[o]);if(a)var f=a(c)}for(r&&r(n);s<d.length;s++)t=d[s],c.o(e,t)&&e[t]&&e[t][0](),e[t]=0;return c.O(f)},n=self.webpackChunkpixelfed=self.webpackChunkpixelfed||[];n.forEach(r.bind(null,0)),n.push=r.bind(null,n.push.bind(n))})(),c.nc=void 0})();
(()=>{"use strict";var e,r,n,o={},t={};function d(e){var r=t[e];if(void 0!==r)return r.exports;var n=t[e]={id:e,loaded:!1,exports:{}};return o[e].call(n.exports,n,n.exports,d),n.loaded=!0,n.exports}d.m=o,e=[],d.O=(r,n,o,t)=>{if(!n){var a=1/0;for(l=0;l<e.length;l++){for(var[n,o,t]=e[l],c=!0,i=0;i<n.length;i++)(!1&t||a>=t)&&Object.keys(d.O).every((e=>d.O[e](n[i])))?n.splice(i--,1):(c=!1,t<a&&(a=t));if(c){e.splice(l--,1);var s=o();void 0!==s&&(r=s)}}return r}t=t||0;for(var l=e.length;l>0&&e[l-1][2]>t;l--)e[l]=e[l-1];e[l]=[n,o,t]},d.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return d.d(r,{a:r}),r},d.d=(e,r)=>{for(var n in r)d.o(r,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce(((r,n)=>(d.f[n](e,r),r)),[])),d.u=e=>"js/"+{1084:"profile~followers.bundle",2470:"home.chunk",2530:"discover~myhashtags.chunk",2586:"compose.chunk",2732:"dms~message.chunk",3351:"discover~settings.chunk",3365:"dms.chunk",3623:"discover~findfriends.chunk",4028:"error404.bundle",4958:"discover.chunk",4965:"discover~memories.chunk",5865:"post.chunk",6053:"notifications.chunk",6869:"profile.chunk",7019:"discover~hashtag.bundle",8250:"i18n.bundle",8517:"daci.chunk",8600:"changelog.bundle",8625:"profile~following.bundle",8900:"discover~serverfeed.chunk"}[e]+"."+{1084:"f088062414c3b014",2470:"3be19ae25a42cbd5",2530:"4b413213e12db5b8",2586:"6464688bf5b5ef97",2732:"990c68dfc266b0cf",3351:"491f217e6c54be1e",3365:"98e12cf9137ddd87",3623:"ae74572b77d74920",4028:"182d0aaa2da9ed23",4958:"56d2d8cfbbecc761",4965:"25ef142d12a48a20",5865:"ce42d6040d1683fd",6053:"bf0c641eb1fd9cde",6869:"e30bbdae030833e4",7019:"54f2ac43c55bf328",8250:"4a5ff18de549ac4e",8517:"06d17098233d10d2",8600:"c4c82057f9628c72",8625:"57cbb89efa73e324",8900:"1dace6b026047712"}[e]+".js",d.miniCssF=e=>({138:"css/spa",703:"css/admin",1242:"css/appdark",6170:"css/app",8737:"css/portfolio",9994:"css/landing"}[e]+".css"),d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r={},n="pixelfed:",d.l=(e,o,t,a)=>{if(r[e])r[e].push(o);else{var c,i;if(void 0!==t)for(var s=document.getElementsByTagName("script"),l=0;l<s.length;l++){var u=s[l];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==n+t){c=u;break}}c||(i=!0,(c=document.createElement("script")).charset="utf-8",c.timeout=120,d.nc&&c.setAttribute("nonce",d.nc),c.setAttribute("data-webpack",n+t),c.src=e),r[e]=[o];var f=(n,o)=>{c.onerror=c.onload=null,clearTimeout(b);var t=r[e];if(delete r[e],c.parentNode&&c.parentNode.removeChild(c),t&&t.forEach((e=>e(o))),n)return n(o)},b=setTimeout(f.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=f.bind(null,c.onerror),c.onload=f.bind(null,c.onload),i&&document.head.appendChild(c)}},d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),d.p="/",(()=>{var e={8929:0,1242:0,6170:0,8737:0,703:0,9994:0,138:0};d.f.j=(r,n)=>{var o=d.o(e,r)?e[r]:void 0;if(0!==o)if(o)n.push(o[2]);else if(/^(1242|138|6170|703|8737|8929|9994)$/.test(r))e[r]=0;else{var t=new Promise(((n,t)=>o=e[r]=[n,t]));n.push(o[2]=t);var a=d.p+d.u(r),c=new Error;d.l(a,(n=>{if(d.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var t=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;c.message="Loading chunk "+r+" failed.\n("+t+": "+a+")",c.name="ChunkLoadError",c.type=t,c.request=a,o[1](c)}}),"chunk-"+r,r)}},d.O.j=r=>0===e[r];var r=(r,n)=>{var o,t,[a,c,i]=n,s=0;if(a.some((r=>0!==e[r]))){for(o in c)d.o(c,o)&&(d.m[o]=c[o]);if(i)var l=i(d)}for(r&&r(n);s<a.length;s++)t=a[s],d.o(e,t)&&e[t]&&e[t][0](),e[t]=0;return d.O(l)},n=self.webpackChunkpixelfed=self.webpackChunkpixelfed||[];n.forEach(r.bind(null,0)),n.push=r.bind(null,n.push.bind(n))})(),d.nc=void 0})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -24,17 +24,17 @@
"/js/admin_invite.js": "/js/admin_invite.js?id=307a53250701e3b12164af9495e88447",
"/js/landing.js": "/js/landing.js?id=7e3ab65813c4bf28182f5bdf0825774c",
"/js/remote_auth.js": "/js/remote_auth.js?id=0840f85f648319858b72c299b8c51f9e",
"/js/manifest.js": "/js/manifest.js?id=1a9e092e7f4051b3ce0af3c638c8d2c5",
"/js/home.chunk.2d93b527d492e6de.js": "/js/home.chunk.2d93b527d492e6de.js?id=809ef226cf2383e3a8973f65d4269d1c",
"/js/manifest.js": "/js/manifest.js?id=07b498a33a400be250a88d88bc871fb0",
"/js/home.chunk.3be19ae25a42cbd5.js": "/js/home.chunk.3be19ae25a42cbd5.js?id=b64c0ad91a630c8981ed13e8b3c21a82",
"/js/compose.chunk.6464688bf5b5ef97.js": "/js/compose.chunk.6464688bf5b5ef97.js?id=45753d769a16276c2d3ad8d7d6bf3e88",
"/js/post.chunk.cd535334efc77c34.js": "/js/post.chunk.cd535334efc77c34.js?id=73e7e49b1dbdb75d2a128d21e6e3e9f4",
"/js/profile.chunk.2fefc77fa8b9e0d3.js": "/js/profile.chunk.2fefc77fa8b9e0d3.js?id=ff489b9c2880c30e5d3f993220b43305",
"/js/discover~memories.chunk.4c0973f4400f25b4.js": "/js/discover~memories.chunk.4c0973f4400f25b4.js?id=6eb8a14fe9aa1d4fe3f0264022793b12",
"/js/discover~myhashtags.chunk.70e91906f0ce857a.js": "/js/discover~myhashtags.chunk.70e91906f0ce857a.js?id=5639e162321efa8b13f23b125c632bab",
"/js/daci.chunk.914d307d69fcfcd4.js": "/js/daci.chunk.914d307d69fcfcd4.js?id=c843c795b8551593eb19dffe1e08e694",
"/js/discover~findfriends.chunk.006f0079e9f5a3eb.js": "/js/discover~findfriends.chunk.006f0079e9f5a3eb.js?id=22613dff39488d0ad0c443bb6f437f5c",
"/js/discover~serverfeed.chunk.017fd16f00c55e60.js": "/js/discover~serverfeed.chunk.017fd16f00c55e60.js?id=79ced2608439f8959b2fd6a84aa071dd",
"/js/discover~settings.chunk.72cc15c7b87b662d.js": "/js/discover~settings.chunk.72cc15c7b87b662d.js?id=71342f3e1b333d80962e9e4b81fbe773",
"/js/post.chunk.ce42d6040d1683fd.js": "/js/post.chunk.ce42d6040d1683fd.js?id=f172bffa71780cc425820b0c1010577b",
"/js/profile.chunk.e30bbdae030833e4.js": "/js/profile.chunk.e30bbdae030833e4.js?id=97f26374224bf2aa8e4dc3d7f0b7197c",
"/js/discover~memories.chunk.25ef142d12a48a20.js": "/js/discover~memories.chunk.25ef142d12a48a20.js?id=e45f99fb5de80a4cc506f7b4661e6f15",
"/js/discover~myhashtags.chunk.4b413213e12db5b8.js": "/js/discover~myhashtags.chunk.4b413213e12db5b8.js?id=210df99443921eb091e8e895fd50cbf8",
"/js/daci.chunk.06d17098233d10d2.js": "/js/daci.chunk.06d17098233d10d2.js?id=ffb2157c35222c0412cc77c96f016c39",
"/js/discover~findfriends.chunk.ae74572b77d74920.js": "/js/discover~findfriends.chunk.ae74572b77d74920.js?id=316920833fd30ae8dcc908e705e0794d",
"/js/discover~serverfeed.chunk.1dace6b026047712.js": "/js/discover~serverfeed.chunk.1dace6b026047712.js?id=816f2bc0f71c105af9fdc54cbc52241a",
"/js/discover~settings.chunk.491f217e6c54be1e.js": "/js/discover~settings.chunk.491f217e6c54be1e.js?id=34071d5808c937a1ec3551bda24aaa1a",
"/js/discover.chunk.56d2d8cfbbecc761.js": "/js/discover.chunk.56d2d8cfbbecc761.js?id=25a401188e2fd2a43dec8011d9d62044",
"/js/notifications.chunk.bf0c641eb1fd9cde.js": "/js/notifications.chunk.bf0c641eb1fd9cde.js?id=5a6628e276da9c85244770910f817c0d",
"/js/dms.chunk.98e12cf9137ddd87.js": "/js/dms.chunk.98e12cf9137ddd87.js?id=527795bd736f56ff7d0addb623f0d60b",
@ -50,6 +50,6 @@
"/css/portfolio.css": "/css/portfolio.css?id=d98e354f173c6a8b729626384dceaa90",
"/css/admin.css": "/css/admin.css?id=0a66549bf79b75a0ca8cb83d11a4e2f4",
"/css/landing.css": "/css/landing.css?id=589f3fa192867727925921b0f68ce022",
"/css/spa.css": "/css/spa.css?id=f6bef1e343335ee2b5cf4e9fc074856f",
"/css/spa.css": "/css/spa.css?id=1bdfa6eb676f51cb5931729abfa6dfd8",
"/js/vendor.js": "/js/vendor.js?id=a0cc6867663084472494dceda20c3392"
}

View File

@ -1,4 +1,15 @@
<template>
<div>
<div v-if="isReblog" class="card-header bg-light border-0" style="border-top-left-radius: 15px;border-top-right-radius: 15px;">
<div class="media align-items-center" style="height:10px;">
<a :href="reblogAccount.url" class="mx-2" @click.prevent="goToProfileById(reblogAccount.id)">
<img :src="reblogAccount.avatar" style="border-radius:10px;" width="24" height="24" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=0';">
</a>
<div style="font-size:12px;font-weight:bold">
<i class="far fa-retweet text-warning mr-1"></i> Reblogged by <a :href="reblogAccount.url" class="text-dark" @click.prevent="goToProfileById(reblogAccount.id)">&commat;{{ reblogAccount.acct }}</a>
</div>
</div>
</div>
<div class="card-header border-0" style="border-top-left-radius: 15px;border-top-right-radius: 15px;">
<div class="media align-items-center">
<a :href="status.account.url" @click.prevent="goToProfile()" style="margin-right: 10px;">
@ -86,6 +97,7 @@
<edit-history-modal ref="editModal" :status="status" />
</div>
</div>
</template>
<script type="text/javascript">
@ -105,6 +117,15 @@
useDropdownMenu: {
type: Boolean,
default: false
},
isReblog: {
type: Boolean,
default: false
},
reblogAccount: {
type: Object
}
},
@ -204,6 +225,19 @@
})
},
goToProfileById(id) {
this.$nextTick(() => {
this.$router.push({
name: 'profile',
path: `/i/web/profile/${id}`,
params: {
id: id,
cachedUser: this.profile
}
});
});
},
goToProfile() {
this.$nextTick(() => {
this.$router.push({

View File

@ -8,6 +8,30 @@
</div>
<div v-else>
<transition name="fade">
<div v-if="showReblogBanner && getScope() === 'home'" class="card bg-g-amin card-body shadow-sm mb-3" style="border-radius: 15px;">
<div class="d-flex justify-content-around align-items-center">
<div class="flex-grow-1 ft-std">
<h2 class="font-weight-bold text-white mb-0">Introducing Reblogs in feeds</h2>
<hr />
<p class="lead text-white mb-0">
See reblogs from accounts you follow in your home feed!
</p>
<p class="text-white small mb-1" style="opacity:0.6">
You can disable reblogs in feeds on the Timeline Settings page.
</p>
<hr />
<div class="d-flex">
<button class="btn btn-light rounded-pill font-weight-bold btn-block mr-2" @click.prevent="enableReblogs()">
<template v-if="!enablingReblogs">Show reblogs in home feed</template>
<b-spinner small v-else />
</button>
<button class="btn btn-outline-light rounded-pill font-weight-bold px-5" @click.prevent="hideReblogs()">Hide</button>
</div>
</div>
</div>
</div>
</transition>
<status
v-for="(status, index) in feed"
:key="'pf_feed:' + status.id + ':idx:' + index + ':fui:' + forceUpdateIdx"
@ -140,6 +164,7 @@
data() {
return {
settings: [],
isLoaded: false,
feed: [],
ids: [],
@ -159,7 +184,9 @@
reportedStatusId: 0,
showSharesModal: false,
sharesModalPost: {},
forceUpdateIdx: 0
forceUpdateIdx: 0,
showReblogBanner: false,
enablingReblogs: false
}
},
@ -174,7 +201,7 @@
return;
};
}
this.fetchTimeline();
this.fetchSettings();
},
methods: {
@ -194,13 +221,48 @@
}
},
fetchTimeline(scrollToTop = false) {
let url = `/api/pixelfed/v1/timelines/${this.getScope()}`;
axios.get(url, {
params: {
max_id: this.max_id,
limit: 6
fetchSettings() {
axios.get('/api/pixelfed/v1/web/settings')
.then(res => {
this.settings = res.data;
if(!res.data) {
this.showReblogBanner = true;
} else {
if(res.data.hasOwnProperty('hide_reblog_banner')) {
} else if(res.data.hasOwnProperty('enable_reblogs')) {
if(!res.data.enable_reblogs) {
this.showReblogBanner = true;
}
} else {
this.showReblogBanner = true;
}
}
})
.finally(() => {
this.fetchTimeline();
})
},
fetchTimeline(scrollToTop = false) {
let url, params;
if(this.getScope() === 'home' && this.settings && this.settings.hasOwnProperty('enable_reblogs') && this.settings.enable_reblogs) {
url = `/api/v1/timelines/home`;
params = {
'_pe': 1,
max_id: this.max_id,
limit: 6,
include_reblogs: true,
}
} else {
url = `/api/pixelfed/v1/timelines/${this.getScope()}`;
params = {
max_id: this.max_id,
limit: 6,
}
}
axios.get(url, {
params: params
}).then(res => {
let ids = res.data.map(p => {
if(p && p.hasOwnProperty('relationship')) {
@ -242,12 +304,24 @@
this.isFetchingMore = true;
let url = `/api/pixelfed/v1/timelines/${this.getScope()}`;
axios.get(url, {
params: {
let url, params;
if(this.getScope() === 'home' && this.settings && this.settings.hasOwnProperty('enable_reblogs') && this.settings.enable_reblogs) {
url = `/api/v1/timelines/home`;
params = {
'_pe': 1,
max_id: this.max_id,
limit: 6
limit: 6,
include_reblogs: true,
}
} else {
url = `/api/pixelfed/v1/timelines/${this.getScope()}`;
params = {
max_id: this.max_id,
limit: 6,
}
}
axios.get(url, {
params: params
}).then(res => {
if(!res.data.length) {
this.endFeedReached = true;
@ -568,7 +642,31 @@
this.$nextTick(() => {
this.forceUpdateIdx++;
});
}
},
enableReblogs() {
this.enablingReblogs = true;
axios.post('/api/pixelfed/v1/web/settings', {
field: 'enable_reblogs',
value: true
})
.then(res => {
setTimeout(() => {
window.location.reload();
}, 1000);
})
},
hideReblogs() {
this.showReblogBanner = false;
axios.post('/api/pixelfed/v1/web/settings', {
field: 'hide_reblog_banner',
value: true
})
.then(res => {
})
},
},
watch: {

View File

@ -152,6 +152,12 @@ body {
color: var(--primary);
}
.bg-g-amin {
background: #8E2DE2;
background: -webkit-linear-gradient(to right, #4A00E0, #8E2DE2);
background: linear-gradient(to left, #4A00E0, #8E2DE2);
}
.text-lighter {
color: var(--text-lighter) !important;
}
@ -382,6 +388,10 @@ span.twitter-typeahead .tt-suggestion:focus {
}
}
.ft-std {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.timeline-status-component {
.username {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

View File

@ -78,7 +78,7 @@
</div>
<div class="form-group">
<label class="font-weight-bold text-muted">Website</label>
<input type="text" class="form-control" name="website" value="{{$user->website}}" placeholder="No website added">
<input type="text" class="form-control" name="website" value="{{$profile->website}}" placeholder="No website added">
</div>
<div class="form-group">
<label class="font-weight-bold text-muted">Admin</label>

View File

@ -8,17 +8,23 @@
<hr>
<form method="post">
@csrf
<div class="form-check pb-3">
<div class="form-check pb-3 d-none">
<input class="form-check-input" type="checkbox" name="top" {{$top ? 'checked':''}}>
<label class="form-check-label font-weight-bold" for="">Show text-only posts</label>
<p class="text-muted small help-text">Show text-only posts from accounts you follow. (Home timeline only)</p>
</div>
<div class="form-check pb-3">
<div class="form-check pb-3 d-none">
<input class="form-check-input" type="checkbox" name="replies" {{$replies ? 'checked':''}}>
<label class="form-check-label font-weight-bold" for="">Show replies</label>
<p class="text-muted small help-text">Show replies from accounts you follow. (Home timeline only)</p>
</div>
<div class="form-check pb-3">
<input class="form-check-input" type="checkbox" name="enable_reblogs" {{$userSettings['enable_reblogs'] ? 'checked':''}}>
<label class="form-check-label font-weight-bold" for="">Show reblogs</label>
<p class="text-muted small help-text">See reblogs from accounts you follow in your home feed. (Home timeline only)</p>
</div>
<div class="form-group row mt-5 pt-5">
<div class="col-12 text-right">
<hr>

View File

@ -304,6 +304,8 @@ Route::group(['prefix' => 'api'], function() use($middleware) {
Route::get('posts/{id}/{slug}', 'Api\ApiV1Dot1Controller@placesById')->middleware($middleware);
});
Route::get('web/settings', 'Api\ApiV1Dot1Controller@getWebSettings')->middleware($middleware);
Route::post('web/settings', 'Api\ApiV1Dot1Controller@setWebSettings')->middleware($middleware);
Route::get('app/settings', 'UserAppSettingsController@get')->middleware($middleware);
Route::post('app/settings', 'UserAppSettingsController@store')->middleware($middleware);