mirror of
https://github.com/grocy/grocy.git
synced 2025-08-21 04:43:32 +00:00
Changed how custom JS/CSS can be added
This commit is contained in:
@@ -59,8 +59,9 @@ Database schema migration is automatically done when visiting the root (`/`) rou
|
|||||||
### Demo mode
|
### Demo mode
|
||||||
When the file `data/demo.txt` exists, the application will work in a demo mode which means authentication is disabled and some demo data will be generated during the database schema migration.
|
When the file `data/demo.txt` exists, the application will work in a demo mode which means authentication is disabled and some demo data will be generated during the database schema migration.
|
||||||
|
|
||||||
### Other things
|
### Adding your own CSS or JS without to have to modify the application itself
|
||||||
When the file `data/add_before_end_body.html` exists, the contents of the file be added just before `</body>` on every page, useful for your own JS/CSS without to have to modify the application itself.
|
- When the file `data/custom.js` exists, the contents of the file be added just before `</body>` on every page
|
||||||
|
- When the file `data/custom.css` exists, the contents of the file be added just before `</head>` on every page
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
#### Dashboard
|
#### Dashboard
|
||||||
|
@@ -26,6 +26,10 @@
|
|||||||
<link href="{{ $U('/css/grocy.css?v=', true) }}{{ $version }}" rel="stylesheet">
|
<link href="{{ $U('/css/grocy.css?v=', true) }}{{ $version }}" rel="stylesheet">
|
||||||
@stack('pageStyles')
|
@stack('pageStyles')
|
||||||
|
|
||||||
|
@if(file_exists(__DIR__ . '/../../data/custom.css'))
|
||||||
|
@php include __DIR__ . '/../../data/custom.css' @endphp
|
||||||
|
@endif
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var Grocy = { };
|
var Grocy = { };
|
||||||
Grocy.Components = { };
|
Grocy.Components = { };
|
||||||
@@ -235,8 +239,8 @@
|
|||||||
@stack('componentScripts')
|
@stack('componentScripts')
|
||||||
<script src="{{ $U('/viewjs', true) }}/@yield('viewJsName').js?v={{ $version }}"></script>
|
<script src="{{ $U('/viewjs', true) }}/@yield('viewJsName').js?v={{ $version }}"></script>
|
||||||
|
|
||||||
@if(file_exists(__DIR__ . '/../../data/add_before_end_body.html'))
|
@if(file_exists(__DIR__ . '/../../data/custom.js'))
|
||||||
@php include __DIR__ . '/../../data/add_before_end_body.html' @endphp
|
@php include __DIR__ . '/../../data/custom.js' @endphp
|
||||||
@endif
|
@endif
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user