# HG changeset patch # User neko259 # Date 2015-07-23 19:50:35 # Node ID ea38de1ee4d0861a370bef42ca0cd404ae7efed3 # Parent 92ddbd4a5bb5548a13009fef189ed28ce3fd47cc Added image format and size label to images diff --git a/boards/models/image.py b/boards/models/image.py --- a/boards/models/image.py +++ b/boards/models/image.py @@ -3,6 +3,7 @@ import os from random import random import time from django.db import models +from django.template.defaultfilters import filesizeformat from boards import thumbs from boards.models.base import Viewable @@ -88,6 +89,8 @@ class PostImage(models.Model, Viewable): return self.image.url def get_view(self): + metadata = '{}, {}'.format(self.image.name.split('.')[-1], + filesizeformat(self.image.size)) return '
' \ '' \ '' \ '' \ + '' \ '
'\ .format(CSS_CLASS_IMAGE, CSS_CLASS_THUMB, self.image.url_200x150, str(self.hash), str(self.pre_width), - str(self.pre_height), str(self.width), str(self.height), full=self.image.url) + str(self.pre_height), str(self.width), str(self.height), + full=self.image.url, image_meta=metadata) diff --git a/boards/static/css/md/base_page.css b/boards/static/css/md/base_page.css --- a/boards/static/css/md/base_page.css +++ b/boards/static/css/md/base_page.css @@ -526,10 +526,9 @@ ul { } .tree_reply > .post { - margin-left: 1ex; margin-top: 1ex; border-left: solid 1px #777; - border-right: solid 1px #777; + padding-right: 0; } #preview-text { @@ -543,3 +542,8 @@ button { margin-bottom: .5ex; margin-top: .5ex; } + +.image-metadata { + font-style: italic; + font-size: 0.9em; +} \ No newline at end of file diff --git a/boards/static/css/pg/base_page.css b/boards/static/css/pg/base_page.css --- a/boards/static/css/pg/base_page.css +++ b/boards/static/css/pg/base_page.css @@ -376,3 +376,8 @@ input[type="submit"]:hover { margin: 1ex 0 1ex 0; padding: 1ex; } + +.image-metadata { + font-style: italic; + font-size: 0.9em; +} \ No newline at end of file diff --git a/boards/static/css/sw/base_page.css b/boards/static/css/sw/base_page.css --- a/boards/static/css/sw/base_page.css +++ b/boards/static/css/sw/base_page.css @@ -407,3 +407,8 @@ li { margin: 1ex 0 1ex 0; padding: 1ex; } + +.image-metadata { + font-style: italic; + font-size: 0.9em; +} \ No newline at end of file