Show More
@@ -24,7 +24,3 b' class Tripcode:' | |||||
24 | def get_full_text(self): |
|
24 | def get_full_text(self): | |
25 | return self.tripcode |
|
25 | return self.tripcode | |
26 |
|
26 | |||
27 | def get_view(self): |
|
|||
28 | return '<span class="tripcode" title="{title}" style="border: solid 2px #{color}; border-left: solid 1ex #{color};">{text}</span>'\ |
|
|||
29 | .format(title=self.get_full_text(), color=self.get_color(), |
|
|||
30 | text=self.get_short_text()) |
|
@@ -30,14 +30,14 b' class AbstractViewer:' | |||||
30 | def get_view(self): |
|
30 | def get_view(self): | |
31 | return '<div class="image">'\ |
|
31 | return '<div class="image">'\ | |
32 | '{}'\ |
|
32 | '{}'\ | |
33 | '<div class="image-metadata">{}, {}</div>'\ |
|
33 | '<div class="image-metadata"><a href="{}" download >{}, {}</a></div>'\ | |
34 | '</div>'.format(self.get_format_view(), |
|
34 | '</div>'.format(self.get_format_view(), self.file.url, | |
35 | self.file_type, filesizeformat(self.file.size)) |
|
35 | self.file_type, filesizeformat(self.file.size)) | |
36 |
|
36 | |||
37 | def get_format_view(self): |
|
37 | def get_format_view(self): | |
38 | return '<a href="{}">'\ |
|
38 | return '<a href="{}">'\ | |
39 | '<img src="{}" width="200" height="150"/>'\ |
|
39 | '<img src="{}" width="200" height="150"/>'\ | |
40 | '</a>'.format(self.file.url,static(FILE_STUB_IMAGE)) |
|
40 | '</a>'.format(self.file.url, static(FILE_STUB_IMAGE)) | |
41 |
|
41 | |||
42 |
|
42 | |||
43 | class VideoViewer(AbstractViewer): |
|
43 | class VideoViewer(AbstractViewer): |
@@ -99,7 +99,9 b' class PostImage(models.Model, Viewable):' | |||||
99 | ' data-width="{}"' \ |
|
99 | ' data-width="{}"' \ | |
100 | ' data-height="{}" />' \ |
|
100 | ' data-height="{}" />' \ | |
101 | '</a>' \ |
|
101 | '</a>' \ | |
102 |
'<div class="image-metadata"> |
|
102 | '<div class="image-metadata">'\ | |
|
103 | '<a href="{full}" download>{image_meta}</a>'\ | |||
|
104 | '</div>' \ | |||
103 | '</div>'\ |
|
105 | '</div>'\ | |
104 | .format(CSS_CLASS_IMAGE, CSS_CLASS_THUMB, |
|
106 | .format(CSS_CLASS_IMAGE, CSS_CLASS_THUMB, | |
105 | self.image.url_200x150, |
|
107 | self.image.url_200x150, |
General Comments 0
You need to be logged in to leave comments.
Login now