Images now in regular menus, added more
This commit is contained in:
parent
f193df94bd
commit
4bd02af8d5
|
@ -448,6 +448,11 @@ as it's used in every single page.
|
||||||
overlays_html is generated with all types for legacy reasons
|
overlays_html is generated with all types for legacy reasons
|
||||||
'''
|
'''
|
||||||
for overlay in overlays:
|
for overlay in overlays:
|
||||||
|
#image = None
|
||||||
|
|
||||||
|
#if 'image' in overlay:
|
||||||
|
# image = overlay['image']
|
||||||
|
|
||||||
link = (overlay['page_url'], overlay['name'])
|
link = (overlay['page_url'], overlay['name'])
|
||||||
|
|
||||||
overlays_html += [link]
|
overlays_html += [link]
|
||||||
|
@ -468,7 +473,7 @@ for overlay in overlays:
|
||||||
if o_class == 'board' and o_type not in overlay_subnav:
|
if o_class == 'board' and o_type not in overlay_subnav:
|
||||||
overlay_subnav.append(o_type)
|
overlay_subnav.append(o_type)
|
||||||
|
|
||||||
nav_html[o_class][o_type] += [link]
|
nav_html[o_class][o_type] += [overlay]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -499,8 +504,26 @@ overlay_subnav = ''.join(map(lambda overlay_type: '<li class="group_{cls}" data-
|
||||||
for overlay_type in nav_html.keys():
|
for overlay_type in nav_html.keys():
|
||||||
for overlay_group, items in nav_html[overlay_type].iteritems():
|
for overlay_group, items in nav_html[overlay_type].iteritems():
|
||||||
items.sort()
|
items.sort()
|
||||||
group_items = (''.join(map(lambda x: '<li><a href="{}{}">{}</a></li>'.format(base_url, x[0], x[1]), items)))
|
featured = [x for x in items if 'image' in x]
|
||||||
|
regular = [x for x in items if 'image' not in x]
|
||||||
|
|
||||||
|
group_items = ''
|
||||||
|
|
||||||
|
group_items_pictures = (''.join(map(lambda x: '<li class="featured"><a href="{base_url}{page_url}"><img src="{resource_url}boards/{image}" /><strong>{name}</strong><span>{description}</span></a></li>'.format(
|
||||||
|
image=x['image'],
|
||||||
|
name=x['name'],
|
||||||
|
page_url=x['page_url'],
|
||||||
|
base_url=base_url,
|
||||||
|
resource_url=resource_url,
|
||||||
|
description=x['description']), featured)))
|
||||||
|
|
||||||
|
group_items_normal = (''.join(map(lambda x: '<li><a href="{}{}">{}</a></li>'.format(base_url, x['page_url'], x['name']), regular)))
|
||||||
|
|
||||||
|
group_items = group_items_pictures + group_items_normal
|
||||||
|
|
||||||
|
if len(featured) > 0 and len(regular) > 0:
|
||||||
|
group_items = group_items_pictures + '<hr />' + group_items_normal
|
||||||
|
|
||||||
nav_html[overlay_type][overlay_group] = '<div class="group group_' + overlay_group + '"><ul>' + group_items + '</ul></div>'
|
nav_html[overlay_type][overlay_group] = '<div class="group group_' + overlay_group + '"><ul>' + group_items + '</ul></div>'
|
||||||
nav_html[overlay_type] = ''.join(nav_html[overlay_type].values())
|
nav_html[overlay_type] = ''.join(nav_html[overlay_type].values())
|
||||||
|
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 79 KiB |
Binary file not shown.
After Width: | Height: | Size: 70 KiB |
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
Binary file not shown.
After Width: | Height: | Size: 83 KiB |
|
@ -262,8 +262,15 @@ Drop down nav
|
||||||
#sections .featured a {
|
#sections .featured a {
|
||||||
background:none;
|
background:none;
|
||||||
}
|
}
|
||||||
|
#sections .boards hr {
|
||||||
|
clear:both;
|
||||||
|
border:none;
|
||||||
|
border-top:3px solid #D33682;
|
||||||
|
margin-bottom:5px;
|
||||||
|
background:none;
|
||||||
|
}
|
||||||
|
|
||||||
#sections .featured a:hover {
|
#sections .boards .featured a:hover {
|
||||||
background: #D33682;
|
background: #D33682;
|
||||||
}
|
}
|
||||||
#sections .featured strong {
|
#sections .featured strong {
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
class: board
|
class: board
|
||||||
type: lcd
|
type: lcd
|
||||||
name: Display-o-Tron HAT
|
name: Display-o-Tron HAT
|
||||||
|
image: 'display-o-tron-hat.png'
|
||||||
manufacturer: Pimoroni
|
manufacturer: Pimoroni
|
||||||
description: A 3-line character LCD with a 6-zone RGB backlight and 6 touch buttons
|
description: A 3-line character LCD with a 6-zone RGB backlight and 6 touch buttons
|
||||||
url: https://github.com/pimoroni/dot3k
|
url: https://github.com/pimoroni/dot3k
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
class: board
|
class: board
|
||||||
type: multi
|
type: multi
|
||||||
name: Explorer HAT Pro
|
name: Explorer HAT Pro
|
||||||
|
image: 'explorer-hat-pro.png'
|
||||||
manufacturer: Pimoroni
|
manufacturer: Pimoroni
|
||||||
description: An all-in-one light, input, motor, touch and output add-on board.
|
description: An all-in-one light, input, motor, touch and output add-on board.
|
||||||
url: https://github.com/pimoroni/explorer-hat
|
url: https://github.com/pimoroni/explorer-hat
|
||||||
|
|
|
@ -4,6 +4,7 @@ class: board
|
||||||
type: led
|
type: led
|
||||||
name: Scroll pHAT
|
name: Scroll pHAT
|
||||||
manufacturer: Pimoroni
|
manufacturer: Pimoroni
|
||||||
|
image: 'scroll-phat.png'
|
||||||
description: A 11 x 5 LED matrix.
|
description: A 11 x 5 LED matrix.
|
||||||
url: https://github.com/pimoroni/scroll-phat
|
url: https://github.com/pimoroni/scroll-phat
|
||||||
github: https://github.com/pimoroni/scroll-phat
|
github: https://github.com/pimoroni/scroll-phat
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
class: board
|
class: board
|
||||||
type: multi
|
type: multi
|
||||||
name: "Sense HAT"
|
name: "Sense HAT"
|
||||||
|
image: 'sense-hat.png'
|
||||||
manufacturer: Raspberry Pi Foundation
|
manufacturer: Raspberry Pi Foundation
|
||||||
description: Add-on board that includes an 8×8 RGB LED matrix, 5-button joystick as well as IMU and environmental sensors
|
description: Add-on board that includes an 8×8 RGB LED matrix, 5-button joystick as well as IMU and environmental sensors
|
||||||
url: https://www.raspberrypi.org/products/sense-hat/
|
url: https://www.raspberrypi.org/products/sense-hat/
|
||||||
|
|
Loading…
Reference in New Issue