Commit 8f379852 authored by Romain Bignon's avatar Romain Bignon

display pretty names under thumbnails

parent 643f75de
......@@ -18,6 +18,7 @@
# along with ass2m. If not, see <http://www.gnu.org/licenses/>.
import re
import os
import posixpath
import hashlib
......@@ -163,6 +164,13 @@ class File(IObject):
def get_name(self):
return posixpath.basename(self.path)
def get_pretty_name(self):
name = self.get_name().replace('_', ' ')
m = re.match('(.*)\.(\w{1,4})', name)
if m:
name = m.group(1)
return name
def get_mimetype(self):
if self.mimetype:
return self.mimetype
......
......@@ -15,7 +15,7 @@
<figure>
<span class="frame"><img class="thumbnail photo" src="${URL(thumb.get_name()).setvars(view='thumbnail', thumb_size=200) | n,U,h}" /></span>
<figcaption>
<span class="fn">${thumb.get_name() | h}</span>
<span class="fn">${thumb.get_pretty_name() | h}</span>
</figcaption>
</figure>
</a>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment