Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Surfoo committed Feb 12, 2019
2 parents 7df7e44 + 3a41114 commit 2e4c3cd
Show file tree
Hide file tree
Showing 21 changed files with 10,904 additions and 695 deletions.
25 changes: 25 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module"
},
"rules": {
"semi": ["error", "always"],
"quotes": ["error", "double"],
"no-console": ["off"]
},
"env": {
"es6": true,
"browser": true,
"jquery": true
},
"globals": {
"user": false,
"tinyMCE": false,
"tinymce": false,
"language": false,
"roadbook_id": false,
"ActiveXObject": false
},
"extends": "eslint:recommended"
}
332 changes: 166 additions & 166 deletions app/app.js

Large diffs are not rendered by default.

16 changes: 12 additions & 4 deletions app/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Silex\Provider\WebProfilerServiceProvider;
use Symfony\Component\Debug\ErrorHandler;
use Symfony\Component\Debug\ExceptionHandler;
use Monolog\Logger;

// Register global error and exception handlers
ErrorHandler::register();
Expand Down Expand Up @@ -44,10 +45,17 @@
$app->get('/login', 'Georoadbook\Controller\Controller::loginAction')
->bind('login');

$app->get('/logout', 'Georoadbook\Controller\Controller::logoutAction')
->bind('logout');

$app->get('/callback', 'Georoadbook\Controller\Controller::callbackAction')
->bind('callback');

$app['monolog.name'] = 'georoadbook';
$app['monolog.logfile'] = __DIR__ . '/logs/' . $app['monolog.name'] . '-' . date('Ymd') . '.log';
$app['monolog.level'] = Logger::WARNING;

//header('Content-type: text/html; charset=utf-8');
header('Content-type: text/html; charset=utf-8');

$app->register(new TwigServiceProvider(), array(
'twig.path' => __DIR__ . '/templates',
Expand All @@ -60,9 +68,9 @@
$app->extend('twig', function($twig, $app) {
$twig->addGlobal('suffix_css_js', $app['suffix_css_js']);

if ($app['debug']) {
$twig->addExtension(new Twig_Extension_Debug());
}
// if ($app['debug']) {
// $twig->addExtension(new Twig_Extension_Debug());
// }
return $twig;
});

Expand Down
Empty file added app/cache/.gitkeep
Empty file.
11 changes: 7 additions & 4 deletions app/config.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

date_default_timezone_set('Europe/Paris');

$app['debug'] = true;
$app['monolog.level'] = \Monolog\Logger::ERROR;

// Geocaching API Access
$app['oauth_key'] = '';
$app['oauth_secret'] = '';
$app['oauth_url'] = 'live';
$app['oauth_callback_url'] = '';
$app['oauth_key'] = '';
$app['oauth_secret'] = '';
$app['callback_url'] = '';
$app['environment'] = 'production';

// Locales for the roadbook
$app['locales'] = [
Expand Down
12 changes: 6 additions & 6 deletions app/templates/_header.twig.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
{% if app.session.get('user') is not defined or app.session.get('user') is null %}
<button type="button" id="btn_geocaching" class="btn btn-primary navbar-btn navbar-right">Login with Geocaching.com</button>
{% else %}
<div class="hello-user navbar-right navbar-text">
<span><img src="{{ app.session.get('user').AvatarUrl }}" width="30" alt="" /></span>
<span>Hello {{ app.session.get('user').UserName }}!</span>
<span class="btn btn-default" role="button"><a href="?logout">Sign Out</a></span>
</div>
<div class="hello-user navbar-right navbar-text">
<span><img src="{{ app.session.get('user').avatarUrl }}" width="30" alt="" /></span>
<span>Hello {{ app.session.get('user').username }}!</span>
<span class="btn btn-default" role="button"><a href="/logout">Sign Out</a></span>
</div>
{% endif %}
</div>
</div>
</nav>
</nav>
8 changes: 4 additions & 4 deletions app/templates/index.twig.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
<p>Choose a GPX file{% if pocketqueryList is defined %} or a Pocket Query{% endif %}:</p>

<input id="gpx" type="file" class="file" aria-describedby="helpBlockGpx">
<span id="helpBlockGpx" class="help-block"><i class="glyphicon glyphicon-question-sign"></i> 8Mb maximum</span>
<span id="helpBlockGpx" class="help-block"><i class="glyphicon glyphicon-question-sign"></i> v1.0.1 only, 8Mb max.</span>

{% if pocketqueryList is defined %}
<label for="pocket_list">Your Pocket Queries:
<select name="pocket_guid" class="form-control" id="pocket_list">
<select name="referenceCode" class="form-control" id="pocket_list">
<option value=""></option>
{% for pocket in pocketqueryList %}
<option value="{{ pocket.GUID }}">{{ pocket.Name }}</option>
{% for pq in pocketqueryList %}
<option value="{{ pq.referenceCode }}">{{ pq.name }}</option>
{% endfor %}
</select>
</label>
Expand Down
2 changes: 1 addition & 1 deletion brunch-config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

exports.config = {
optimize: true,
optimize: false,
paths: {
watched: ["app"],
public: "web"
Expand Down
15 changes: 9 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"type": "project",
"keywords": ["groundspeak", "geocaching", "georoadbook", "geocache", "roadbook"],
"homepage": "https://georoadbook.vaguelibre.net/",
"time": "2013-09-13",
"description": "Create your geocaching roadbook ready-to-print from your gpx file.",
"authors": [{
"name": "Surfoo",
Expand All @@ -17,10 +16,10 @@
}
},
"require": {
"php": "~7.2",
"ext-dom": "*",
"ext-zip": "*",
"ext-tidy": "*",
"php": ">=5.6 | ~7.0",
"jbbcode/jbbcode": "1.2.*",
"twig/twig": "~2.0",
"tinymce/tinymce": "~4.0",
Expand All @@ -33,20 +32,24 @@
"symfony/asset": "^3.2",
"twbs/bootstrap": "^3.3",
"kartik-v/bootstrap-fileinput": "~4.3.0",
"geocaching/api": "^2.0",
"surfoo/geocaching-php-sdk": "~3.2.0",
"components/jquery": "~2.2"
},
"require-dev": {
"silex/web-profiler": "^2.0",
"symfony/var-dumper": "^3.2"
"symfony/var-dumper": "^3.2",
"phpstan/phpstan": "^0.10.5"
},
"scripts": {
"post-update-cmd": [
"assets": [
"cp -rf vendor/components/jquery vendor/twbs/bootstrap vendor/tinymce/tinymce vendor/kartik-v/bootstrap-fileinput web/assets"
],
"post-update-cmd": [
"@assets"
],
"post-install-cmd": [
"cp -n app/config.php.dist app/config.php",
"cp -nrf vendor/components/jquery vendor/twbs/bootstrap vendor/tinymce/tinymce vendor/kartik-v/bootstrap-fileinput web/assets"
"@assets"
]
}
}
Loading

0 comments on commit 2e4c3cd

Please sign in to comment.