Skip to content

Commit

Permalink
refactor destination of JS/CSS files in static folder
Browse files Browse the repository at this point in the history
  • Loading branch information
jrief committed Oct 11, 2024
1 parent b70b81d commit c1dbda1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ data
local.sqlite

workdir*/
finder/static/admin/finder/
finder/static/finder/
2 changes: 1 addition & 1 deletion client/esbuild.config.mjs → client/adminbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ await build({
bundle: true,
minify: buildOptions.minify,
sourcemap: buildOptions.debug,
outdir: 'finder/static/admin/finder/js',
outdir: 'finder/static/finder/js/admin',
splitting: true,
format: 'esm',
jsx: 'automatic',
Expand Down
6 changes: 3 additions & 3 deletions finder/admin/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from finder.models.file import FileModel
from finder.models.label import Label
from .inode import InodeAdmin
from finder.admin.inode import InodeAdmin


class LabelsChoiceField(ModelMultipleChoiceField):
Expand Down Expand Up @@ -45,9 +45,9 @@ class FileAdmin(InodeAdmin):
@property
def media(self):
return Media(
css={'all': ['admin/finder/css/finder-admin.css', 'admin/css/forms.css']},
css={'all': ['finder/css/finder-admin.css', 'admin/css/forms.css']},
js=[format_html(
'<script type="module" src="{}"></script>', static('admin/finder/js/file-admin.js')
'<script type="module" src="{}"></script>', static('finder/js/admin/file-admin.js')
)],
)

Expand Down
4 changes: 2 additions & 2 deletions finder/admin/folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ class FolderAdmin(InodeAdmin):
@property
def media(self):
return Media(
css={'all': ['admin/finder/css/finder-admin.css']},
css={'all': ['finder/css/finder-admin.css']},
js=[format_html(
'<script type="module" src="{}"></script>', static('admin/finder/js/folder-admin.js')
'<script type="module" src="{}"></script>', static('finder/js/admin/folder-admin.js')
)],
)

Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
"license": "MIT",
"private": true,
"scripts": {
"esbuild": "node client/esbuild.config.mjs",
"compilescss": "sass --load-path=. client:finder/static/admin/finder/css/",
"buildall": "concurrently \"npm run esbuild -- --debug \" \"npm run compilescss\""
"adminbuild": "node client/adminbuild.config.mjs",
"compilescss": "sass --load-path=. client:finder/static/finder/css/",
},
"devDependencies": {
"@dnd-kit/core": "^6.1.0",
Expand Down

0 comments on commit c1dbda1

Please sign in to comment.