Merge branch 'master' of gitlab.com:xpub/xpub2017

master
Michael Murtaugh 8 years ago
commit b288f6a2f6

@ -56,7 +56,9 @@ class tiles_wrapper (object):
else: else:
# autotext is a link to the url showing the basename # autotext is a link to the url showing the basename
_, basename = os.path.split(self.url) _, basename = os.path.split(self.url)
node['text'] = u"<a href=\"{0}\">{1}</a>".format(self.url, basename) base, ext = os.path.splitext(basename)
ext = ext[1:]
node['text'] = u"<p class=\"caption\"><a class=\"url\" href=\"{0}\">{1}</a>".format(self.url, ext.upper())
node['url'] = self.url node['url'] = self.url
node['image'] = self.get_tile_path(0, 0, 0) node['image'] = self.get_tile_path(0, 0, 0)
return node return node

@ -180,7 +180,7 @@ def render_article (wiki, ref, basepath="tiles", depth=0, maxdepth=3, tilewidth=
cells.extend(images) cells.extend(images)
ret = recursiverender(cells, basename, tilewidth=tilewidth, tileheight=tileheight) ret = recursiverender(cells, basename, tilewidth=tilewidth, tileheight=tileheight)
ret['text'] = u"""<p class="caption"><span class="text">{0}</span><a class="url" href="{1}">WIKI</a></p>""".format(title, ref) ret['text'] = u"""<p class="caption"><a class="url" href="{1}">{0}</a></p>""".format(title, ref)
if images: if images:
ret['image'] = images[0]['image'] ret['image'] = images[0]['image']
return ret return ret
@ -220,7 +220,7 @@ def render_category (wiki, cat, output="tiles", tilewidth=256, tileheight=256):
pages.sort(key=lambda x: x.name) pages.sort(key=lambda x: x.name)
pagenodes = [render_article(wiki, x.name, tilewidth=tilewidth, tileheight=tileheight) for x in pages] pagenodes = [render_article(wiki, x.name, tilewidth=tilewidth, tileheight=tileheight) for x in pages]
for page, node in zip(pages, pagenodes): for page, node in zip(pages, pagenodes):
node['text'] = u"""<p class="caption"><span class="text">{0}</span><a class="url" href="{1}">WIKI</a></p>""".format(page.name, wiki_title_to_url(wiki, page.name)) node['text'] = u"""<p class="caption"><a class="url" href="{1}">{0}</a></p>""".format(page.name, wiki_title_to_url(wiki, page.name))
ret = gridrender(pagenodes, output+"/"+cat.name.replace(":", "_"), tilewidth=tilewidth, tileheight=tileheight) ret = gridrender(pagenodes, output+"/"+cat.name.replace(":", "_"), tilewidth=tilewidth, tileheight=tileheight)
ret['text'] = u"""<p class="caption"><a class="url" href="{0}">{1}</a></p>""".format(wiki_title_to_url(wiki, cat.name), cat.name) ret['text'] = u"""<p class="caption"><a class="url" href="{0}">{1}</a></p>""".format(wiki_title_to_url(wiki, cat.name), cat.name)
return ret return ret

@ -42,17 +42,18 @@ div.tile div.text {
} }
div.tile div.text p { div.tile div.text p {
font-size: 12px; font-size: 12px;
/*color: #f2eee8;*/ color: #f2eee8;
/*background: #dd2e47;*/ background: #dd2e47;
margin: 0; margin: 0;
line-height: 12px; line-height: 12px;
padding-left: 10px; /*padding-left: 10px;*/
/*hyphens: auto;*/ /*hyphens: auto;*/
} }
div.tile div.text a { div.tile div.text a {
margin: 0; margin: 0;
text-decoration: none; text-decoration: none;
color: #dd2e47; color: #f2eee8;
/*color: black;*/
} }
div.tile div.text a:hover {} div.tile div.text a:hover {}
div.coords { div.coords {
@ -65,14 +66,16 @@ div.coords {
p.caption {} p.caption {}
p.caption span.text { p.caption span.text {
/*background: #444;*/ /*background: #444;*/
padding-right: 8px;
display: block;
} }
p.caption span.date { p.caption span.date {
padding-left: 8px; padding-right: 8px;
/*background: #444;*/ /*background: #444;*/
/*color: #AAA;*/ /*color: #AAA;*/
} }
p.caption a.url { p.caption a.url {
padding-left: 8px; margin-left: 8px;
/*color: #FF0;*/ /*color: #FF0;*/
} }
p.caption a.url:hover { p.caption a.url:hover {

Loading…
Cancel
Save