Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow custom web templates and static 🕷️ #481

Merged
merged 4 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/change_log.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ There is one key exception to the rules above -- and that is with `MAJOR`=0 rele
**Fixes**
-->

**Enhancements**

- Allow custom html templates and static files that override default shipped by default


**Fixes**

- fix bug where workers incorrectly grab substring tag matches (e.g. a worker submited with the tag `ex` would incorrectly grab jobs like `ex-01` or `ex-02`)
Expand Down
39 changes: 38 additions & 1 deletion docs/contributing/maintainer_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# Maintainer notes

!!! note
currently this section is only relevant to @jacksund
currently this page is only relevant to @jacksund

## Making a release

To make a new release, you must follow these steps:

Expand Down Expand Up @@ -30,3 +32,38 @@ conda create -n my_env -c conda-forge simmate -y
# as an extra, make sure spyder can also be installed in the same env
conda install -n my_env -c conda-forge spyder -y
```

## Website CSS

The Hyper theme described in our main docs [here](/simmate/full_guides/website/overview/#css-and-js-assets) must be built and hosted separately from any Simmate
server to abide by licensing. The build/host the assests, follow these steps:


1. download hyper theme (private access): e.g. `Hyper_v4.6.0.zip`
2. unpack the zip file and navigate to this directory:
``` bash
cd Hyper_v4.6.0/Bootstrap_5x/Hyper/
```
3. install prereqs into a new conda env and activate it
``` bash
conda create -n hyper -c conda-forge nodejs yarn git
conda activate hyper
```
4. install gulp using npm (conda install of gulp doesn't work)
``` bash
npm install gulp -g
```
5. in the main dir, install all hyper dependencies using the `yarn.lock` file
``` bash
yarn install
```
6. edit any themes/colors in the following files (e.g. change primary to `#0072ce`)
```
/src/assests/scss/config/saas/
>> go into each folder's _variables.scss
```
7. Build the assets
``` bash
gulp build
```
8. Upload assests (in `dist` folder) to your cdn for serving
13 changes: 10 additions & 3 deletions src/simmate/configuration/django/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,11 @@
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
# I set DIRS below so I can have a single templates folder
"DIRS": [DJANGO_DIRECTORY / "templates"],
"DIRS": [
SIMMATE_DIRECTORY / "templates", # let's user easily override html
DJANGO_DIRECTORY / "templates", # a single templates folder
# Then APP_DIRS are checked in order
],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
Expand Down Expand Up @@ -388,7 +391,11 @@
STATIC_ROOT = DJANGO_DIRECTORY / "static"

# Extra places for collectstatic to find static files.
STATICFILES_DIRS = [DJANGO_DIRECTORY / "static_files"]
STATICFILES_DIRS = [
SIMMATE_DIRECTORY / "static_files", # let's user add their own files
DJANGO_DIRECTORY / "static_files",
]


# For the dynamically-created structure files, we need to include the static
# directory this to work during local testing. This is NOT allowed in a
Expand Down