diff --git a/NibasaViewer/settings.py b/NibasaViewer/settings.py index 003018f..2c58bb8 100644 --- a/NibasaViewer/settings.py +++ b/NibasaViewer/settings.py @@ -41,7 +41,6 @@ INSTALLED_APPS = [ 'django.contrib.staticfiles', # Project apps. - 'home', 'viewer' ] diff --git a/NibasaViewer/urls.py b/NibasaViewer/urls.py index 028d73a..170fee0 100644 --- a/NibasaViewer/urls.py +++ b/NibasaViewer/urls.py @@ -21,8 +21,7 @@ from django.conf.urls.static import static from django.urls import (path, include) -# Project imports -from home.views import index +from viewer.views import index ########################################################################################### # URL Patterns. # diff --git a/home/__init__.py b/home/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/home/apps.py b/home/apps.py deleted file mode 100644 index e5ea0af..0000000 --- a/home/apps.py +++ /dev/null @@ -1,6 +0,0 @@ -from django.apps import AppConfig - - -class HomeConfig(AppConfig): - default_auto_field = 'django.db.models.BigAutoField' - name = 'home' diff --git a/home/migrations/__init__.py b/home/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/home/views.py b/home/views.py deleted file mode 100644 index cdeca6c..0000000 --- a/home/views.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.shortcuts import redirect - -# Create your views here. -def index(request): - return redirect('gallery_view_root') diff --git a/viewer/static/css/styles.css b/viewer/static/css/styles.css index 76e506b..fba9874 100644 --- a/viewer/static/css/styles.css +++ b/viewer/static/css/styles.css @@ -1,3 +1,12 @@ +html { + height:100%; +} + +body { + height: 100%; + margin: 0px; +} + /**************************************************************************** * Containers. * ****************************************************************************/ @@ -13,19 +22,37 @@ } .image-container { - height: 75vh; + position: relative; + height: 100%; + width: 100%; + overflow: hidden; } .fc { width: fit-content; } +.h90 { + height: 90%; +} + +.full-width { + width: 100%; +} + /**************************************************************************** * Content. * ****************************************************************************/ -.image { +.image-container img { + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; height: 100%; + width: auto; + margin: auto; } .mauto { @@ -58,7 +85,7 @@ } .search-box { - height: 2em; + height: 2.5em; } /**************************************************************************** diff --git a/viewer/templates/gallery_view.html b/viewer/templates/gallery_view.html index 7e55d2a..649714e 100644 --- a/viewer/templates/gallery_view.html +++ b/viewer/templates/gallery_view.html @@ -65,7 +65,7 @@ - + diff --git a/viewer/templates/image_view.html b/viewer/templates/image_view.html index b86543f..e280947 100644 --- a/viewer/templates/image_view.html +++ b/viewer/templates/image_view.html @@ -1,6 +1,6 @@ {% load static %} - + @@ -30,7 +30,7 @@ </table> <!-- Image view. --> - <table class="fc mauto"> + <table class="fc mauto h90"> <tr> <!-- Previous image. --> <td> @@ -42,12 +42,12 @@ </td> <!-- Current image. --> - <td> - <div class="image-container"> - <a href="{{image_path}}" target="_blank"> + <td class="full-width"> + <a href="{{image_path}}" target="_blank"> + <div class="image-container"> <img src="{{image_path}}" class="image"> - </a> - </div> + </div> + </a> </td> <!-- Next image. --> diff --git a/viewer/views.py b/viewer/views.py index 27ef1e9..32e72b5 100644 --- a/viewer/views.py +++ b/viewer/views.py @@ -27,6 +27,9 @@ IMAGES_PER_PAGE = CELLS_PER_ROW * ROWS_PER_PAGE # View functions. # ########################################################################################### +def index(request): + return redirect('gallery_view_root') + def do_recursive_search(start_path, query): """ Gets all images and sub-directories inside the start_path whose name matches the given query,