diff --git a/dist/js/tool.js b/dist/js/tool.js index ccfba23..9c1f23c 100644 --- a/dist/js/tool.js +++ b/dist/js/tool.js @@ -1,732 +1 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 1); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports) { - -/* globals __VUE_SSR_CONTEXT__ */ - -// IMPORTANT: Do NOT use ES2015 features in this file. -// This module is a runtime utility for cleaner component module output and will -// be included in the final webpack user bundle. - -module.exports = function normalizeComponent ( - rawScriptExports, - compiledTemplate, - functionalTemplate, - injectStyles, - scopeId, - moduleIdentifier /* server only */ -) { - var esModule - var scriptExports = rawScriptExports = rawScriptExports || {} - - // ES6 modules interop - var type = typeof rawScriptExports.default - if (type === 'object' || type === 'function') { - esModule = rawScriptExports - scriptExports = rawScriptExports.default - } - - // Vue.extend constructor export interop - var options = typeof scriptExports === 'function' - ? scriptExports.options - : scriptExports - - // render functions - if (compiledTemplate) { - options.render = compiledTemplate.render - options.staticRenderFns = compiledTemplate.staticRenderFns - options._compiled = true - } - - // functional template - if (functionalTemplate) { - options.functional = true - } - - // scopedId - if (scopeId) { - options._scopeId = scopeId - } - - var hook - if (moduleIdentifier) { // server build - hook = function (context) { - // 2.3 injection - context = - context || // cached call - (this.$vnode && this.$vnode.ssrContext) || // stateful - (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional - // 2.2 with runInNewContext: true - if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { - context = __VUE_SSR_CONTEXT__ - } - // inject component styles - if (injectStyles) { - injectStyles.call(this, context) - } - // register component module identifier for async chunk inferrence - if (context && context._registeredComponents) { - context._registeredComponents.add(moduleIdentifier) - } - } - // used by ssr in case component is cached and beforeCreate - // never gets called - options._ssrRegister = hook - } else if (injectStyles) { - hook = injectStyles - } - - if (hook) { - var functional = options.functional - var existing = functional - ? options.render - : options.beforeCreate - - if (!functional) { - // inject component registration as beforeCreate hook - options.beforeCreate = existing - ? [].concat(existing, hook) - : [hook] - } else { - // for template-only hot-reload because in that case the render fn doesn't - // go through the normalizer - options._injectStyles = hook - // register for functioal component in vue file - options.render = function renderWithStyleInjection (h, context) { - hook.call(context) - return existing(h, context) - } - } - } - - return { - esModule: esModule, - exports: scriptExports, - options: options - } -} - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(2); -module.exports = __webpack_require__(9); - - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - -Nova.booting(function (Vue) { - Vue.component('commenter', __webpack_require__(3)); -}); - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -var disposed = false -var normalizeComponent = __webpack_require__(0) -/* script */ -var __vue_script__ = __webpack_require__(4) -/* template */ -var __vue_template__ = __webpack_require__(8) -/* template functional */ -var __vue_template_functional__ = false -/* styles */ -var __vue_styles__ = null -/* scopeId */ -var __vue_scopeId__ = null -/* moduleIdentifier (server only) */ -var __vue_module_identifier__ = null -var Component = normalizeComponent( - __vue_script__, - __vue_template__, - __vue_template_functional__, - __vue_styles__, - __vue_scopeId__, - __vue_module_identifier__ -) -Component.options.__file = "resources/js/components/Tool.vue" - -/* hot reload */ -if (false) {(function () { - var hotAPI = require("vue-hot-reload-api") - hotAPI.install(require("vue"), false) - if (!hotAPI.compatible) return - module.hot.accept() - if (!module.hot.data) { - hotAPI.createRecord("data-v-68ff5483", Component.options) - } else { - hotAPI.reload("data-v-68ff5483", Component.options) - } - module.hot.dispose(function (data) { - disposed = true - }) -})()} - -module.exports = Component.exports - - -/***/ }), -/* 4 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Comment__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Comment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__Comment__); -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// - - - -/* harmony default export */ __webpack_exports__["default"] = ({ - props: ['resourceName', 'resourceId', 'field'], - - components: { Comment: __WEBPACK_IMPORTED_MODULE_0__Comment___default.a }, - - data: function data() { - return { - baseCommentUri: '/nova-api/comments', - comment: '', - data: { - next_page_url: '', - prev_page_url: '', - resources: {} - } - }; - }, - mounted: function mounted() { - this.getComments(this.commentsUri); - }, - - - computed: { - commentsUri: function commentsUri() { - return this.baseCommentUri + '?page=1'; - }, - hasComments: function hasComments() { - return Boolean(this.data.resources.length); - }, - hasNextLink: function hasNextLink() { - return Boolean(this.data.next_page_url); - }, - hasPrevLink: function hasPrevLink() { - return Boolean(this.data.prev_page_url); - }, - hasPagination: function hasPagination() { - return this.hasNextLink || this.hasPrevLink; - }, - queryParams: function queryParams() { - return '&orderBy=created_at&orderByDirection=desc&viaResource=' + this.resourceName + '&viaResourceId=' + this.resourceId + '&viaRelationship=comments&relationshipType=hasMany'; - } - }, - - methods: { - createComment: function createComment() { - var _this = this; - - if (!this.comment) { - return false; - } - - var payload = { - comment: this.comment, - viaResource: this.resourceName, - viaResourceId: this.resourceId, - viaRelationship: 'comments' - }; - - axios.post(this.baseCommentUri, payload).then(function () { - _this.getComments(_this.commentsUri); - - _this.resetComment(); - - _this.$toasted.show('A new comment has been created.', { type: 'success' }); - }).catch(function (response) { - return _this.$toasted.show(response, { type: 'error' }); - }); - }, - getComments: function getComments(uri) { - var _this2 = this; - - axios.get('' + uri + this.queryParams).then(function (_ref) { - var data = _ref.data; - return _this2.data = data; - }); - }, - paginationClass: function paginationClass(isActive) { - return isActive ? 'text-primary dim' : 'text-80 opacity-50'; - }, - resetComment: function resetComment() { - this.comment = ''; - } - } -}); - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -var disposed = false -var normalizeComponent = __webpack_require__(0) -/* script */ -var __vue_script__ = __webpack_require__(6) -/* template */ -var __vue_template__ = __webpack_require__(7) -/* template functional */ -var __vue_template_functional__ = false -/* styles */ -var __vue_styles__ = null -/* scopeId */ -var __vue_scopeId__ = null -/* moduleIdentifier (server only) */ -var __vue_module_identifier__ = null -var Component = normalizeComponent( - __vue_script__, - __vue_template__, - __vue_template_functional__, - __vue_styles__, - __vue_scopeId__, - __vue_module_identifier__ -) -Component.options.__file = "resources/js/components/Comment.vue" - -/* hot reload */ -if (false) {(function () { - var hotAPI = require("vue-hot-reload-api") - hotAPI.install(require("vue"), false) - if (!hotAPI.compatible) return - module.hot.accept() - if (!module.hot.data) { - hotAPI.createRecord("data-v-54ded044", Component.options) - } else { - hotAPI.reload("data-v-54ded044", Component.options) - } - module.hot.dispose(function (data) { - disposed = true - }) -})()} - -module.exports = Component.exports - - -/***/ }), -/* 6 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// - -// require('moment-timezone'); - -/* harmony default export */ __webpack_exports__["default"] = ({ - props: { - comment: { - type: Object, - required: true - } - }, - - computed: { - commentString: function commentString() { - return _.find(this.comment.fields, { attribute: 'comment' }).value; - }, - commenter: function commenter() { - return _.find(this.comment.fields, { attribute: 'commenter' }).value; - }, - commenterUrl: function commenterUrl() { - var commenterId = _.find(this.comment.fields, { attribute: 'commenter' }).belongsToId; - - return '/nova/resources/users/' + commenterId; - }, - date: function date() { - var now = moment(); - var date = moment.utc(_.find(this.comment.fields, { attribute: 'created_at' }).value).tz(moment.tz.guess()); - - if (date.isSame(now, 'minute')) { - return 'just now'; - } - - if (date.isSame(now, 'day')) { - return 'at ' + date.format('LT'); - } - - if (date.isSame(now, 'year')) { - return 'on ' + date.format('MMM D'); - } - - return 'on ' + date.format('ll'); - }, - hasCommenter: function hasCommenter() { - return Boolean(this.commenter); - } - } -}); - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -var render = function() { - var _vm = this - var _h = _vm.$createElement - var _c = _vm._self._c || _h - return _c( - "div", - { staticClass: "commenter__comment py-4 border-t border-40" }, - [ - _c( - "div", - { staticClass: "font-light text-80 text-sm" }, - [ - _vm.hasCommenter - ? [ - _c("a", { - staticClass: "no-underline dim text-primary font-bold", - attrs: { href: _vm.commenterUrl }, - domProps: { textContent: _vm._s(_vm.commenter) } - }), - _vm._v("\n\n said\n ") - ] - : [_vm._v("\n Written\n ")], - _vm._v("\n\n " + _vm._s(_vm.date) + "\n ") - ], - 2 - ), - _vm._v(" "), - _c("div", { - staticClass: "mt-2", - domProps: { innerHTML: _vm._s(_vm.commentString) } - }) - ] - ) -} -var staticRenderFns = [] -render._withStripped = true -module.exports = { render: render, staticRenderFns: staticRenderFns } -if (false) { - module.hot.accept() - if (module.hot.data) { - require("vue-hot-reload-api") .rerender("data-v-54ded044", module.exports) - } -} - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -var render = function() { - var _vm = this - var _h = _vm.$createElement - var _c = _vm._self._c || _h - return _c("div", [ - _c("h4", { staticClass: "text-90 font-normal text-2xl mb-3" }, [ - _vm._v("\n Comments\n ") - ]), - _vm._v(" "), - _c("div", { staticClass: "card mb-6 overflow-hidden" }, [ - _c( - "div", - { staticClass: "flex border-b border-40 remove-bottom-border px-8" }, - [ - _c("div", { staticClass: "w-full pt-6 pb-2" }, [ - _c("h4", { staticClass: "font-normal text-80" }, [ - _vm._v( - "\n Write new comment\n " - ) - ]), - _vm._v(" "), - _c("textarea", { - directives: [ - { - name: "model", - rawName: "v-model", - value: _vm.comment, - expression: "comment" - } - ], - staticClass: - "w-full form-control form-input form-input-bordered py-3 h-auto mt-2", - attrs: { id: "commenter", dusk: "commenter", rows: "5" }, - domProps: { value: _vm.comment }, - on: { - keyup: function($event) { - if ( - !$event.type.indexOf("key") && - $event.keyCode !== 93 && - _vm._k($event.keyCode, "enter", 13, $event.key, "Enter") - ) { - return null - } - return _vm.createComment($event) - }, - input: function($event) { - if ($event.target.composing) { - return - } - _vm.comment = $event.target.value - } - } - }) - ]) - ] - ), - _vm._v(" "), - _c( - "div", - { staticClass: "flex justify-between px-8 pb-4 border-b border-40" }, - [ - _c("div", { staticClass: "help-text" }, [ - _vm._v( - "\n On MacOS, press ⌘ + Enter to save\n " - ) - ]), - _vm._v(" "), - _c( - "button", - { - staticClass: - "btn btn-default btn-primary inline-flex items-center relative mt-4", - attrs: { type: "submit" }, - on: { click: _vm.createComment } - }, - [_vm._v("\n Save Comment\n ")] - ) - ] - ), - _vm._v(" "), - _vm.hasComments - ? _c( - "div", - { - staticClass: "flex border-b border-40 remove-bottom-border px-8" - }, - [ - _c( - "div", - { staticClass: "w-full py-6" }, - [ - _c("h3", { staticClass: "text-90 font-bold text-lg mb-4" }, [ - _vm._v("Comments") - ]), - _vm._v(" "), - _vm._l(_vm.data.resources, function(comment, key) { - return _c("comment", { - key: key, - attrs: { comment: comment } - }) - }) - ], - 2 - ) - ] - ) - : _vm._e(), - _vm._v(" "), - _vm.hasPagination - ? _c("div", { staticClass: "bg-20 rounded-b" }, [ - _c("nav", { staticClass: "flex justify-between items-center" }, [ - _c( - "button", - { - staticClass: "btn btn-link py-3 px-4", - class: _vm.paginationClass(_vm.hasNextLink), - attrs: { disabled: !_vm.hasNextLink }, - on: { - click: function($event) { - return _vm.getComments(_vm.data.next_page_url) - } - } - }, - [_vm._v("\n Older\n ")] - ), - _vm._v(" "), - _c( - "button", - { - staticClass: "btn btn-link py-3 px-4", - class: _vm.paginationClass(_vm.hasPrevLink), - attrs: { disabled: !_vm.hasPrevLink }, - on: { - click: function($event) { - return _vm.getComments(_vm.data.prev_page_url) - } - } - }, - [_vm._v("\n Newer\n ")] - ) - ]) - ]) - : _vm._e() - ]) - ]) -} -var staticRenderFns = [] -render._withStripped = true -module.exports = { render: render, staticRenderFns: staticRenderFns } -if (false) { - module.hot.accept() - if (module.hot.data) { - require("vue-hot-reload-api") .rerender("data-v-68ff5483", module.exports) - } -} - -/***/ }), -/* 9 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }) -/******/ ]); +!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e){t.exports=function(t,e,n,r,o,s){var a,i=t=t||{},c=typeof t.default;"object"!==c&&"function"!==c||(a=t,i=t.default);var m,u="function"==typeof i?i.options:i;if(e&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0),n&&(u.functional=!0),o&&(u._scopeId=o),s?(m=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},u._ssrRegister=m):r&&(m=r),m){var l=u.functional,d=l?u.render:u.beforeCreate;l?(u._injectStyles=m,u.render=function(t,e){return m.call(e),d(t,e)}):u.beforeCreate=d?[].concat(d,m):[m]}return{esModule:a,exports:i,options:u}}},function(t,e,n){n(2),t.exports=n(9)},function(t,e,n){Nova.booting(function(t){t.component("commenter",n(3))})},function(t,e,n){var r=n(0)(n(4),n(8),!1,null,null,null);t.exports=r.exports},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(5),o=n.n(r);e.default={props:["resourceName","resourceId","field"],components:{Comment:o.a},data:function(){return{baseCommentUri:"/nova-api/comments",comment:"",data:{next_page_url:"",prev_page_url:"",resources:{}}}},mounted:function(){this.getComments(this.commentsUri)},computed:{commentsUri:function(){return this.baseCommentUri+"?page=1"},hasComments:function(){return Boolean(this.data.resources.length)},hasNextLink:function(){return Boolean(this.data.next_page_url)},hasPrevLink:function(){return Boolean(this.data.prev_page_url)},hasPagination:function(){return this.hasNextLink||this.hasPrevLink},queryParams:function(){return"&orderBy=created_at&orderByDirection=desc&viaResource="+this.resourceName+"&viaResourceId="+this.resourceId+"&viaRelationship=comments&relationshipType=hasMany"}},methods:{createComment:function(){var t=this;if(!this.comment)return!1;var e={comment:this.comment,viaResource:this.resourceName,viaResourceId:this.resourceId,viaRelationship:"comments"};axios.post(this.baseCommentUri,e).then(function(){t.getComments(t.commentsUri),t.resetComment(),t.$toasted.show(Nova.app.__("A new comment has been created."),{type:"success"})}).catch(function(e){return t.$toasted.show(e,{type:"error"})})},getComments:function(t){var e=this;axios.get(""+t+this.queryParams).then(function(t){var n=t.data;return e.data=n})},paginationClass:function(t){return t?"text-primary dim":"text-80 opacity-50"},resetComment:function(){this.comment=""}}}},function(t,e,n){var r=n(0)(n(6),n(7),!1,null,null,null);t.exports=r.exports},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={props:{comment:{type:Object,required:!0}},computed:{commentString:function(){return _.find(this.comment.fields,{attribute:"comment"}).value},commenter:function(){return _.find(this.comment.fields,{attribute:"commenter"}).value},commenterUrl:function(){return"/nova/resources/users/"+_.find(this.comment.fields,{attribute:"commenter"}).belongsToId},date:function(){var t=Nova.app.__("Moment Locale");moment.locale(t);var e=moment(),n=moment.utc(_.find(this.comment.fields,{attribute:"created_at"}).value).tz(moment.tz.guess());return n.isSame(e,"minute")?Nova.app.__("just now"):n.isSame(e,"day")?Nova.app.__("at")+" "+n.format("LT"):n.isSame(e,"year")?Nova.app.__("on")+" "+("de"===t?n.format("D MMM"):n.format("MMM D")):Nova.app.__("on")+" "+n.format("ll")},hasCommenter:function(){return Boolean(this.commenter)}}}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"commenter__comment py-4 border-t border-40"},[n("div",{staticClass:"font-light text-80 text-sm"},[t.hasCommenter?[n("a",{staticClass:"no-underline dim text-primary font-bold",attrs:{href:t.commenterUrl},domProps:{textContent:t._s(t.commenter)}}),t._v("\n\n "+t._s(t.__("said"))+"\n ")]:[t._v("\n "+t._s(t.__("Written"))+"\n ")],t._v("\n\n "+t._s(t.date)+"\n ")],2),t._v(" "),n("div",{staticClass:"mt-2",domProps:{innerHTML:t._s(t.commentString)}})])},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("h4",{staticClass:"text-90 font-normal text-2xl mb-3"},[t._v("\n "+t._s(t.__("Comments"))+"\n ")]),t._v(" "),n("div",{staticClass:"card mb-6 overflow-hidden"},[n("div",{staticClass:"flex border-b border-40 remove-bottom-border px-8"},[n("div",{staticClass:"w-full pt-6 pb-2"},[n("h4",{staticClass:"font-normal text-80"},[t._v("\n "+t._s(t.__("Write new comment"))+"\n ")]),t._v(" "),n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.comment,expression:"comment"}],staticClass:"w-full form-control form-input form-input-bordered py-3 h-auto mt-2",attrs:{id:"commenter",dusk:"commenter",rows:"5"},domProps:{value:t.comment},on:{keyup:function(e){return!e.type.indexOf("key")&&93!==e.keyCode&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.createComment(e)},input:function(e){e.target.composing||(t.comment=e.target.value)}}})])]),t._v(" "),n("div",{staticClass:"flex justify-between px-8 pb-4 border-b border-40"},[n("div",{staticClass:"help-text"},[t._v("\n "+t._s(t.__("On MacOS, press ⌘ + Enter to save"))+"\n ")]),t._v(" "),n("button",{staticClass:"btn btn-default btn-primary inline-flex items-center relative mt-4",attrs:{type:"submit"},on:{click:t.createComment}},[t._v("\n "+t._s(t.__("Save Comment"))+"\n ")])]),t._v(" "),t.hasComments?n("div",{staticClass:"flex border-b border-40 remove-bottom-border px-8"},[n("div",{staticClass:"w-full py-6"},[n("h3",{staticClass:"text-90 font-bold text-lg mb-4"},[t._v(t._s(t.__("Comments")))]),t._v(" "),t._l(t.data.resources,function(t,e){return n("comment",{key:e,attrs:{comment:t}})})],2)]):t._e(),t._v(" "),t.hasPagination?n("div",{staticClass:"bg-20 rounded-b"},[n("nav",{staticClass:"flex justify-between items-center"},[n("button",{staticClass:"btn btn-link py-3 px-4",class:t.paginationClass(t.hasNextLink),attrs:{disabled:!t.hasNextLink},on:{click:function(e){return t.getComments(t.data.next_page_url)}}},[t._v("\n "+t._s(t.__("Older"))+"\n ")]),t._v(" "),n("button",{staticClass:"btn btn-link py-3 px-4",class:t.paginationClass(t.hasPrevLink),attrs:{disabled:!t.hasPrevLink},on:{click:function(e){return t.getComments(t.data.prev_page_url)}}},[t._v("\n "+t._s(t.__("Newer"))+"\n ")])])]):t._e()])])},staticRenderFns:[]}},function(t,e){}]); \ No newline at end of file diff --git a/resources/js/components/Comment.vue b/resources/js/components/Comment.vue index a07b961..8f850cd 100644 --- a/resources/js/components/Comment.vue +++ b/resources/js/components/Comment.vue @@ -4,11 +4,11 @@ {{ date }} @@ -45,23 +45,25 @@ }, date() { + const language = Nova.app.__('Moment Locale'); + moment.locale(language) let now = moment(); let date = moment.utc(_.find(this.comment.fields, { attribute: 'created_at' }).value) .tz(moment.tz.guess()); if (date.isSame(now, 'minute')) { - return 'just now'; + return Nova.app.__('just now'); } if (date.isSame(now, 'day')) { - return `at ${date.format('LT')}`; + return Nova.app.__('at') + ' ' + date.format('LT'); } if (date.isSame(now, 'year')) { - return `on ${date.format('MMM D')}`; + return Nova.app.__('on') + ' ' + (language === 'de' ? date.format('D MMM') : date.format('MMM D')); } - return `on ${date.format('ll')}`; + return Nova.app.__('on') + ' ' + date.format('ll'); }, hasCommenter() { diff --git a/resources/js/components/Tool.vue b/resources/js/components/Tool.vue index ad330bf..c169ebe 100644 --- a/resources/js/components/Tool.vue +++ b/resources/js/components/Tool.vue @@ -1,14 +1,14 @@