diff --git a/bhtom2/bhtom_mymodule/__init__.py b/bhtom2/bhtom_mymodule/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/bhtom2/bhtom_mymodule/urls.py b/bhtom2/bhtom_mymodule/urls.py new file mode 100644 index 0000000..0a8827b --- /dev/null +++ b/bhtom2/bhtom_mymodule/urls.py @@ -0,0 +1,9 @@ +from django.urls import path +from . import views + +app_name = 'bhtom_mymodule' + +urlpatterns = [ + path('list/', views.mymodule_list, name='list'), + path('details/', views.mymodule_details, name='details'), +] diff --git a/bhtom2/bhtom_mymodule/views.py b/bhtom2/bhtom_mymodule/views.py new file mode 100644 index 0000000..3d5091d --- /dev/null +++ b/bhtom2/bhtom_mymodule/views.py @@ -0,0 +1,7 @@ +from django.shortcuts import render + +def mymodule_list(request): + return render(request, 'bhtom_mymodule/list.html') + +def mymodule_details(request): + return render(request, 'bhtom_mymodule/details.html') diff --git a/bhtom2/static/oca_tom_image.jpg b/bhtom2/static/oca_tom_image.jpg new file mode 100644 index 0000000..420148c Binary files /dev/null and b/bhtom2/static/oca_tom_image.jpg differ diff --git a/bhtom2/templates/bhtom_common/base.html b/bhtom2/templates/bhtom_common/base.html index 94323cc..b8a225c 100644 --- a/bhtom2/templates/bhtom_common/base.html +++ b/bhtom2/templates/bhtom_common/base.html @@ -25,11 +25,11 @@ {% bootstrap_javascript jquery='True' %} - BHTOM | {% block title %}{% endblock %} + {{ logo_text }} | {% block title %}{% endblock %} {% if PROFILE != 'PROD' %} @@ -83,4 +83,3 @@ {% endblock %} - diff --git a/bhtom2/templates/bhtom_common/index.html b/bhtom2/templates/bhtom_common/index.html index 23f3ac2..0c5bd52 100644 --- a/bhtom2/templates/bhtom_common/index.html +++ b/bhtom2/templates/bhtom_common/index.html @@ -4,10 +4,8 @@ {% block content %}
-

Black Hole TOM 2.0

-

+

{{ title_text }}

+

(Image courtesy of NASA/ESA/Gaia/DPAC)

@@ -16,12 +14,17 @@

Black Hole TOM 2.0



+ {% if title_text == "Black Hole TOM 2.0" %}

New version of BHTOM is still in beta-testing

Draft version of the documentation

+ {% elif title_text == "OCA TOM" %} +

OCM Observatory proposals, targets and observations database

+

Here you can find various astronomical data and tools specific to the OCA TOM project.

+ {% endif %}
@@ -42,18 +45,18 @@

New version of BHTOM is still in beta-testing

"I have one request, which is this, that the observations shall be made known each year. Observations buried in a desk are no observations. Should they be entrusted to me for reduction, or even for publication, I will undertake it with joy and thanks, and will also answer all questions with care and with the greatest pleasure.” - +

Friedrich Wilhelm August Argelander, 1844
“An Appeal to the Friends of Astronomy” in Schumacher's Astronomical Year Book
translated by Annie Jump Cannon, Popular Astronomy, 1912 -

-
- +

+ + -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/bhtom2/templates/bhtom_common/navbar_content.html b/bhtom2/templates/bhtom_common/navbar_content.html index ded7911..dadde4b 100644 --- a/bhtom2/templates/bhtom_common/navbar_content.html +++ b/bhtom2/templates/bhtom_common/navbar_content.html @@ -91,4 +91,19 @@
+{% endif %} + +{% if customization == "OCATOM" %} + {% if request.user.is_superuser or request.user.is_staff %} + + {% endif %} {% endif %} \ No newline at end of file diff --git a/bhtom2/templates/bhtom_mymodule/details.html b/bhtom2/templates/bhtom_mymodule/details.html new file mode 100644 index 0000000..0585334 --- /dev/null +++ b/bhtom2/templates/bhtom_mymodule/details.html @@ -0,0 +1,2 @@ +

MyModule Details

+

To jest strona szczegółów dla MyModule.

