From 75ee476abf1d822a7cb8c6b6fd128b69896cc947 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 2 Mar 2017 16:56:18 -0800 Subject: [PATCH] minor visual fixes --- etiquette/photodb.py | 6 +++++- etiquette_site.py | 3 +-- static/common.css | 2 +- templates/photo.html | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/etiquette/photodb.py b/etiquette/photodb.py index ae65f15..ef07b2b 100644 --- a/etiquette/photodb.py +++ b/etiquette/photodb.py @@ -421,7 +421,6 @@ class PDBPhotoMixin: Returns the Photo object. ''' filename = os.path.abspath(filename) - self.log.debug('New Photo: %s' % filename) if not os.path.isfile(filename): raise FileNotFoundError(filename) @@ -435,6 +434,7 @@ class PDBPhotoMixin: exc.photo = existing raise exc + self.log.debug('New Photo: %s' % filename) author_id = self.get_user_id_or_none(author) extension = os.path.splitext(filename)[1] @@ -1204,6 +1204,7 @@ class PhotoDB(PDBAlbumMixin, PDBBookmarkMixin, PDBPhotoMixin, PDBTagMixin, PDBUs albums = {directory.absolute_path: album} for (current_location, directories, files) in generator: + # Create the photo object new_photos = [] for filepath in files: try: @@ -1215,6 +1216,7 @@ class PhotoDB(PDBAlbumMixin, PDBBookmarkMixin, PDBPhotoMixin, PDBTagMixin, PDBUs if not make_albums: continue + # Ensure that the current directory is an album. current_album = albums.get(current_location.absolute_path, None) if current_album is None: try: @@ -1228,6 +1230,8 @@ class PhotoDB(PDBAlbumMixin, PDBBookmarkMixin, PDBPhotoMixin, PDBTagMixin, PDBUs self.log.debug('Created %s' % current_album.title) albums[current_location.absolute_path] = current_album + # Add the current directory album to the parent directory album. + # Add the photos to the current album. parent = albums.get(current_location.parent.absolute_path, None) if parent is not None: try: diff --git a/etiquette_site.py b/etiquette_site.py index 8ec8cd3..b6d0ddb 100644 --- a/etiquette_site.py +++ b/etiquette_site.py @@ -103,7 +103,7 @@ def P_tag(tagname): try: return P.get_tag(tagname) except exceptions.NoSuchTag as e: - return 'That tag doesnt exist: %s' % e + return 'That tag doesnt exist: %s' % tagname @P_wrapper def P_user(username): @@ -122,7 +122,6 @@ def send_file(filepath, override_mimetype=None): flask.abort(404) outgoing_headers = {} - print(override_mimetype) if override_mimetype is not None: mimetype = override_mimetype else: diff --git a/static/common.css b/static/common.css index e4cb1cb..aa64a9b 100644 --- a/static/common.css +++ b/static/common.css @@ -171,7 +171,7 @@ li .photo_card_grid_file_metadata { font-family: monospace; - font-size: 12px; + font-size: 11px; display: flex; justify-content: space-between; z-index: 0; diff --git a/templates/photo.html b/templates/photo.html index 2491708..2b9a6e3 100644 --- a/templates/photo.html +++ b/templates/photo.html @@ -226,7 +226,7 @@ function receive_callback(response) if ("error" in response) { message_positivity = "message_negative"; - message_text = '"' + tagname + '" ' + response["error"]; + message_text = response["error"]; } else {