diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0c30db2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +/vendor +composer.lock +composer.phar +node_modules +.DS_Store +Thumbs.db +tests/.phpunit.result.cache +/tests/integration/tmp +.vagrant +.idea/* +.vscode diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..3f28a5f --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 7a3e086..3b32584 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,31 @@ -map -=============== +# ubuntu.hu - önkéntesek térképe -ubuntu.hu - Önkéntes segítők térképének integrálása \ No newline at end of file +A [Flarum](http://flarum.org) bővítmény. Regisztrált felhasználók, önkéntes segítői térképe. + +Feautures: + - Önkéntes segírők térképének megjelenítése a weboldalon + - Bejelentkezett felhasználók jelölhetik magukat + - Admin felületen kikapcsolható + - Admin felületen minden módosítható + +Képernyőkép: + +frontend screenshot +backend screenshot + + +### Installation + +Install with composer: + +```sh +composer require ubuntuhu/map +``` + +### Updating + +```sh +composer update ubuntuhu/map +php flarum cache:clear +``` + diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..8bac47c --- /dev/null +++ b/composer.json @@ -0,0 +1,43 @@ +{ + "name": "ubuntuhu/map", + "description": "ubuntu.hu - önkéntesek térképe", + "keywords": [ + "flarum", + "ubuntu.hu" + ], + "type": "flarum-extension", + "license": "MIT", + "require": { + "flarum/core": "^1.1.1" + }, + "require-dev": { + "flarum/testing": "^1.1.1" + }, + "authors": [ + { + "name": "sömike", + "homepage": "https://ubuntu.hu", + "email": "ubunu@hurezi.hu", + "role": "Developer" + } + ], + "autoload": { + "psr-4": { + "Ubuntuhu\\Map\\": "src/" + } + }, + "extra": { + "flarum-extension": { + "title": "Önkéntesek Térképe", + "category": "feauture", + "icon": { + "name": "fas fa-map", + "backgroundColor": "#e95420", + "color": "white" + } + }, + "flagrow": { + "discuss": "" + } + } +} diff --git a/extend.php b/extend.php new file mode 100644 index 0000000..7c32559 --- /dev/null +++ b/extend.php @@ -0,0 +1,32 @@ +js(__DIR__.'/js/dist/forum.js') + ->css(__DIR__.'/resources/less/forum.less') + ->route('/map', 'ubuntuhu/map'), + (new Extend\Frontend('admin')) + ->js(__DIR__.'/js/dist/admin.js') + ->css(__DIR__.'/resources/less/admin.less'), + (new Extend\Routes('forum')) + ->post('/sendmail', 'ubuntuhu.sendmail', ContactController::class), + new Extend\Locales(__DIR__.'/resources/locale'), + (new Extend\ApiSerializer(ForumSerializer::class)) + ->attributes(Listeners\LoadSettingsFromDatabase::class), +]; diff --git a/js/admin.js b/js/admin.js new file mode 100644 index 0000000..3e69ff3 --- /dev/null +++ b/js/admin.js @@ -0,0 +1 @@ +export * from './src/admin'; diff --git a/js/dist/admin.js b/js/dist/admin.js new file mode 100644 index 0000000..8970e23 --- /dev/null +++ b/js/dist/admin.js @@ -0,0 +1,2 @@ +module.exports=function(t){var n={};function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)e.d(r,i,function(n){return t[n]}.bind(null,i));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=14)}({0:function(t,n){t.exports=flarum.core.compat["admin/app"]},14:function(t,n,e){"use strict";e.r(n);var r=e(0),i=e.n(r),o=e(2),a=e(9),u=function(t){function n(){return t.apply(this,arguments)||this}Object(o.a)(n,t);var e=n.prototype;return e.oninit=function(n){t.prototype.oninit.call(this,n),this.setting=this.setting.bind(this)},e.content=function(){return[m("div",{className:"container"},m("div",{className:"MapSettingsPage"},m("div",{className:"Form"},m("div",{className:"Form-group"},m("h2",null,i.a.translator.trans("map.admin.settings.configuration_title"))),m("div",{className:"Form-group"},m("label",null,i.a.translator.trans("map.admin.settings.consentText")),m("textarea",{required:!0,className:"FormControl",bidi:this.setting("ubuntuhu-map.consentText")})),this.buildSettingComponent({type:"password",setting:"ubuntuhu-map.gidSecret",required:!0,label:i.a.translator.trans("map.admin.settings.gidSecret")}),this.buildSettingComponent({type:"text",setting:"ubuntuhu-map.contentTitle",required:!0,label:i.a.translator.trans("map.admin.settings.contentTitle")}),this.buildSettingComponent({type:"text",setting:"ubuntuhu-map.contentTitleIcon",required:!0,label:i.a.translator.trans("map.admin.settings.contentTitleIcon")}),this.buildSettingComponent({type:"text",setting:"ubuntuhu-map.contentMenuTitle",required:!0,label:i.a.translator.trans("map.admin.settings.contentMenuTitle")}),this.buildSettingComponent({type:"text",setting:"ubuntuhu-map.contentMenuTitleIcon",required:!0,label:i.a.translator.trans("map.admin.settings.contentMenuTitleIcon")}),this.buildSettingComponent({type:"text",setting:"ubuntuhu-map.formButtonTitle",required:!0,label:i.a.translator.trans("map.admin.settings.formButtonTitle")}),this.submitButton())))]},n}(e.n(a).a);i.a.initializers.add("ubuntuhu-map",(function(){i.a.extensionData.for("ubuntuhu-map").registerPage(u)}))},2:function(t,n,e){"use strict";function r(t,n){return(r=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function i(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,r(t,n)}e.d(n,"a",(function(){return i}))},9:function(t,n){t.exports=flarum.core.compat["admin/components/ExtensionPage"]}}); +//# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map new file mode 100644 index 0000000..b6bbeea --- /dev/null +++ b/js/dist/admin.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://@ubuntuhu/map/webpack/bootstrap","webpack://@ubuntuhu/map/external \"flarum.core.compat['admin/app']\"","webpack://@ubuntuhu/map/./src/admin/components/MapSettingsPage.js","webpack://@ubuntuhu/map/./src/admin/index.js","webpack://@ubuntuhu/map/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@ubuntuhu/map/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@ubuntuhu/map/external \"flarum.core.compat['admin/components/ExtensionPage']\""],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","MapSettingsModal","oninit","vnode","this","setting","content","className","app","translator","trans","required","bidi","buildSettingComponent","type","label","submitButton","ExtensionPage","initializers","add","extensionData","registerPage","MapSettingsPage","_setPrototypeOf","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","constructor"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC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BACTM,UAAU,EACVI,MAAOP,IAAIC,WAAWC,MAAM,wCAE7BN,KAAKY,oB,UAvDoBC,GC+C9CT,IAAIU,aAAaC,IAAI,gBAAgB,WACjCX,IAAIY,cAAJ,IAAsB,gBAAgBC,aAAaC,O,+BCnDxC,SAASC,EAAgBhD,EAAGqB,GAMzC,OALA2B,EAAkB/C,OAAOgD,gBAAkB,SAAyBjD,EAAGqB,GAErE,OADArB,EAAEkD,UAAY7B,EACPrB,IAGcA,EAAGqB,GCLb,SAAS8B,EAAeC,EAAUC,GAC/CD,EAASjC,UAAYlB,OAAOY,OAAOwC,EAAWlC,WAC9CiC,EAASjC,UAAUmC,YAAcF,EACjC,EAAeA,EAAUC,G,mDCJ3B/D,EAAOD,QAAUkC,OAAOC,KAAKC,OAAO","file":"admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 14);\n","module.exports = flarum.core.compat['admin/app'];","import app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\n\nexport default class MapSettingsModal extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.setting = this.setting.bind(this);\n }\n\n content() {\n return [\n
\n
\n
\n
\n

{app.translator.trans('map.admin.settings.configuration_title')}

\n
\n
\n \n