diff --git a/bhtom2/templates/bhtom_mymodule/list.html b/bhtom2/templates/bhtom_mymodule/list.html new file mode 100644 index 0000000..9533c18 --- /dev/null +++ b/bhtom2/templates/bhtom_mymodule/list.html @@ -0,0 +1,2 @@ +

MyModule List

+

To jest strona listy dla MyModule.

diff --git a/bhtom2/urls.py b/bhtom2/urls.py index 3d22db1..f1fee4a 100644 --- a/bhtom2/urls.py +++ b/bhtom2/urls.py @@ -49,6 +49,7 @@ name='alerts:list'), path('', include('django_prometheus.urls')), path('metrics/', custom_metrics, name='custom_metrics'), + path('mymodule/', include('bhtom2.bhtom_mymodule.urls', namespace='bhtom_mymodule')), ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) diff --git a/bhtom_base b/bhtom_base index e25107a..4618b0f 160000 --- a/bhtom_base +++ b/bhtom_base @@ -1 +1 @@ -Subproject commit e25107aafe0185918b9a77f07807f680a584d6ac +Subproject commit 4618b0f15028d1a4cc9b4c9994d1bc2ae9399ada diff --git a/docker/dev/dev_entrypoint.sh b/docker/dev/dev_entrypoint.sh index c3dfb30..4b0b080 100644 --- a/docker/dev/dev_entrypoint.sh +++ b/docker/dev/dev_entrypoint.sh @@ -13,10 +13,10 @@ fi echo "Collecting static..." -while ! python manage.py collectstatic --no-input 2>&1; do - echo "Collecting static..." - sleep 3 -done +#while ! python manage.py collectstatic --no-input 2>&1; do +# echo "Collecting static..." +# sleep 3 +#done echo "Migrating..." diff --git a/requirements.txt b/requirements.txt index ce6bc37..d1deafe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,10 +14,10 @@ djangorestframework>=3.12 django-pgviews==0.5.7 django-tables2==2.4.1 factory_boy==3.2.1 -fits2image==0.4.4 +fits2image==0.4.6 graypy==2.1.0 importlib-metadata==4.11.3 -Markdown==3.3.4 +Markdown==3.4.1 mechanize==0.4.8 pandas==1.4.2 pyfakefs==4.5.6 @@ -36,7 +36,7 @@ pillow==9.0.1 plotly>=5.7.0 pylatex==1.4.1 recommonmark>=0.7 -specutils==1.5.0 +specutils==1.7.0 sphinx>=4.0 lxml==4.9.1 crispy-bootstrap4>=2022.1 diff --git a/settings/.bhtom.env.template b/settings/.bhtom.env.template index 25d1d48..46e9322 100644 --- a/settings/.bhtom.env.template +++ b/settings/.bhtom.env.template @@ -11,6 +11,8 @@ POSTGRES_PORT=5430 KAFKA_HOST_PORT=localhost:9092 ############################## APLICATION ######################################### +CUSTOMIZATION=BHTOM +#CUSTOMIZATION=OCATOM #aplication ALLOWED_HOSTS=localhost,0.0.0.0,127.0.0.1,host.docker.internal diff --git a/settings/settings.py b/settings/settings.py index 2fa6b0c..c540fa0 100644 --- a/settings/settings.py +++ b/settings/settings.py @@ -127,7 +127,8 @@ 'crispy_bootstrap4', 'drf_yasg', 'django_guid', - 'django_prometheus' + 'django_prometheus', + 'bhtom2.bhtom_mymodule', ] MIDDLEWARE = [ @@ -495,3 +496,13 @@ def generate_name_tuple(data_source: DataSource) -> tuple: DATA_UPLOAD_MAX_MEMORY_SIZE = 52428800 # 50 MB (adjust as needed) +CUSTOMIZATION = secret.get("CUSTOMIZATION", 'BHTOM') + +if CUSTOMIZATION == "OCATOM": + CUST_WALLPAPER = 'oca_tom_image.jpg' + TITLE_TEXT = "OCA TOM" + LOGO_TEXT = "OCATOM" +else: # CUSTOMIZATION == "BHTOM" + CUST_WALLPAPER = 'bh_tom_image.jpg' + TITLE_TEXT = "Black Hole TOM 2.0" + LOGO_TEXT = "BHTOM" \ No newline at end of file