Introduce version to template. Rename Javascript URI

This commit is contained in:
James Cole 2017-09-12 19:57:41 +02:00
parent 6e80b2f4c8
commit 436017baee
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
3 changed files with 3 additions and 56 deletions

View File

@ -61,6 +61,7 @@ class Controller extends BaseController
View::share('IS_DEMO_SITE', $isDemoSite);
View::share('DEMO_USERNAME', env('DEMO_USERNAME', ''));
View::share('DEMO_PASSWORD', env('DEMO_PASSWORD', ''));
View::share('FF_VERSION', config('firefly.version'));
$this->middleware(
@ -117,7 +118,7 @@ class Controller extends BaseController
if (!(strpos($identifier, 'delete') === false) && !(strpos($uri, '/show/') === false)) {
$uri = route('index');
}
if (!(strpos($uri, 'javascript') === false)) {
if (!(strpos($uri, 'jscript') === false)) {
$uri = route('index');
}

View File

@ -1,54 +0,0 @@
<?php
/**
* StartFireflySession.php
* Copyright (c) 2017 thegrumpydictator@gmail.com
* This software may be modified and distributed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
declare(strict_types=1);
namespace FireflyIII\Http\Middleware;
use Illuminate\Http\Request;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\Session\SessionManager;
/**
* Class StartFireflySession
*
* @package FireflyIII\Http\Middleware
*/
class StartFireflySession extends StartSession
{
/**
* Create a new session middleware.
*
* @param \Illuminate\Session\SessionManager $manager
*/
public function __construct(SessionManager $manager)
{
parent::__construct($manager);
}
/**
* Store the current URL for the request if necessary.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Contracts\Session\Session $session
*
* @return void
*/
protected function storeCurrentUrl(Request $request, $session)
{
$fullUrl = $request->fullUrl();
if ($request->method() === 'GET' && $request->route() && !$request->ajax()) {
if (strpos($fullUrl, '/javascript/') === false) {
$session->setPreviousUrl($fullUrl);
}
}
}
}

View File

@ -423,7 +423,7 @@ Route::group(
* Budget Controller
*/
Route::group(
['middleware' => 'user-full-auth', 'prefix' => 'javascript', 'as' => 'javascript.'], function () {
['middleware' => 'user-full-auth', 'prefix' => 'jscript', 'as' => 'javascript.'], function () {
Route::get('variables', ['uses' => 'JavascriptController@variables', 'as' => 'variables']);
Route::get('accounts', ['uses' => 'JavascriptController@accounts', 'as' => 'accounts']);
Route::get('currencies', ['uses' => 'JavascriptController@currencies', 'as' => 'currencies']);