more fixes
This commit is contained in:
parent
e686f0d57e
commit
31a12185f6
@ -18,7 +18,7 @@ class Attachment(models.Model):
|
|||||||
|
|
||||||
def path(self):
|
def path(self):
|
||||||
ext = self.filename.split('.')[-1]
|
ext = self.filename.split('.')[-1]
|
||||||
return '{}{}'.format(self.filehash, ext)
|
return '{}.{}'.format(self.filehash, ext)
|
||||||
|
|
||||||
def thumb(self):
|
def thumb(self):
|
||||||
return '/media/thumb-{}.jpg'.format(self.path())
|
return '/media/thumb-{}.jpg'.format(self.path())
|
||||||
@ -66,7 +66,7 @@ class Post(models.Model):
|
|||||||
rpls = self.get_all_replies()
|
rpls = self.get_all_replies()
|
||||||
l = len(rpls)
|
l = len(rpls)
|
||||||
if l > truncate:
|
if l > truncate:
|
||||||
rpls = rpls[(l+1)-truncate:l-1]
|
rpls = rpls[l-truncate:]
|
||||||
return rpls
|
return rpls
|
||||||
|
|
||||||
def is_op(self):
|
def is_op(self):
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
<div class="attachments">
|
<div class="attachments">
|
||||||
{% for a in op.attachments.all %}
|
{% for a in op.attachments.all %}
|
||||||
<img src="{{a.thumb}}"></img>
|
<a href="{{a.source}}"><img class="thumb" src="{{a.thumb}}"></img></a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
<pre class="postbody">{{op.message|memepost}}</pre>
|
<pre class="postbody">{{op.message|memepost}}</pre>
|
||||||
@ -31,7 +31,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="attachments">
|
<div class="attachments">
|
||||||
{% for a in reply.attachments.all %}
|
{% for a in reply.attachments.all %}
|
||||||
<img src="{{a.thumb}}"></img>
|
<a href="{{a.source}}"><img class="thumb" src="{{a.thumb}}"></img></a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
<pre class="postbody">{{reply.message|memepost}}</pre>
|
<pre class="postbody">{{reply.message|memepost}}</pre>
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<div class="attachments">
|
<div class="attachments">
|
||||||
{% for a in op.attachments.all %}
|
{% 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 %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
<pre class="postbody">{{op.message|memepost}}</pre>
|
<pre class="postbody">{{op.message|memepost}}</pre>
|
||||||
@ -28,7 +28,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="attachments">
|
<div class="attachments">
|
||||||
{% for a in reply.attachments.all %}
|
{% 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 %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% autoescape off %}
|
{% autoescape off %}
|
||||||
|
Reference in New Issue
Block a user