Show path on device in the book details panel in the device view

This commit is contained in:
Kovid Goyal 2012-09-12 10:57:13 +05:30
parent 378d13d041
commit b4772cf038

View File

@ -152,8 +152,16 @@ def render_data(mi, use_roman_numbers=True, all_fields=False):
scheme = u'devpath' if isdevice else u'path' scheme = u'devpath' if isdevice else u'path'
url = prepare_string_for_xml(path if isdevice else url = prepare_string_for_xml(path if isdevice else
unicode(mi.id), True) unicode(mi.id), True)
link = u'<a href="%s:%s" title="%s">%s</a>' % (scheme, url, pathstr = _('Click to open')
prepare_string_for_xml(path, True), _('Click to open')) extra = ''
if isdevice:
durl = url
if durl.startswith('mtp:::'):
durl = ':::'.join( (durl.split(':::'))[2:] )
extra = '<br><span style="font-size:smaller">%s</span>'%(
prepare_string_for_xml(durl))
link = u'<a href="%s:%s" title="%s">%s</a>%s' % (scheme, url,
prepare_string_for_xml(path, True), pathstr, extra)
ans.append((field, u'<td class="title">%s</td><td>%s</td>'%(name, link))) ans.append((field, u'<td class="title">%s</td><td>%s</td>'%(name, link)))
elif field == 'formats': elif field == 'formats':
if isdevice: continue if isdevice: continue