Browse Source

Replaced extension name

main
Youen 6 months ago
parent
commit
62b05d621d
  1. 2
      .project
  2. 2
      README.md
  3. 13
      extend.php
  4. 14
      js/dist/admin.js
  5. 2
      js/dist/admin.js.map
  6. 40
      js/dist/forum.js
  7. 2
      js/dist/forum.js.map
  8. 4
      js/package-lock.json
  9. 2
      js/package.json
  10. 14
      js/src/admin/index.js
  11. 20
      js/src/forum/components/AddLocationComponent.js
  12. 10
      js/src/forum/components/GlobalMapPage.tsx
  13. 12
      js/src/forum/index.js
  14. 3580
      js/yarn.lock
  15. 2
      locale/en.yml
  16. 2
      locale/fr.yml
  17. 4
      src/Api/Controller/ListUserLocationsController.php
  18. 2
      src/Api/Serializer/UserLocationSerializer.php
  19. 2
      src/Listeners/AddLocationAttribute.php
  20. 2
      src/Listeners/SaveLocationToDatabase.php

2
.project

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>flarum-users-map-location</name>
<name>flarum-users-map</name>
<comment></comment>
<projects>
</projects>

2
README.md

@ -2,7 +2,7 @@
A [Flarum](http://flarum.org) extension. Adds an optional Location Attribute and a map to users settings, as well as a global map that displays all users that have opted in.
This fork is based on [the plugin from justoverclockl](https://github.com/justoverclockl/users-map-location), with some improvements, and notably a global map where it is possible to see the location of all forum users that have filled this information.
This fork is based on [the plugin from justoverclock](https://github.com/justoverclockl/users-map-location), with some improvements, and notably a global map where it is possible to see the location of all forum users that have filled this information.
No precise location is disclosed, only city or municipality, and only for users who want to indicate this information.

13
extend.php

@ -1,19 +1,20 @@
<?php
/*
* This file is part of justoverclock/users-map-location.
* This file is part of youen/users-map.
*
* Copyright (c) 2022 Marco Colia.
* Copyright (c) 2024 Youen Toupin.
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace Justoverclock\UsersMapLocation;
namespace Youen\UsersMap;
use Justoverclock\UsersMapLocation\Listeners\SaveLocationToDatabase;
use Justoverclock\UsersMapLocation\Listeners\AddLocationAttribute;
use Youen\UsersMap\Listeners\SaveLocationToDatabase;
use Youen\UsersMap\Listeners\AddLocationAttribute;
use Flarum\Api\Serializer\UserSerializer;
use Flarum\Extend;
use Flarum\User\Event\Saving;
@ -50,10 +51,10 @@ return [
(new Extend\ApiSerializer(UserSerializer::class))
->attributes(AddLocationAttribute::class),
(new Extend\Settings)->serializeToForum('justoverclock-users-map-location.mapBox-api-key', 'justoverclock-users-map-location.mapBox-api-key'),
(new Extend\Settings)->serializeToForum('youen-users-map.mapbox-api-key', 'youen-users-map.mapbox-api-key'),
(new Extend\Frontend('forum'))
->route('/global-map', 'justoverclock.global-map'),
->route('/global-map', 'youen-users-map.global-map'),
(new Extend\Filter(UserFilterer::class))
->addFilterMutator(UserLocationFilterMutator::class),

14
js/dist/admin.js vendored

@ -19,17 +19,17 @@ __webpack_require__.r(__webpack_exports__);
flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().initializers.add('justoverclock/users-map-location', function () {
flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().extensionData["for"]('justoverclock-users-map-location').registerSetting({
setting: 'justoverclock-users-map-location.mapBox-api-key',
name: 'justoverclock-users-map-location.mapBox-api-key',
flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().initializers.add('youen/users-map', function () {
flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().extensionData["for"]('youen-users-map').registerSetting({
setting: 'youen-users-map.mapbox-api-key',
name: 'youen-users-map.mapbox-api-key',
type: 'text',
label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('justoverclock-users-map-location.admin.mapBox-api-key'),
help: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('justoverclock-users-map-location.admin.mapBox-api-key-help')
label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('youen-users-map.admin.mapbox-api-key'),
help: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('youen-users-map.admin.mapbox-api-key-help')
});
(0,flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__.extend)((flarum_admin_components_UserListPage__WEBPACK_IMPORTED_MODULE_2___default().prototype), 'columns', function (items) {
items.add('location', {
name: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('justoverclock-users-map-location.admin.adminLocationField'),
name: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('youen-users-map.admin.adminLocationField'),
content: function content(user) {
return m("div", null, user.data.attributes.location);
}

2
js/dist/admin.js.map vendored

File diff suppressed because one or more lines are too long

40
js/dist/forum.js vendored

@ -16160,16 +16160,16 @@ var AddLocationComponent = /*#__PURE__*/function (_Component) {
return m("fieldset", {
className: "Settings-theme"
}, m("legend", null, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('justoverclock-users-map-location.forum.location')), m((flarum_common_components_Switch__WEBPACK_IMPORTED_MODULE_3___default()), {
}, m("legend", null, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('youen-users-map.forum.location')), m((flarum_common_components_Switch__WEBPACK_IMPORTED_MODULE_3___default()), {
state: this.enableLocation,
onchange: function onchange(val) {
return _this.setEnableLocation(val);
}
}, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('justoverclock-users-map-location.forum.enableLocation')), m("div", {
}, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('youen-users-map.forum.enableLocation')), m("div", {
className: "fieldset-separator"
}), this.enableLocation ? m("div", null, m("label", {
"for": "search-country"
}, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('justoverclock-users-map-location.forum.locationCountry')), m("input", {
}, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('youen-users-map.forum.locationCountry')), m("input", {
type: "text",
className: "FormControl search-country",
id: "search-country",
@ -16180,9 +16180,9 @@ var AddLocationComponent = /*#__PURE__*/function (_Component) {
className: "fieldset-separator"
}), m("label", {
"for": "search-city"
}, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('justoverclock-users-map-location.forum.locationCity')), m("p", {
}, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('youen-users-map.forum.locationCity')), m("p", {
className: "helpText"
}, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('justoverclock-users-map-location.forum.locationCityDescription')), m("input", {
}, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('youen-users-map.forum.locationCityDescription')), m("input", {
type: "text",
className: "FormControl search-city",
id: "search-city",
@ -16217,8 +16217,8 @@ var AddLocationComponent = /*#__PURE__*/function (_Component) {
if (mapElements.length > 0) {
if (!this.map) {
var mapElement = mapElements[0];
var publicToken = flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().forum.attribute('justoverclock-users-map-location.mapBox-api-key');
var markerIconPath = flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().forum.attribute('baseUrl') + '/assets/extensions/justoverclock-users-map-location/marker-icon.png';
var publicToken = flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().forum.attribute('youen-users-map.mapbox-api-key');
var markerIconPath = flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().forum.attribute('baseUrl') + '/assets/extensions/youen-users-map/marker-icon.png';
var markerIcon = L.icon({
iconUrl: markerIconPath,
iconSize: [25, 41],
@ -16283,7 +16283,7 @@ var AddLocationComponent = /*#__PURE__*/function (_Component) {
_this2.location = null;
flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().alerts.show({
type: 'success'
}, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('justoverclock-users-map-location.forum.locationCleared'));
}, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('youen-users-map.forum.locationCleared'));
_this2.updateMap();
});
@ -16366,7 +16366,7 @@ var AddLocationComponent = /*#__PURE__*/function (_Component) {
};
flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().alerts.show({
type: 'success'
}, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('justoverclock-users-map-location.forum.locationSaved'));
}, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('youen-users-map.forum.locationSaved'));
_this2.updateMap();
});
@ -16380,7 +16380,7 @@ var AddLocationComponent = /*#__PURE__*/function (_Component) {
if (!foundResult) {
flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().alerts.show({
type: 'error'
}, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('justoverclock-users-map-location.forum.locationNotFound'));
}, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('youen-users-map.forum.locationNotFound'));
}
});
};
@ -16439,7 +16439,7 @@ var GlobalMapPage = /*#__PURE__*/function (_Page) {
_proto.oninit = function oninit(vnode) {
_Page.prototype.oninit.call(this, vnode);
flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().setTitle(translate('justoverclock-users-map-location.forum.global-map.title'));
flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().setTitle(translate('youen-users-map.forum.global-map.title'));
this.map = null;
};
@ -16448,7 +16448,7 @@ var GlobalMapPage = /*#__PURE__*/function (_Page) {
"class": "GlobalMapPage"
}, m("div", {
className: "container"
}, m("h2", null, translate('justoverclock-users-map-location.forum.global-map.title2')), m("p", null, translate('justoverclock-users-map-location.forum.global-map.description')), m("div", {
}, m("h2", null, translate('youen-users-map.forum.global-map.title2')), m("p", null, translate('youen-users-map.forum.global-map.description')), m("div", {
className: "global-map"
})));
};
@ -16464,8 +16464,8 @@ var GlobalMapPage = /*#__PURE__*/function (_Page) {
if (mapElements.length > 0) {
if (!this.map) {
var mapElement = mapElements[0];
var publicToken = flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().forum.attribute('justoverclock-users-map-location.mapBox-api-key');
var markerIconPath = flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().forum.attribute('baseUrl') + '/assets/extensions/justoverclock-users-map-location/marker-icon.png';
var publicToken = flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().forum.attribute('youen-users-map.mapbox-api-key');
var markerIconPath = flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().forum.attribute('baseUrl') + '/assets/extensions/youen-users-map/marker-icon.png';
this.userMarkerIcon = L.icon({
iconUrl: markerIconPath,
iconSize: [25, 41],
@ -16601,7 +16601,7 @@ __webpack_require__.r(__webpack_exports__);
flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().initializers.add('justoverclock/users-map-location', function (app) {
flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().initializers.add('youen/users-map', function (app) {
(flarum_common_models_User__WEBPACK_IMPORTED_MODULE_3___default().prototype).location_country = flarum_common_Model__WEBPACK_IMPORTED_MODULE_4___default().attribute('location_country');
(flarum_common_models_User__WEBPACK_IMPORTED_MODULE_3___default().prototype).location_countrycode = flarum_common_Model__WEBPACK_IMPORTED_MODULE_4___default().attribute('location_countrycode');
(flarum_common_models_User__WEBPACK_IMPORTED_MODULE_3___default().prototype).location_postcode = flarum_common_Model__WEBPACK_IMPORTED_MODULE_4___default().attribute('location_postcode');
@ -16609,7 +16609,7 @@ flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().initializers.add('justov
(flarum_common_models_User__WEBPACK_IMPORTED_MODULE_3___default().prototype).location_latitude = flarum_common_Model__WEBPACK_IMPORTED_MODULE_4___default().attribute('location_latitude');
(flarum_common_models_User__WEBPACK_IMPORTED_MODULE_3___default().prototype).location_longitude = flarum_common_Model__WEBPACK_IMPORTED_MODULE_4___default().attribute('location_longitude');
app.store.models.userlocations = _models_UserLocation__WEBPACK_IMPORTED_MODULE_6__["default"];
app.routes['justoverclock.global-map'] = {
app.routes['youen.global-map'] = {
path: '/global-map',
component: _components_GlobalMapPage__WEBPACK_IMPORTED_MODULE_12__["default"]
};
@ -16625,7 +16625,7 @@ flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().initializers.add('justov
(0,flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__.extend)((flarum_forum_components_UserCard__WEBPACK_IMPORTED_MODULE_7___default().prototype), 'oncreate', function (originalResult, vnode) {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = app.forum.attribute('baseUrl') + '/assets/extensions/justoverclock-users-map-location/leaflet.edgebuffer.js';
script.src = app.forum.attribute('baseUrl') + '/assets/extensions/youen-users-map/leaflet.edgebuffer.js';
document.head.appendChild(script);
var user = this.attrs.user;
var location = user.location_latitude() ? {
@ -16634,8 +16634,8 @@ flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().initializers.add('justov
} : null;
if (!location) return;
var mapElement = vnode.dom.getElementsByClassName('location-map')[0];
var publicToken = app.forum.attribute('justoverclock-users-map-location.mapBox-api-key');
var markerIconPath = app.forum.attribute('baseUrl') + '/assets/extensions/justoverclock-users-map-location/marker-icon.png';
var publicToken = app.forum.attribute('youen-users-map.mapbox-api-key');
var markerIconPath = app.forum.attribute('baseUrl') + '/assets/extensions/youen-users-map/marker-icon.png';
var markerIcon = L.icon({
iconUrl: markerIconPath,
iconSize: [25, 41],
@ -16686,7 +16686,7 @@ flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().initializers.add('justov
href: "/global-map",
id: "map-link",
"class": "Button Button--primary"
}, flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('justoverclock-users-map-location.forum.global-map.linkToMap')));
}, flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('youen-users-map.forum.global-map.linkToMap')));
}
}
});

2
js/dist/forum.js.map vendored

File diff suppressed because one or more lines are too long

4
js/package-lock.json generated

@ -1,11 +1,11 @@
{
"name": "@justoverclock/users-map-location",
"name": "@youen/users-map",
"version": "0.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@justoverclock/users-map-location",
"name": "@youen/users-map",
"version": "0.0.0",
"dependencies": {
"@flarum/prettier-config": "^1.0.0",

2
js/package.json

@ -1,5 +1,5 @@
{
"name": "@justoverclock/users-map-location",
"name": "@youen/users-map",
"version": "0.0.0",
"private": true,
"prettier": "@flarum/prettier-config",

14
js/src/admin/index.js

@ -2,19 +2,19 @@ import app from 'flarum/admin/app';
import { extend } from 'flarum/common/extend';
import UserListPage from 'flarum/admin/components/UserListPage';
app.initializers.add('justoverclock/users-map-location', () => {
app.extensionData.for('justoverclock-users-map-location').registerSetting({
setting: 'justoverclock-users-map-location.mapBox-api-key',
name: 'justoverclock-users-map-location.mapBox-api-key',
app.initializers.add('youen/users-map', () => {
app.extensionData.for('youen-users-map').registerSetting({
setting: 'youen-users-map.mapbox-api-key',
name: 'youen-users-map.mapbox-api-key',
type: 'text',
label: app.translator.trans('justoverclock-users-map-location.admin.mapBox-api-key'),
help: app.translator.trans('justoverclock-users-map-location.admin.mapBox-api-key-help'),
label: app.translator.trans('youen-users-map.admin.mapbox-api-key'),
help: app.translator.trans('youen-users-map.admin.mapbox-api-key-help'),
});
extend(UserListPage.prototype, 'columns', function (items) {
items.add(
'location',
{
name: app.translator.trans('justoverclock-users-map-location.admin.adminLocationField'),
name: app.translator.trans('youen-users-map.admin.adminLocationField'),
content: (user) => {
return <div>{user.data.attributes.location}</div>;

20
js/src/forum/components/AddLocationComponent.js

@ -26,20 +26,20 @@ export default class AddLocationComponent extends Component {
view(vnode) {
return (
<fieldset className="Settings-theme">
<legend>{app.translator.trans('justoverclock-users-map-location.forum.location')}</legend>
<legend>{app.translator.trans('youen-users-map.forum.location')}</legend>
<Switch state={this.enableLocation} onchange={val => this.setEnableLocation(val)}>{app.translator.trans('justoverclock-users-map-location.forum.enableLocation')}</Switch>
<Switch state={this.enableLocation} onchange={val => this.setEnableLocation(val)}>{app.translator.trans('youen-users-map.forum.enableLocation')}</Switch>
<div className="fieldset-separator"></div>
{ this.enableLocation ? <div>
<label for="search-country">{app.translator.trans('justoverclock-users-map-location.forum.locationCountry')}</label>
<label for="search-country">{app.translator.trans('youen-users-map.forum.locationCountry')}</label>
<input type="text" className="FormControl search-country" id="search-country" name="search-country" value={this.search_country} onblur={this.countryChanged.bind(this)} />
<div className="fieldset-separator"></div>
<label for="search-city">{app.translator.trans('justoverclock-users-map-location.forum.locationCity')}</label>
<p className="helpText">{app.translator.trans('justoverclock-users-map-location.forum.locationCityDescription')}</p>
<label for="search-city">{app.translator.trans('youen-users-map.forum.locationCity')}</label>
<p className="helpText">{app.translator.trans('youen-users-map.forum.locationCityDescription')}</p>
<input type="text" className="FormControl search-city" id="search-city" name="search-city" value={this.search_city} onblur={this.cityChanged.bind(this)} />
<div className="fieldset-separator"></div>
@ -71,8 +71,8 @@ export default class AddLocationComponent extends Component {
if(!this.map) {
let mapElement = mapElements[0];
const publicToken = app.forum.attribute('justoverclock-users-map-location.mapBox-api-key');
const markerIconPath = app.forum.attribute('baseUrl') + '/assets/extensions/justoverclock-users-map-location/marker-icon.png';
const publicToken = app.forum.attribute('youen-users-map.mapbox-api-key');
const markerIconPath = app.forum.attribute('baseUrl') + '/assets/extensions/youen-users-map/marker-icon.png';
let markerIcon = L.icon({
iconUrl: markerIconPath,
@ -135,7 +135,7 @@ export default class AddLocationComponent extends Component {
this.search_country = 'France';
this.search_city = '';
this.location = null;
app.alerts.show({ type: 'success' }, app.translator.trans('justoverclock-users-map-location.forum.locationCleared'))
app.alerts.show({ type: 'success' }, app.translator.trans('youen-users-map.forum.locationCleared'))
this.updateMap();
});
@ -216,7 +216,7 @@ export default class AddLocationComponent extends Component {
lat: attributes.location_latitude,
lon: attributes.location_longitude
};
app.alerts.show({ type: 'success' }, app.translator.trans('justoverclock-users-map-location.forum.locationSaved'))
app.alerts.show({ type: 'success' }, app.translator.trans('youen-users-map.forum.locationSaved'))
this.updateMap();
});
@ -226,7 +226,7 @@ export default class AddLocationComponent extends Component {
}
if(!foundResult) {
app.alerts.show({ type: 'error' }, app.translator.trans('justoverclock-users-map-location.forum.locationNotFound'))
app.alerts.show({ type: 'error' }, app.translator.trans('youen-users-map.forum.locationNotFound'))
}
});
}

10
js/src/forum/components/GlobalMapPage.tsx

@ -14,7 +14,7 @@ export default class GlobalMapPage extends Page {
oninit(vnode: Mithril.Vnode) {
super.oninit(vnode);
app.setTitle(translate('justoverclock-users-map-location.forum.global-map.title'));
app.setTitle(translate('youen-users-map.forum.global-map.title'));
this.map = null;
}
@ -22,8 +22,8 @@ export default class GlobalMapPage extends Page {
view() {
return <div class="GlobalMapPage">
<div className="container">
<h2>{translate('justoverclock-users-map-location.forum.global-map.title2')}</h2>
<p>{translate('justoverclock-users-map-location.forum.global-map.description')}</p>
<h2>{translate('youen-users-map.forum.global-map.title2')}</h2>
<p>{translate('youen-users-map.forum.global-map.description')}</p>
<div className="global-map"></div>
</div>
</div>;
@ -41,8 +41,8 @@ export default class GlobalMapPage extends Page {
if(!this.map) {
let mapElement = mapElements[0];
const publicToken = app.forum.attribute('justoverclock-users-map-location.mapBox-api-key');
const markerIconPath = app.forum.attribute('baseUrl') + '/assets/extensions/justoverclock-users-map-location/marker-icon.png';
const publicToken = app.forum.attribute('youen-users-map.mapbox-api-key');
const markerIconPath = app.forum.attribute('baseUrl') + '/assets/extensions/youen-users-map/marker-icon.png';
this.userMarkerIcon = L.icon({
iconUrl: markerIconPath,

12
js/src/forum/index.js

@ -17,7 +17,7 @@ import "./../../node_modules/leaflet/dist/leaflet.css";
import "./../../node_modules/leaflet.markercluster/dist/MarkerCluster.css";
import "./../../node_modules/leaflet.markercluster/dist/MarkerCluster.Default.css";
app.initializers.add('justoverclock/users-map-location', (app) => {
app.initializers.add('youen/users-map', (app) => {
User.prototype.location_country = Model.attribute('location_country');
User.prototype.location_countrycode = Model.attribute('location_countrycode');
User.prototype.location_postcode = Model.attribute('location_postcode');
@ -27,7 +27,7 @@ app.initializers.add('justoverclock/users-map-location', (app) => {
app.store.models.userlocations = UserLocation;
app.routes['justoverclock.global-map'] = { path: '/global-map', component: GlobalMapPage };
app.routes['youen.global-map'] = { path: '/global-map', component: GlobalMapPage };
extend(UserCard.prototype, 'infoItems', function (items) {
const user = this.attrs.user;
@ -41,7 +41,7 @@ app.initializers.add('justoverclock/users-map-location', (app) => {
let script = document.createElement('script');
script.type = 'text/javascript';
script.src = app.forum.attribute('baseUrl') + '/assets/extensions/justoverclock-users-map-location/leaflet.edgebuffer.js'
script.src = app.forum.attribute('baseUrl') + '/assets/extensions/youen-users-map/leaflet.edgebuffer.js'
document.head.appendChild(script);
@ -58,8 +58,8 @@ app.initializers.add('justoverclock/users-map-location', (app) => {
let mapElement = vnode.dom.getElementsByClassName('location-map')[0];
const publicToken = app.forum.attribute('justoverclock-users-map-location.mapBox-api-key');
const markerIconPath = app.forum.attribute('baseUrl') + '/assets/extensions/justoverclock-users-map-location/marker-icon.png';
const publicToken = app.forum.attribute('youen-users-map.mapbox-api-key');
const markerIconPath = app.forum.attribute('baseUrl') + '/assets/extensions/youen-users-map/marker-icon.png';
let markerIcon = L.icon({
iconUrl: markerIconPath,
@ -105,7 +105,7 @@ extend(HeaderPrimary.prototype, 'onupdate', function() {
homeLink.parentElement?.append(globalMapLink);
m.render(globalMapLink, <Link href="/global-map" id="map-link" class="Button Button--primary">
{app.translator.trans('justoverclock-users-map-location.forum.global-map.linkToMap')}
{app.translator.trans('youen-users-map.forum.global-map.linkToMap')}
</Link>);
}
}

3580
js/yarn.lock

File diff suppressed because it is too large Load Diff

2
locale/en.yml

@ -1,4 +1,4 @@
justoverclock-users-map-location:
youen-users-map:
admin:
adminLocationField: Location
mapBox-api-key: MapBox Public Token

2
locale/fr.yml

@ -1,4 +1,4 @@
justoverclock-users-map-location:
youen-users-map:
admin:
adminLocationField: Localisation
mapBox-api-key: Jeton public MapBox

4
src/Api/Controller/ListUserLocationsController.php

@ -1,13 +1,13 @@
<?php
namespace Justoverclock\UsersMapLocation\Api\Controller;
namespace Youen\UsersMap\Api\Controller;
use Flarum\Api\Controller\AbstractListController;
use Flarum\Http\RequestUtil;
use Flarum\Http\UrlGenerator;
use Psr\Http\Message\ServerRequestInterface;
use Tobscure\JsonApi\Document;
use Justoverclock\UsersMapLocation\Api\Serializer\UserLocationSerializer;
use Youen\UsersMap\Api\Serializer\UserLocationSerializer;
use Flarum\User\User;
use Flarum\Query\QueryCriteria;
use Flarum\User\Filter\UserFilterer;

2
src/Api/Serializer/UserLocationSerializer.php

@ -1,6 +1,6 @@
<?php
namespace Justoverclock\UsersMapLocation\Api\Serializer;
namespace Youen\UsersMap\Api\Serializer;
use Flarum\Api\Serializer\AbstractSerializer;
use Flarum\User\User;

2
src/Listeners/AddLocationAttribute.php

@ -1,6 +1,6 @@
<?php
namespace Justoverclock\UsersMapLocation\Listeners;
namespace Youen\UsersMap\Listeners;
use Flarum\Api\Serializer\UserSerializer;
use Flarum\User\User;

2
src/Listeners/SaveLocationToDatabase.php

@ -1,6 +1,6 @@
<?php
namespace Justoverclock\UsersMapLocation\Listeners;
namespace Youen\UsersMap\Listeners;
use Flarum\User\Event\Saving;
use Illuminate\Support\Arr;

Loading…
Cancel
Save