From 3521aa5c20790da021cd605376ff136b6648a605 Mon Sep 17 00:00:00 2001 From: liufei Date: Fri, 15 Dec 2023 18:23:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/dist/forum.js | 2 +- js/dist/forum.js.map | 2 +- js/src/forum/components/MoneyHistoryPage.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/dist/forum.js b/js/dist/forum.js index f150850..63b90c3 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,2 @@ -(()=>{var t={n:o=>{var e=o&&o.__esModule?()=>o.default:()=>o;return t.d(e,{a:e}),e},d:(o,e)=>{for(var r in e)t.o(e,r)&&!t.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:e[r]})},o:(t,o)=>Object.prototype.hasOwnProperty.call(t,o),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},o={};(()=>{"use strict";t.r(o);const e=flarum.core.compat["forum/app"];var r=t.n(e);const n=flarum.core.compat["common/extend"],s=flarum.core.compat["forum/components/UserPage"];var a=t.n(s);const i=flarum.core.compat["common/components/LinkButton"];var u=t.n(i);function l(t,o){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},l(t,o)}function c(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,l(t,o)}const p=flarum.core.compat.Component;var y=t.n(p);const d=flarum.core.compat.app;var h=t.n(d);const f=flarum.core.compat["components/LoadingIndicator"];var g=t.n(f);const v=flarum.core.compat["components/Button"];var b=t.n(v);const M=flarum.core.compat["components/Link"];var x=t.n(M);const H=flarum.core.compat["helpers/avatar"];var O=t.n(H);const R=flarum.core.compat["helpers/username"];var _=t.n(R),j=function(t){function o(){return t.apply(this,arguments)||this}return c(o,t),o.prototype.view=function(){var t=this.attrs.userMoneyHistory,o=t.changeTime(),e=t.money(),r=t.sourceDesc(),n=t.id(),s=t.user(),a=t.createUser(),i=app.translator.trans("C"===t.type()?"mattoid-money-history.forum.record.money-out":"mattoid-money-history.forum.record.money-in"),u="C"===t.type()?"color:red":"color:green";return m("div",{className:"transferHistoryContainer"},m("div",{style:"padding-top: 5px;"},m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-type"),": "),m("span",{style:u},i)," | ",m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-assign-at"),": "),o),m("div",{style:"padding-top: 5px;"},m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-id"),": "),n," | ",m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-from-user"),": "),m(x(),{href:"#",className:"moneyHistoryUser",style:"color:var(--heading-color)"},O()(a)," ",_()(a))," | ",m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-target-user"),": "),m(x(),{href:"#",className:"moneyHistoryUser",style:"color:var(--heading-color)"},O()(s)," ",_()(s))," | ",m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-amount"),": "),e,m("span",null,"| ",m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-transfer-notes"),": "),r)))},o}(y()),P=function(t){function o(){return t.apply(this,arguments)||this}c(o,t);var e=o.prototype;return e.oninit=function(o){t.prototype.oninit.call(this,o),this.loading=!0,this.moreResults=!1,this.userMoneyHistory=[],this.user=this.attrs.params.user,this.loadResults()},e.view=function(){var t=this;return this.loading&&g().component({size:"large"}),m("div",null,m("div",{style:"padding-bottom:10px; font-size: 24px;font-weight: bold;"},h().translator.trans("mattoid-money-history.forum.title")),m("ul",{style:"margin: 0;padding: 0;list-style-type: none;position: relative;"},this.userMoneyHistory.map((function(t){return m("li",{style:"padding-top:5px",key:t.id,"data-id":t.id},j.component({userMoneyHistory:t}))}))),!this.loading&&0===this.userMoneyHistory.length&&m("div",null,m("div",{style:"font-size:1.4em;color: var(--muted-more-color);text-align: center;height: 300px;line-height: 100px;"},h().translator.trans("mattoid-money-history.forum.list-empty"))),this.hasMoreResults()&&m("div",{style:"text-align:center;padding:20px"},m(b(),{className:"Button Button--primary",disabled:this.loading,loading:this.loading,onclick:function(){return t.loadMore()}},h().translator.trans("mattoid-money-history.forum.money-list-load-more"))))},e.loadMore=function(){this.loading=!0,this.loadResults(this.userMoneyHistory.length)},e.parseResults=function(t){return this.moreResults=!!t.payload.links&&!!t.payload.links.next,[].push.apply(this.userMoneyHistory,t),this.loading=!1,m.redraw(),t},e.hasMoreResults=function(){return this.moreResults},e.loadResults=function(t){void 0===t&&(t=0);var o="/users/"+this.user.id()+"/money/history";return h().store.find(o,{filter:{user:this.user.id()},page:{offset:t}}).catch((function(){})).then(this.parseResults.bind(this))},o}(y()),U=function(t){function o(){return t.apply(this,arguments)||this}c(o,t);var e=o.prototype;return e.oninit=function(o){t.prototype.oninit.call(this,o),this.loadUser(m.route.param("username"))},e.content=function(){return m("div",{className:"MoneyHistoryPage"},P.component({params:{user:this.user}}))},o}(a());const k=flarum.core.compat["common/Model"];var w=t.n(k),N=function(t){function o(){return t.apply(this,arguments)||this}return c(o,t),o}(w());Object.assign(N.prototype,{type:w().attribute("type"),money:w().attribute("money"),sourceDesc:w().attribute("source_desc"),changeTime:w().attribute("change_time"),user:w().hasOne("user"),createUser:w().hasOne("createUser")}),r().initializers.add("flarum-ext-money-history",(function(){r().store.models.userMoneyHistory=N,r().routes.userMoneyHistory={path:"/u/:username/money/history",component:U},(0,n.extend)(a().prototype,"navItems",(function(t){r().session.user&&t.add("userMoneyHistory",u().component({href:r().route("userMoneyHistory",{username:r().session.user.username()}),icon:"fas fa-money-bill"},r().translator.trans("mattoid-money-history.forum.nav")))}))}))})(),module.exports=o})(); +(()=>{var t={n:o=>{var e=o&&o.__esModule?()=>o.default:()=>o;return t.d(e,{a:e}),e},d:(o,e)=>{for(var r in e)t.o(e,r)&&!t.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:e[r]})},o:(t,o)=>Object.prototype.hasOwnProperty.call(t,o),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},o={};(()=>{"use strict";t.r(o);const e=flarum.core.compat["forum/app"];var r=t.n(e);const n=flarum.core.compat["common/extend"],s=flarum.core.compat["forum/components/UserPage"];var a=t.n(s);const i=flarum.core.compat["common/components/LinkButton"];var u=t.n(i);function l(t,o){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},l(t,o)}function c(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,l(t,o)}const p=flarum.core.compat.Component;var y=t.n(p);const d=flarum.core.compat.app;var h=t.n(d);const f=flarum.core.compat["components/LoadingIndicator"];var g=t.n(f);const v=flarum.core.compat["components/Button"];var b=t.n(v);const M=flarum.core.compat["components/Link"];var x=t.n(M);const H=flarum.core.compat["helpers/avatar"];var O=t.n(H);const R=flarum.core.compat["helpers/username"];var _=t.n(R),j=function(t){function o(){return t.apply(this,arguments)||this}return c(o,t),o.prototype.view=function(){var t=this.attrs.userMoneyHistory,o=t.changeTime(),e=t.money(),r=t.sourceDesc(),n=t.id(),s=t.user(),a=t.createUser(),i=app.translator.trans("D"===t.type()?"mattoid-money-history.forum.record.money-out":"mattoid-money-history.forum.record.money-in"),u="D"===t.type()?"color:red":"color:green";return m("div",{className:"transferHistoryContainer"},m("div",{style:"padding-top: 5px;"},m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-type"),": "),m("span",{style:u},i)," | ",m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-assign-at"),": "),o),m("div",{style:"padding-top: 5px;"},m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-id"),": "),n," | ",m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-from-user"),": "),m(x(),{href:"#",className:"moneyHistoryUser",style:"color:var(--heading-color)"},O()(a)," ",_()(a))," | ",m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-target-user"),": "),m(x(),{href:"#",className:"moneyHistoryUser",style:"color:var(--heading-color)"},O()(s)," ",_()(s))," | ",m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-amount"),": "),e,m("span",null," | ",m("b",null,app.translator.trans("mattoid-money-history.forum.record.money-list-transfer-notes"),": "),r)))},o}(y()),P=function(t){function o(){return t.apply(this,arguments)||this}c(o,t);var e=o.prototype;return e.oninit=function(o){t.prototype.oninit.call(this,o),this.loading=!0,this.moreResults=!1,this.userMoneyHistory=[],this.user=this.attrs.params.user,this.loadResults()},e.view=function(){var t=this;return this.loading&&g().component({size:"large"}),m("div",null,m("div",{style:"padding-bottom:10px; font-size: 24px;font-weight: bold;"},h().translator.trans("mattoid-money-history.forum.title")),m("ul",{style:"margin: 0;padding: 0;list-style-type: none;position: relative;"},this.userMoneyHistory.map((function(t){return m("li",{style:"padding-top:5px",key:t.id,"data-id":t.id},j.component({userMoneyHistory:t}))}))),!this.loading&&0===this.userMoneyHistory.length&&m("div",null,m("div",{style:"font-size:1.4em;color: var(--muted-more-color);text-align: center;height: 300px;line-height: 100px;"},h().translator.trans("mattoid-money-history.forum.list-empty"))),this.hasMoreResults()&&m("div",{style:"text-align:center;padding:20px"},m(b(),{className:"Button Button--primary",disabled:this.loading,loading:this.loading,onclick:function(){return t.loadMore()}},h().translator.trans("mattoid-money-history.forum.money-list-load-more"))))},e.loadMore=function(){this.loading=!0,this.loadResults(this.userMoneyHistory.length)},e.parseResults=function(t){return this.moreResults=!!t.payload.links&&!!t.payload.links.next,[].push.apply(this.userMoneyHistory,t),this.loading=!1,m.redraw(),t},e.hasMoreResults=function(){return this.moreResults},e.loadResults=function(t){void 0===t&&(t=0);var o="/users/"+this.user.id()+"/money/history";return h().store.find(o,{filter:{user:this.user.id()},page:{offset:t}}).catch((function(){})).then(this.parseResults.bind(this))},o}(y()),U=function(t){function o(){return t.apply(this,arguments)||this}c(o,t);var e=o.prototype;return e.oninit=function(o){t.prototype.oninit.call(this,o),this.loadUser(m.route.param("username"))},e.content=function(){return m("div",{className:"Post-body"},P.component({params:{user:this.user}}))},o}(a());const k=flarum.core.compat["common/Model"];var w=t.n(k),N=function(t){function o(){return t.apply(this,arguments)||this}return c(o,t),o}(w());Object.assign(N.prototype,{type:w().attribute("type"),money:w().attribute("money"),sourceDesc:w().attribute("source_desc"),changeTime:w().attribute("change_time"),user:w().hasOne("user"),createUser:w().hasOne("createUser")}),r().initializers.add("flarum-ext-money-history",(function(){r().store.models.userMoneyHistory=N,r().routes.userMoneyHistory={path:"/u/:username/money/history",component:U},(0,n.extend)(a().prototype,"navItems",(function(t){r().session.user&&t.add("userMoneyHistory",u().component({href:r().route("userMoneyHistory",{username:r().session.user.username()}),icon:"fas fa-money-bill"},r().translator.trans("mattoid-money-history.forum.nav")))}))}))})(),module.exports=o})(); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map index a213b35..441042f 100644 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,I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IAAAA,UAAqB,CACjDtD,KAAMT,IAAAA,MAAU,mBAAoB,CAClCW,SAAUX,IAAAA,QAAYH,KAAKc,aAE7BqD,KAAM,qBACLhE,IAAAA,WAAeE,MAAM,oCAC1B,GACF,G","sources":["webpack://@mattoid/flarum-ext-money-history/webpack/bootstrap","webpack://@mattoid/flarum-ext-money-history/webpack/runtime/compat get default export","webpack://@mattoid/flarum-ext-money-history/webpack/runtime/define property getters","webpack://@mattoid/flarum-ext-money-history/webpack/runtime/hasOwnProperty shorthand","webpack://@mattoid/flarum-ext-money-history/webpack/runtime/make namespace object","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['forum/app']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['common/extend']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['forum/components/UserPage']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@mattoid/flarum-ext-money-history/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@mattoid/flarum-ext-money-history/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['Component']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['app']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['components/LoadingIndicator']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['components/Button']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['components/Link']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['helpers/avatar']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['helpers/username']\"","webpack://@mattoid/flarum-ext-money-history/./src/forum/components/MoneyHistoryListItem.js","webpack://@mattoid/flarum-ext-money-history/./src/forum/components/MoneyHistoryList.js","webpack://@mattoid/flarum-ext-money-history/./src/forum/components/MoneyHistoryPage.js","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['common/Model']\"","webpack://@mattoid/flarum-ext-money-history/./src/forum/models/UserMoneyHistory.js","webpack://@mattoid/flarum-ext-money-history/./src/forum/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Link'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['helpers/avatar'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['helpers/username'];","import Component from \"flarum/Component\";\nimport Link from \"flarum/components/Link\";\nimport avatar from \"flarum/helpers/avatar\";\nimport username from \"flarum/helpers/username\";\n\nexport default class TransferHistoryListItem extends Component {\n view() {\n const {userMoneyHistory} = this.attrs;\n const changeTime = userMoneyHistory.changeTime();\n const money = userMoneyHistory.money();\n const sourceDesc = userMoneyHistory.sourceDesc();\n const moneyID = userMoneyHistory.id();\n const moneyUser = userMoneyHistory.user();\n const createUser = userMoneyHistory.createUser();\n const moneyType = app.translator.trans(userMoneyHistory.type()==='C'?\"mattoid-money-history.forum.record.money-out\":\"mattoid-money-history.forum.record.money-in\");\n const moneyTypeStyle = userMoneyHistory.type()==='C'?\"color:red\":\"color:green\";\n\n return (\n
\n
\n {app.translator.trans('mattoid-money-history.forum.record.money-list-type')}: \n {moneyType} | \n\n {app.translator.trans('mattoid-money-history.forum.record.money-list-assign-at')}: \n {changeTime}\n
\n\n
\n {app.translator.trans('mattoid-money-history.forum.record.money-list-id')}: \n {moneyID} | \n {app.translator.trans('mattoid-money-history.forum.record.money-list-from-user')}: \n \n {avatar(createUser)} {username(createUser)}\n  | \n\n {app.translator.trans('mattoid-money-history.forum.record.money-list-target-user')}: \n \n {avatar(moneyUser)} {username(moneyUser)}\n  | \n {app.translator.trans('mattoid-money-history.forum.record.money-list-amount')}: \n {money}\n\n | \n {app.translator.trans('mattoid-money-history.forum.record.money-list-transfer-notes')}: \n {sourceDesc}\n \n
\n
\n );\n }\n}\n","import Component from \"flarum/Component\";\nimport app from \"flarum/app\";\nimport LoadingIndicator from \"flarum/components/LoadingIndicator\";\nimport Button from \"flarum/components/Button\";\n\nimport MoneyHistoryListItem from \"./MoneyHistoryListItem\";\n\nexport default class TransferHistoryList extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n this.loading = true;\n this.moreResults = false;\n this.userMoneyHistory = [];\n this.user = this.attrs.params.user;\n this.loadResults();\n }\n\n view() {\n let loading;\n\n if (this.loading) {\n loading = LoadingIndicator.component({ size: \"large\" });\n }\n\n return (\n
\n
\n {app.translator.trans(\"mattoid-money-history.forum.title\")}\n
\n \n\n {!this.loading && this.userMoneyHistory.length===0 && (\n
\n
{app.translator.trans(\"mattoid-money-history.forum.list-empty\")}
\n
\n )}\n\n {this.hasMoreResults() && (\n
\n \n
\n )}\n
\n );\n }\n\n loadMore() {\n this.loading = true;\n this.loadResults(this.userMoneyHistory.length);\n }\n\n parseResults(results) {\n this.moreResults = !!results.payload.links && !!results.payload.links.next;\n [].push.apply(this.userMoneyHistory, results);\n this.loading = false;\n m.redraw();\n\n return results;\n }\n\n hasMoreResults() {\n return this.moreResults;\n }\n\n loadResults(offset = 0) {\n let url = '/users/' + this.user.id() + '/money/history';\n return app.store\n .find(url, {\n filter: {\n user: this.user.id(),\n },\n page: {\n offset,\n },\n })\n .catch(() => {})\n .then(this.parseResults.bind(this));\n }\n}\n","import UserPage from 'flarum/forum/components/UserPage';\nimport MoneyHistoryList from \"./MoneyHistoryList\";\n\nexport default class MoneyHistoryPage extends UserPage {\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loadUser(m.route.param('username'));\n }\n\n content() {\n return (\n
\n {MoneyHistoryList.component({\n params: {\n user: this.user,\n },\n })}\n
\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import Model from 'flarum/common/Model';\n\nexport default class UserMoneyHistory extends Model {}\nObject.assign(UserMoneyHistory.prototype, {\n type : Model.attribute('type'),\n money : Model.attribute('money'),\n sourceDesc : Model.attribute('source_desc'),\n changeTime : Model.attribute('change_time'),\n user : Model.hasOne('user'),\n createUser : Model.hasOne('createUser')\n})\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport MoneyHistoryPage from './components/MoneyHistoryPage';\nimport UserMoneyHistory from \"./models/UserMoneyHistory\";\n\napp.initializers.add('flarum-ext-money-history', () => {\n app.store.models.userMoneyHistory = UserMoneyHistory;\n\n app.routes.userMoneyHistory = {\n path: '/u/:username/money/history',\n component: MoneyHistoryPage,\n };\n\n extend(UserPage.prototype, 'navItems', function (items) {\n if (!app.session.user) {\n return;\n }\n\n\n items.add('userMoneyHistory', LinkButton.component({\n href: app.route('userMoneyHistory', {\n username: app.session.user.username(),\n }),\n icon: 'fas fa-money-bill',\n }, app.translator.trans('mattoid-money-history.forum.nav')));\n });\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","TransferHistoryListItem","_Component","apply","arguments","view","userMoneyHistory","this","attrs","changeTime","money","sourceDesc","moneyID","id","moneyUser","user","createUser","moneyType","app","translator","trans","type","moneyTypeStyle","m","className","style","Link","href","avatar","username","Component","TransferHistoryList","_proto","oninit","vnode","loading","moreResults","params","loadResults","_this","LoadingIndicator","size","map","MoneyHistoryListItem","component","length","hasMoreResults","Button","disabled","onclick","loadMore","parseResults","results","payload","links","next","push","redraw","offset","url","find","filter","page","then","MoneyHistoryPage","_UserPage","loadUser","route","param","content","MoneyHistoryList","UserPage","UserMoneyHistory","_Model","Model","assign","add","models","path","extend","items","LinkButton","icon"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,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AAAA,UAAgB,SACxB/D,WAAa+D,IAAAA,UAAgB,eAC7BjE,WAAaiE,IAAAA,UAAgB,eAC7B3D,KAAO2D,IAAAA,OAAa,QACpB1D,WAAa0D,IAAAA,OAAa,gBCF5BxD,IAAAA,aAAiB0D,IAAI,4BAA4B,WAC/C1D,IAAAA,MAAU2D,OAAOvE,iBAAmBkE,EAEpCtD,IAAAA,OAAWZ,iBAAmB,CAC5BwE,KAAM,6BACNlC,UAAWoB,IAGbe,EAAAA,EAAAA,QAAOR,IAAAA,UAAoB,YAAY,SAAUS,GAC1C9D,IAAAA,QAAYH,MAKjBiE,EAAMJ,IAAI,mBAAoBK,IAAAA,UAAqB,CACjDtD,KAAMT,IAAAA,MAAU,mBAAoB,CAClCW,SAAUX,IAAAA,QAAYH,KAAKc,aAE7BqD,KAAM,qBACLhE,IAAAA,WAAeE,MAAM,oCAC1B,GACF,G","sources":["webpack://@mattoid/flarum-ext-money-history/webpack/bootstrap","webpack://@mattoid/flarum-ext-money-history/webpack/runtime/compat get default export","webpack://@mattoid/flarum-ext-money-history/webpack/runtime/define property getters","webpack://@mattoid/flarum-ext-money-history/webpack/runtime/hasOwnProperty shorthand","webpack://@mattoid/flarum-ext-money-history/webpack/runtime/make namespace object","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['forum/app']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['common/extend']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['forum/components/UserPage']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@mattoid/flarum-ext-money-history/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@mattoid/flarum-ext-money-history/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['Component']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['app']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['components/LoadingIndicator']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['components/Button']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['components/Link']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['helpers/avatar']\"","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['helpers/username']\"","webpack://@mattoid/flarum-ext-money-history/./src/forum/components/MoneyHistoryListItem.js","webpack://@mattoid/flarum-ext-money-history/./src/forum/components/MoneyHistoryList.js","webpack://@mattoid/flarum-ext-money-history/./src/forum/components/MoneyHistoryPage.js","webpack://@mattoid/flarum-ext-money-history/external root \"flarum.core.compat['common/Model']\"","webpack://@mattoid/flarum-ext-money-history/./src/forum/models/UserMoneyHistory.js","webpack://@mattoid/flarum-ext-money-history/./src/forum/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Link'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['helpers/avatar'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['helpers/username'];","import Component from \"flarum/Component\";\nimport Link from \"flarum/components/Link\";\nimport avatar from \"flarum/helpers/avatar\";\nimport username from \"flarum/helpers/username\";\n\nexport default class TransferHistoryListItem extends Component {\n view() {\n const {userMoneyHistory} = this.attrs;\n const changeTime = userMoneyHistory.changeTime();\n const money = userMoneyHistory.money();\n const sourceDesc = userMoneyHistory.sourceDesc();\n const moneyID = userMoneyHistory.id();\n const moneyUser = userMoneyHistory.user();\n const createUser = userMoneyHistory.createUser();\n const moneyType = app.translator.trans(userMoneyHistory.type()==='D'?\"mattoid-money-history.forum.record.money-out\":\"mattoid-money-history.forum.record.money-in\");\n const moneyTypeStyle = userMoneyHistory.type()==='D'?\"color:red\":\"color:green\";\n\n return (\n
\n
\n {app.translator.trans('mattoid-money-history.forum.record.money-list-type')}: \n {moneyType} | \n\n {app.translator.trans('mattoid-money-history.forum.record.money-list-assign-at')}: \n {changeTime}\n
\n\n
\n {app.translator.trans('mattoid-money-history.forum.record.money-list-id')}: \n {moneyID} | \n {app.translator.trans('mattoid-money-history.forum.record.money-list-from-user')}: \n \n {avatar(createUser)} {username(createUser)}\n  | \n\n {app.translator.trans('mattoid-money-history.forum.record.money-list-target-user')}: \n \n {avatar(moneyUser)} {username(moneyUser)}\n  | \n {app.translator.trans('mattoid-money-history.forum.record.money-list-amount')}: \n {money}\n\n  | \n {app.translator.trans('mattoid-money-history.forum.record.money-list-transfer-notes')}: \n {sourceDesc}\n \n
\n
\n );\n }\n}\n","import Component from \"flarum/Component\";\nimport app from \"flarum/app\";\nimport LoadingIndicator from \"flarum/components/LoadingIndicator\";\nimport Button from \"flarum/components/Button\";\n\nimport MoneyHistoryListItem from \"./MoneyHistoryListItem\";\n\nexport default class TransferHistoryList extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n this.loading = true;\n this.moreResults = false;\n this.userMoneyHistory = [];\n this.user = this.attrs.params.user;\n this.loadResults();\n }\n\n view() {\n let loading;\n\n if (this.loading) {\n loading = LoadingIndicator.component({ size: \"large\" });\n }\n\n return (\n
\n
\n {app.translator.trans(\"mattoid-money-history.forum.title\")}\n
\n \n\n {!this.loading && this.userMoneyHistory.length===0 && (\n
\n
{app.translator.trans(\"mattoid-money-history.forum.list-empty\")}
\n
\n )}\n\n {this.hasMoreResults() && (\n
\n \n
\n )}\n
\n );\n }\n\n loadMore() {\n this.loading = true;\n this.loadResults(this.userMoneyHistory.length);\n }\n\n parseResults(results) {\n this.moreResults = !!results.payload.links && !!results.payload.links.next;\n [].push.apply(this.userMoneyHistory, results);\n this.loading = false;\n m.redraw();\n\n return results;\n }\n\n hasMoreResults() {\n return this.moreResults;\n }\n\n loadResults(offset = 0) {\n let url = '/users/' + this.user.id() + '/money/history';\n return app.store\n .find(url, {\n filter: {\n user: this.user.id(),\n },\n page: {\n offset,\n },\n })\n .catch(() => {})\n .then(this.parseResults.bind(this));\n }\n}\n","import UserPage from 'flarum/forum/components/UserPage';\nimport MoneyHistoryList from \"./MoneyHistoryList\";\n\nexport default class MoneyHistoryPage extends UserPage {\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loadUser(m.route.param('username'));\n }\n\n content() {\n return (\n
\n {MoneyHistoryList.component({\n params: {\n user: this.user,\n },\n })}\n
\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import Model from 'flarum/common/Model';\n\nexport default class UserMoneyHistory extends Model {}\nObject.assign(UserMoneyHistory.prototype, {\n type : Model.attribute('type'),\n money : Model.attribute('money'),\n sourceDesc : Model.attribute('source_desc'),\n changeTime : Model.attribute('change_time'),\n user : Model.hasOne('user'),\n createUser : Model.hasOne('createUser')\n})\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport MoneyHistoryPage from './components/MoneyHistoryPage';\nimport UserMoneyHistory from \"./models/UserMoneyHistory\";\n\napp.initializers.add('flarum-ext-money-history', () => {\n app.store.models.userMoneyHistory = UserMoneyHistory;\n\n app.routes.userMoneyHistory = {\n path: '/u/:username/money/history',\n component: MoneyHistoryPage,\n };\n\n extend(UserPage.prototype, 'navItems', function (items) {\n if (!app.session.user) {\n return;\n }\n\n\n items.add('userMoneyHistory', LinkButton.component({\n href: app.route('userMoneyHistory', {\n username: app.session.user.username(),\n }),\n icon: 'fas fa-money-bill',\n }, app.translator.trans('mattoid-money-history.forum.nav')));\n });\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","TransferHistoryListItem","_Component","apply","arguments","view","userMoneyHistory","this","attrs","changeTime","money","sourceDesc","moneyID","id","moneyUser","user","createUser","moneyType","app","translator","trans","type","moneyTypeStyle","m","className","style","Link","href","avatar","username","Component","TransferHistoryList","_proto","oninit","vnode","loading","moreResults","params","loadResults","_this","LoadingIndicator","size","map","MoneyHistoryListItem","component","length","hasMoreResults","Button","disabled","onclick","loadMore","parseResults","results","payload","links","next","push","redraw","offset","url","find","filter","page","then","MoneyHistoryPage","_UserPage","loadUser","route","param","content","MoneyHistoryList","UserPage","UserMoneyHistory","_Model","Model","assign","add","models","path","extend","items","LinkButton","icon"],"sourceRoot":""} \ No newline at end of file diff --git a/js/src/forum/components/MoneyHistoryPage.js b/js/src/forum/components/MoneyHistoryPage.js index 0847d7d..e3750e1 100644 --- a/js/src/forum/components/MoneyHistoryPage.js +++ b/js/src/forum/components/MoneyHistoryPage.js @@ -11,7 +11,7 @@ export default class MoneyHistoryPage extends UserPage { content() { return ( -
+
{MoneyHistoryList.component({ params: { user: this.user,