Archived
1
0

more fixes

This commit is contained in:
Jeff Becker 2016-11-05 16:15:41 -04:00
parent e686f0d57e
commit 31a12185f6
No known key found for this signature in database
GPG Key ID: AB950234D6EA286B
3 changed files with 6 additions and 6 deletions

View File

@ -18,7 +18,7 @@ class Attachment(models.Model):
def path(self):
ext = self.filename.split('.')[-1]
return '{}{}'.format(self.filehash, ext)
return '{}.{}'.format(self.filehash, ext)
def thumb(self):
return '/media/thumb-{}.jpg'.format(self.path())
@ -66,7 +66,7 @@ class Post(models.Model):
rpls = self.get_all_replies()
l = len(rpls)
if l > truncate:
rpls = rpls[(l+1)-truncate:l-1]
rpls = rpls[l-truncate:]
return rpls
def is_op(self):

View File

@ -16,7 +16,7 @@
<div class="attachments">
{% for a in op.attachments.all %}
<img src="{{a.thumb}}"></img>
<a href="{{a.source}}"><img class="thumb" src="{{a.thumb}}"></img></a>
{% endfor %}
</div>
<pre class="postbody">{{op.message|memepost}}</pre>
@ -31,7 +31,7 @@
</div>
<div class="attachments">
{% for a in reply.attachments.all %}
<img src="{{a.thumb}}"></img>
<a href="{{a.source}}"><img class="thumb" src="{{a.thumb}}"></img></a>
{% endfor %}
</div>
<pre class="postbody">{{reply.message|memepost}}</pre>

View File

@ -13,7 +13,7 @@
<div class="attachments">
{% for a in op.attachments.all %}
<img class="thumb" src="{{a.thumb}}"></img>
<a href="{{a.source}}"><img class="thumb" src="{{a.thumb}}"></img></a>
{% endfor %}
</div>
<pre class="postbody">{{op.message|memepost}}</pre>
@ -28,7 +28,7 @@
</div>
<div class="attachments">
{% for a in reply.attachments.all %}
<img class="thumb" src="{{a.thumb}}"></img>
<a href="{{a.source}}"><img class="thumb" src="{{a.thumb}}"></img></a>
{% endfor %}
</div>
{% autoescape off %}