diff --git a/framework/core/.github/ISSUE_TEMPLATE.md b/framework/core/.github/ISSUE_TEMPLATE.md index 4f940e093..e7a082240 100644 --- a/framework/core/.github/ISSUE_TEMPLATE.md +++ b/framework/core/.github/ISSUE_TEMPLATE.md @@ -2,7 +2,13 @@ --- > Try to complete the below form as far as you are able and are willing to share. Add a screenshot of the issue if you can. -## Bug report +## Explanation + +Explain, in simple terms, but with as much detail as possible, your issue. +Be specific: What happened? What would you expect to happen? What have you tried so far? + +## Technical details + - Version of Flarum: x.y.z - Website URL where the bug is visible: http://example.com - The webserver you are running: apache, nginx or something else @@ -16,9 +22,6 @@ Output of "php flarum info", run this in terminal in your Flarum directory. ``` -## Additional comments -Some additional information you'd like to share, eg what have you tried so far. - ## Log files ``` diff --git a/framework/core/composer.json b/framework/core/composer.json index ffe0a7205..9737688b2 100644 --- a/framework/core/composer.json +++ b/framework/core/composer.json @@ -46,13 +46,14 @@ "nikic/fast-route": "^0.6", "oyejorge/less.php": "~1.5", "psr/http-message": "^1.0", + "symfony/config": "^3.3", "symfony/console": "^3.3", "symfony/http-foundation": "^3.3", "symfony/translation": "^3.3", "symfony/yaml": "^3.3", "s9e/text-formatter": "^0.8.1", "tobscure/json-api": "^0.3.0", - "zendframework/zend-diactoros": "^1.1", + "zendframework/zend-diactoros": "^1.6", "zendframework/zend-stratigility": "^1.3" }, "require-dev": { diff --git a/framework/core/error/403.html b/framework/core/error/403.html deleted file mode 100644 index 1ed30a168..000000000 --- a/framework/core/error/403.html +++ /dev/null @@ -1,13 +0,0 @@ - - -
- -You do not have permissions to access this page.
- - - \ No newline at end of file diff --git a/framework/core/error/404.html b/framework/core/error/404.html deleted file mode 100644 index 262b80985..000000000 --- a/framework/core/error/404.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - -Looks like this page could not be found.
- - - \ No newline at end of file diff --git a/framework/core/error/500.html b/framework/core/error/500.html deleted file mode 100644 index f9af9e116..000000000 --- a/framework/core/error/500.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - -Something went wrong on our server.
- - - diff --git a/framework/core/error/503.html b/framework/core/error/503.html deleted file mode 100644 index 46243a1c5..000000000 --- a/framework/core/error/503.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - -This forum is down for maintenance.
- - - diff --git a/framework/core/js/admin/dist/app.js b/framework/core/js/admin/dist/app.js index 16a08b91b..64c0aa374 100644 --- a/framework/core/js/admin/dist/app.js +++ b/framework/core/js/admin/dist/app.js @@ -17536,11 +17536,13 @@ System.register('flarum/components/AdminNav', ['flarum/Component', 'flarum/compo babelHelpers.createClass(AdminNav, [{ key: 'view', value: function view() { - return m(SelectDropdown, { - className: 'AdminNav App-titleControl', - buttonClassName: 'Button', - children: this.items().toArray() - }); + return m( + SelectDropdown, + { + className: 'AdminNav App-titleControl', + buttonClassName: 'Button' }, + this.items().toArray() + ); } }, { key: 'items', @@ -17832,8 +17834,8 @@ System.register('flarum/components/AppearancePage', ['flarum/components/Page', ' m( 'div', { className: 'AppearancePage-colors-input' }, - m('input', { className: 'FormControl', type: 'color', placeholder: '#aaaaaa', value: this.primaryColor(), onchange: m.withAttr('value', this.primaryColor) }), - m('input', { className: 'FormControl', type: 'color', placeholder: '#aaaaaa', value: this.secondaryColor(), onchange: m.withAttr('value', this.secondaryColor) }) + m('input', { className: 'FormControl', type: 'text', placeholder: '#aaaaaa', value: this.primaryColor(), onchange: m.withAttr('value', this.primaryColor) }), + m('input', { className: 'FormControl', type: 'text', placeholder: '#aaaaaa', value: this.secondaryColor(), onchange: m.withAttr('value', this.secondaryColor) }) ), Switch.component({ state: this.darkMode(), @@ -18356,15 +18358,17 @@ System.register('flarum/components/Checkbox', ['flarum/Component', 'flarum/compo } }; });; -"use strict"; +'use strict'; -System.register("flarum/components/DashboardPage", ["flarum/components/Page"], function (_export, _context) { +System.register('flarum/components/DashboardPage', ['flarum/components/Page', 'flarum/components/StatusWidget'], function (_export, _context) { "use strict"; - var Page, DashboardPage; + var Page, StatusWidget, DashboardPage; return { setters: [function (_flarumComponentsPage) { Page = _flarumComponentsPage.default; + }, function (_flarumComponentsStatusWidget) { + StatusWidget = _flarumComponentsStatusWidget.default; }], execute: function () { DashboardPage = function (_Page) { @@ -18376,70 +18380,74 @@ System.register("flarum/components/DashboardPage", ["flarum/components/Page"], f } babelHelpers.createClass(DashboardPage, [{ - key: "view", + key: 'view', value: function view() { return m( - "div", - { className: "DashboardPage" }, + 'div', + { className: 'DashboardPage' }, m( - "div", - { className: "container" }, - m( - "h2", - null, - app.translator.trans('core.admin.dashboard.welcome_text') - ), - m( - "p", - null, - app.translator.trans('core.admin.dashboard.version_text', { version: m( - "strong", - null, - app.forum.attribute('version') - ) }) - ), - m( - "p", - null, - app.translator.trans('core.admin.dashboard.beta_warning_text', { strong: m("strong", null) }) - ), - m( - "ul", - null, - m( - "li", - null, - app.translator.trans('core.admin.dashboard.contributing_text', { a: m("a", { href: "http://flarum.org/docs/contributing", target: "_blank" }) }) - ), - m( - "li", - null, - app.translator.trans('core.admin.dashboard.troubleshooting_text', { a: m("a", { href: "http://flarum.org/docs/troubleshooting", target: "_blank" }) }) - ), - m( - "li", - null, - app.translator.trans('core.admin.dashboard.support_text', { a: m("a", { href: "http://discuss.flarum.org/t/support", target: "_blank" }) }) - ), - m( - "li", - null, - app.translator.trans('core.admin.dashboard.features_text', { a: m("a", { href: "http://discuss.flarum.org/t/features", target: "_blank" }) }) - ), - m( - "li", - null, - app.translator.trans('core.admin.dashboard.extension_text', { a: m("a", { href: "http://flarum.org/docs/extend", target: "_blank" }) }) - ) - ) + 'div', + { className: 'container' }, + this.availableWidgets() ) ); } + }, { + key: 'availableWidgets', + value: function availableWidgets() { + return [m(StatusWidget, null)]; + } }]); return DashboardPage; }(Page); - _export("default", DashboardPage); + _export('default', DashboardPage); + } + }; +});; +'use strict'; + +System.register('flarum/components/DashboardWidget', ['flarum/Component'], function (_export, _context) { + "use strict"; + + var Component, Widget; + return { + setters: [function (_flarumComponent) { + Component = _flarumComponent.default; + }], + execute: function () { + Widget = function (_Component) { + babelHelpers.inherits(Widget, _Component); + + function Widget() { + babelHelpers.classCallCheck(this, Widget); + return babelHelpers.possibleConstructorReturn(this, (Widget.__proto__ || Object.getPrototypeOf(Widget)).apply(this, arguments)); + } + + babelHelpers.createClass(Widget, [{ + key: 'view', + value: function view() { + return m( + 'div', + { className: "Widget " + this.className() }, + this.content() + ); + } + }, { + key: 'className', + value: function className() { + return ''; + } + }, { + key: 'content', + value: function content() { + return []; + } + }]); + return Widget; + }(Component); + + _export('default', Widget); } }; });; @@ -18509,6 +18517,10 @@ System.register('flarum/components/Dropdown', ['flarum/Component', 'flarum/helpe $menu.toggleClass('Dropdown-menu--top', $menu.offset().top + $menu.height() > $(window).scrollTop() + $(window).height()); + if ($menu.offset().top < 0) { + $menu.removeClass('Dropdown-menu--top'); + } + $menu.toggleClass('Dropdown-menu--right', isRight || $menu.offset().left + $menu.width() > $(window).scrollLeft() + $(window).width()); }); @@ -21102,6 +21114,84 @@ System.register('flarum/components/SplitDropdown', ['flarum/components/Dropdown' });; 'use strict'; +System.register('flarum/components/StatusWidget', ['flarum/components/DashboardWidget', 'flarum/helpers/icon', 'flarum/helpers/listItems', 'flarum/utils/ItemList'], function (_export, _context) { + "use strict"; + + var DashboardWidget, icon, listItems, ItemList, StatusWidget; + return { + setters: [function (_flarumComponentsDashboardWidget) { + DashboardWidget = _flarumComponentsDashboardWidget.default; + }, function (_flarumHelpersIcon) { + icon = _flarumHelpersIcon.default; + }, function (_flarumHelpersListItems) { + listItems = _flarumHelpersListItems.default; + }, function (_flarumUtilsItemList) { + ItemList = _flarumUtilsItemList.default; + }], + execute: function () { + StatusWidget = function (_DashboardWidget) { + babelHelpers.inherits(StatusWidget, _DashboardWidget); + + function StatusWidget() { + babelHelpers.classCallCheck(this, StatusWidget); + return babelHelpers.possibleConstructorReturn(this, (StatusWidget.__proto__ || Object.getPrototypeOf(StatusWidget)).apply(this, arguments)); + } + + babelHelpers.createClass(StatusWidget, [{ + key: 'className', + value: function className() { + return 'StatusWidget'; + } + }, { + key: 'content', + value: function content() { + return m( + 'ul', + null, + listItems(this.items().toArray()) + ); + } + }, { + key: 'items', + value: function items() { + var items = new ItemList(); + + items.add('help', m( + 'a', + { href: 'http://flarum.org/docs/troubleshooting', target: '_blank' }, + icon('question-circle'), + ' ', + app.translator.trans('core.admin.dashboard.help_link') + )); + + items.add('version-flarum', [m( + 'strong', + null, + 'Flarum' + ), m('br', null), app.forum.attribute('version')]); + items.add('version-php', [m( + 'strong', + null, + 'PHP' + ), m('br', null), app.data.phpVersion]); + items.add('version-mysql', [m( + 'strong', + null, + 'MySQL' + ), m('br', null), app.data.mysqlVersion]); + + return items; + } + }]); + return StatusWidget; + }(DashboardWidget); + + _export('default', StatusWidget); + } + }; +});; +'use strict'; + System.register('flarum/components/Switch', ['flarum/components/Checkbox'], function (_export, _context) { "use strict"; @@ -21255,6 +21345,52 @@ System.register('flarum/components/UploadImageButton', ['flarum/components/Butto } }; });; +'use strict'; + +System.register('flarum/components/Widget', ['flarum/Component'], function (_export, _context) { + "use strict"; + + var Component, DashboardWidget; + return { + setters: [function (_flarumComponent) { + Component = _flarumComponent.default; + }], + execute: function () { + DashboardWidget = function (_Component) { + babelHelpers.inherits(DashboardWidget, _Component); + + function DashboardWidget() { + babelHelpers.classCallCheck(this, DashboardWidget); + return babelHelpers.possibleConstructorReturn(this, (DashboardWidget.__proto__ || Object.getPrototypeOf(DashboardWidget)).apply(this, arguments)); + } + + babelHelpers.createClass(DashboardWidget, [{ + key: 'view', + value: function view() { + return m( + 'div', + { className: "DashboardWidget " + this.className() }, + this.content() + ); + } + }, { + key: 'className', + value: function className() { + return ''; + } + }, { + key: 'content', + value: function content() { + return []; + } + }]); + return DashboardWidget; + }(Component); + + _export('default', DashboardWidget); + } + }; +});; "use strict"; System.register("flarum/extend", [], function (_export, _context) { @@ -21364,7 +21500,7 @@ System.register('flarum/helpers/avatar', [], function (_export, _context) { // uploaded image, or the first letter of their username if they haven't // uploaded one. if (user) { - var username = user.username() || '?'; + var username = user.displayName() || '?'; var avatarUrl = user.avatarUrl(); if (hasTitle) attrs.title = attrs.title || username; @@ -21614,7 +21750,7 @@ System.register("flarum/helpers/username", [], function (_export, _context) { "use strict"; function username(user) { - var name = user && user.username() || app.translator.trans('core.lib.username.deleted_text'); + var name = user && user.displayName() || app.translator.trans('core.lib.username.deleted_text'); return m( "span", @@ -22445,15 +22581,12 @@ System.register('flarum/models/User', ['flarum/Model', 'flarum/utils/stringToCol babelHelpers.extends(User.prototype, { username: Model.attribute('username'), + displayName: Model.attribute('displayName'), email: Model.attribute('email'), isActivated: Model.attribute('isActivated'), password: Model.attribute('password'), avatarUrl: Model.attribute('avatarUrl'), - bio: Model.attribute('bio'), - bioHtml: computed('bio', function (bio) { - return bio ? '' + $('
').text(bio).html().replace(/\n/g, '{app.translator.trans('core.admin.dashboard.version_text', {version: {app.forum.attribute('version')}})}
-{app.translator.trans('core.admin.dashboard.beta_warning_text', {strong: })}
-' + $('
').text(bio).html().replace(/\n/g, '