Merge pull request #4566 from pixelfed/staging
Add Photo reblogs only setting
This commit is contained in:
commit
5cdf076527
8 changed files with 31 additions and 16 deletions
|
@ -48,6 +48,7 @@
|
|||
- Update StatusStatelessTransformer, allow unlisted reblogs ([1c13b518](https://github.com/pixelfed/pixelfed/commit/1c13b518))
|
||||
- Update ApiV1Controller, hydrate reblog state in home timeline ([13bdaa2e](https://github.com/pixelfed/pixelfed/commit/13bdaa2e))
|
||||
- Update Timeline component, improve reblog support ([29de91e5](https://github.com/pixelfed/pixelfed/commit/29de91e5))
|
||||
- Update timeline settings, add photo reblogs only option ([e2705b9a](https://github.com/pixelfed/pixelfed/commit/e2705b9a))
|
||||
- ([](https://github.com/pixelfed/pixelfed/commit/))
|
||||
|
||||
## [v0.11.8 (2023-05-29)](https://github.com/pixelfed/pixelfed/compare/v0.11.7...v0.11.8)
|
||||
|
|
|
@ -231,43 +231,51 @@ 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;
|
||||
$pid = $request->user()->profile_id;
|
||||
$top = Redis::zscore('pf:tl:top', $pid) != false;
|
||||
$replies = Redis::zscore('pf:tl:replies', $pid) != false;
|
||||
$userSettings = UserSetting::firstOrCreate([
|
||||
'user_id' => $uid
|
||||
]);
|
||||
if(!$userSettings || !$userSettings->other) {
|
||||
$userSettings = [
|
||||
'enable_reblogs' => false,
|
||||
'photo_reblogs_only' => false
|
||||
];
|
||||
} else {
|
||||
$userSettings = $userSettings->other;
|
||||
$userSettings = array_merge([
|
||||
'enable_reblogs' => false,
|
||||
'photo_reblogs_only' => false
|
||||
],
|
||||
$userSettings->other);
|
||||
}
|
||||
return view('settings.timeline', compact('top', 'replies', 'userSettings'));
|
||||
return view('settings.timeline', compact('top', 'replies', 'userSettings'));
|
||||
}
|
||||
|
||||
public function updateTimelineSettings(Request $request)
|
||||
{
|
||||
$pid = $request->user()->profile_id;
|
||||
$uid = $request->user()->id;
|
||||
$uid = $request->user()->id;
|
||||
$this->validate($request, [
|
||||
'enable_reblogs' => 'sometimes'
|
||||
'enable_reblogs' => 'sometimes',
|
||||
'photo_reblogs_only' => 'sometimes'
|
||||
]);
|
||||
Redis::zrem('pf:tl:top', $pid);
|
||||
Redis::zrem('pf:tl:replies', $pid);
|
||||
Redis::zrem('pf:tl:top', $pid);
|
||||
Redis::zrem('pf:tl:replies', $pid);
|
||||
$userSettings = UserSetting::firstOrCreate([
|
||||
'user_id' => $uid
|
||||
]);
|
||||
if($userSettings->other) {
|
||||
if($userSettings->other) {
|
||||
$other = $userSettings->other;
|
||||
$other['enable_reblogs'] = $request->has('enable_reblogs');
|
||||
$other['photo_reblogs_only'] = $request->has('photo_reblogs_only');
|
||||
} else {
|
||||
$other['enable_reblogs'] = $request->has('enable_reblogs');
|
||||
$other['photo_reblogs_only'] = $request->has('photo_reblogs_only');
|
||||
}
|
||||
$userSettings->other = $other;
|
||||
$userSettings->save();
|
||||
return redirect(route('settings'))->with('status', 'Timeline settings successfully updated!');
|
||||
return redirect(route('settings'))->with('status', 'Timeline settings successfully updated!');
|
||||
}
|
||||
|
||||
public function mediaSettings(Request $request)
|
||||
|
|
2
public/js/home.chunk.e9ae8285416aa78f.js
vendored
2
public/js/home.chunk.e9ae8285416aa78f.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/home.chunk.f5594d49a6bead99.js
vendored
Normal file
2
public/js/home.chunk.f5594d49a6bead99.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
public/js/manifest.js
vendored
2
public/js/manifest.js
vendored
|
@ -1 +1 @@
|
|||
(()=>{"use strict";var e,r,n,o={},t={};function a(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,a),n.loaded=!0,n.exports}a.m=o,e=[],a.O=(r,n,o,t)=>{if(!n){var c=1/0;for(f=0;f<e.length;f++){for(var[n,o,t]=e[f],d=!0,i=0;i<n.length;i++)(!1&t||c>=t)&&Object.keys(a.O).every((e=>a.O[e](n[i])))?n.splice(i--,1):(d=!1,t<c&&(c=t));if(d){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]},a.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return a.d(r,{a:r}),r},a.d=(e,r)=>{for(var n in r)a.o(r,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((r,n)=>(a.f[n](e,r),r)),[])),a.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:"e9ae8285416aa78f",2530:"c973b20c8878052f",2586:"6464688bf5b5ef97",2732:"990c68dfc266b0cf",3351:"ef99ab7d5116b492",3365:"98e12cf9137ddd87",3623:"d691be73c68195ac",4028:"182d0aaa2da9ed23",4958:"56d2d8cfbbecc761",4965:"4f59af2dab851399",5865:"741e92852b834d92",6053:"bf0c641eb1fd9cde",6869:"3f076e6eff0c5ede",7019:"54f2ac43c55bf328",8250:"4a5ff18de549ac4e",8517:"b9e8578923bea3c3",8600:"c4c82057f9628c72",8625:"57cbb89efa73e324",8900:"8f3f1aaa21cefc1d"}[e]+".js",a.miniCssF=e=>({138:"css/spa",703:"css/admin",1242:"css/appdark",6170:"css/app",8737:"css/portfolio",9994:"css/landing"}[e]+".css"),a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r={},n="pixelfed:",a.l=(e,o,t,c)=>{if(r[e])r[e].push(o);else{var d,i;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){d=l;break}}d||(i=!0,(d=document.createElement("script")).charset="utf-8",d.timeout=120,a.nc&&d.setAttribute("nonce",a.nc),d.setAttribute("data-webpack",n+t),d.src=e),r[e]=[o];var u=(n,o)=>{d.onerror=d.onload=null,clearTimeout(b);var t=r[e];if(delete r[e],d.parentNode&&d.parentNode.removeChild(d),t&&t.forEach((e=>e(o))),n)return n(o)},b=setTimeout(u.bind(null,void 0,{type:"timeout",target:d}),12e4);d.onerror=u.bind(null,d.onerror),d.onload=u.bind(null,d.onload),i&&document.head.appendChild(d)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),a.p="/",(()=>{var e={8929:0,1242:0,6170:0,8737:0,703:0,9994:0,138:0};a.f.j=(r,n)=>{var o=a.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 c=a.p+a.u(r),d=new Error;a.l(c,(n=>{if(a.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var t=n&&("load"===n.type?"missing":n.type),c=n&&n.target&&n.target.src;d.message="Loading chunk "+r+" failed.\n("+t+": "+c+")",d.name="ChunkLoadError",d.type=t,d.request=c,o[1](d)}}),"chunk-"+r,r)}},a.O.j=r=>0===e[r];var r=(r,n)=>{var o,t,[c,d,i]=n,s=0;if(c.some((r=>0!==e[r]))){for(o in d)a.o(d,o)&&(a.m[o]=d[o]);if(i)var f=i(a)}for(r&&r(n);s<c.length;s++)t=c[s],a.o(e,t)&&e[t]&&e[t][0](),e[t]=0;return a.O(f)},n=self.webpackChunkpixelfed=self.webpackChunkpixelfed||[];n.forEach(r.bind(null,0)),n.push=r.bind(null,n.push.bind(n))})(),a.nc=void 0})();
|
||||
(()=>{"use strict";var e,r,n,o={},t={};function a(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,a),n.loaded=!0,n.exports}a.m=o,e=[],a.O=(r,n,o,t)=>{if(!n){var c=1/0;for(f=0;f<e.length;f++){for(var[n,o,t]=e[f],d=!0,i=0;i<n.length;i++)(!1&t||c>=t)&&Object.keys(a.O).every((e=>a.O[e](n[i])))?n.splice(i--,1):(d=!1,t<c&&(c=t));if(d){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]},a.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return a.d(r,{a:r}),r},a.d=(e,r)=>{for(var n in r)a.o(r,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((r,n)=>(a.f[n](e,r),r)),[])),a.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:"f5594d49a6bead99",2530:"c973b20c8878052f",2586:"6464688bf5b5ef97",2732:"990c68dfc266b0cf",3351:"ef99ab7d5116b492",3365:"98e12cf9137ddd87",3623:"d691be73c68195ac",4028:"182d0aaa2da9ed23",4958:"56d2d8cfbbecc761",4965:"4f59af2dab851399",5865:"741e92852b834d92",6053:"bf0c641eb1fd9cde",6869:"3f076e6eff0c5ede",7019:"54f2ac43c55bf328",8250:"4a5ff18de549ac4e",8517:"b9e8578923bea3c3",8600:"c4c82057f9628c72",8625:"57cbb89efa73e324",8900:"8f3f1aaa21cefc1d"}[e]+".js",a.miniCssF=e=>({138:"css/spa",703:"css/admin",1242:"css/appdark",6170:"css/app",8737:"css/portfolio",9994:"css/landing"}[e]+".css"),a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r={},n="pixelfed:",a.l=(e,o,t,c)=>{if(r[e])r[e].push(o);else{var d,i;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){d=l;break}}d||(i=!0,(d=document.createElement("script")).charset="utf-8",d.timeout=120,a.nc&&d.setAttribute("nonce",a.nc),d.setAttribute("data-webpack",n+t),d.src=e),r[e]=[o];var u=(n,o)=>{d.onerror=d.onload=null,clearTimeout(b);var t=r[e];if(delete r[e],d.parentNode&&d.parentNode.removeChild(d),t&&t.forEach((e=>e(o))),n)return n(o)},b=setTimeout(u.bind(null,void 0,{type:"timeout",target:d}),12e4);d.onerror=u.bind(null,d.onerror),d.onload=u.bind(null,d.onload),i&&document.head.appendChild(d)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),a.p="/",(()=>{var e={8929:0,1242:0,6170:0,8737:0,703:0,9994:0,138:0};a.f.j=(r,n)=>{var o=a.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 c=a.p+a.u(r),d=new Error;a.l(c,(n=>{if(a.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var t=n&&("load"===n.type?"missing":n.type),c=n&&n.target&&n.target.src;d.message="Loading chunk "+r+" failed.\n("+t+": "+c+")",d.name="ChunkLoadError",d.type=t,d.request=c,o[1](d)}}),"chunk-"+r,r)}},a.O.j=r=>0===e[r];var r=(r,n)=>{var o,t,[c,d,i]=n,s=0;if(c.some((r=>0!==e[r]))){for(o in d)a.o(d,o)&&(a.m[o]=d[o]);if(i)var f=i(a)}for(r&&r(n);s<c.length;s++)t=c[s],a.o(e,t)&&e[t]&&e[t][0](),e[t]=0;return a.O(f)},n=self.webpackChunkpixelfed=self.webpackChunkpixelfed||[];n.forEach(r.bind(null,0)),n.push=r.bind(null,n.push.bind(n))})(),a.nc=void 0})();
|
|
@ -24,8 +24,8 @@
|
|||
"/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=9d40a00861ba312613ff6015cde6b389",
|
||||
"/js/home.chunk.e9ae8285416aa78f.js": "/js/home.chunk.e9ae8285416aa78f.js?id=78bf1a789078f0bcc7c60517f04f62a6",
|
||||
"/js/manifest.js": "/js/manifest.js?id=5972cd228c1781b241d64d16f829339a",
|
||||
"/js/home.chunk.f5594d49a6bead99.js": "/js/home.chunk.f5594d49a6bead99.js?id=434dc40a41dc02beb78189e146ef54e9",
|
||||
"/js/compose.chunk.6464688bf5b5ef97.js": "/js/compose.chunk.6464688bf5b5ef97.js?id=45753d769a16276c2d3ad8d7d6bf3e88",
|
||||
"/js/post.chunk.741e92852b834d92.js": "/js/post.chunk.741e92852b834d92.js?id=7d3dbcadad5d69074862aa86ad26bfab",
|
||||
"/js/profile.chunk.3f076e6eff0c5ede.js": "/js/profile.chunk.3f076e6eff0c5ede.js?id=a508e2e49925bf1ff2ac4b1b0ecf7fe8",
|
||||
|
|
|
@ -25,6 +25,12 @@
|
|||
<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-check pb-3">
|
||||
<input class="form-check-input" type="checkbox" name="photo_reblogs_only" {{$userSettings['photo_reblogs_only'] ? 'checked':''}}>
|
||||
<label class="form-check-label font-weight-bold" for="">Photo reblogs only</label>
|
||||
<p class="text-muted small help-text">Only see reblogs of photos or photo albums. (Home timeline only)</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group row mt-5 pt-5">
|
||||
<div class="col-12 text-right">
|
||||
<hr>
|
||||
|
|
Loading…
Reference in a new issue