more fixes
This commit is contained in:
parent
e686f0d57e
commit
31a12185f6
@ -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):
|
||||
|
@ -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>
|
||||
|
@ -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 %}
|
||||
|
Reference in New Issue
Block a user