update logo and image links to be dynamicly added instead with a manual written link

This commit is contained in:
Daniel Van Camp 2015-12-14 21:44:32 +01:00
parent 3c7ddf8df1
commit 338cfb3fc9

View file

@ -1,25 +1,24 @@
extends ./layout extends ./layout
// Merchandise page : when adding a merchandise make sure to add following resources // Merchandise page : when adding a merchandise make sure to add following resources
+ image of merchandise -- eg. teespring.png + image of merchandise -- MERCHANT.KEY.png -- eg. teespring.png
+ logo of merchant -- eg. teespring-logo.png + logo of merchant -- MERCHANT.KEY-logo.png -- eg. teespring-logo.png
+ update merch.json with extra info about merchandise + update merch.json with extra info about merchandise
- merch-MERCHANT.KEY-summary -- eg. merch-teespring-summary -> Teespring is and will always be... - merch-MERCHANT.KEY-summary -- eg. merch-teespring-summary -> Teespring is and will always be...
- merch-MERCHANT.KEY-goto -- eg. merch-teespring-goto -> Get myself a Habitica T-Shirts - merch-MERCHANT.KEY-goto -- eg. merch-teespring-goto -> Get myself a Habitica T-Shirts
+ update this page with an extra merchant (var merchants) + update this page with an extra merchant (var merchants)
- key (used in locale files) - key (used in locale files)
- logo (do we have a logo for this merchant, true || false)
- name (if no logo, this will be shown instead) - name (if no logo, this will be shown instead)
- link - link
- image eg. -> merchants.push({key: 'teespring', logo: true, name: 'Teespring', link: 'https://teespring.com/habitica-gryphon-t-shirt'})
- logo (if non provided, name will be shown)
eg. -> merchants.push({key: 'teespring', name: 'Teespring', link: 'https://teespring.com/habitica-gryphon-t-shirt', image: 'teespring.png', logo: 'teespring-logo.png'})
block vars block vars
- var layoutEnv = env - var layoutEnv = env
- var merchants = [] - var merchants = []
- merchants.push({key: 'teespring', name: 'Teespring', link: 'https://teespring.com/habitica-gryphon-t-shirt', image: 'teespring.png', logo: 'teespring-logo.png'}) - merchants.push({key: 'teespring', logo: true, name: 'Teespring', link: 'https://teespring.com/habitica-gryphon-t-shirt'})
- merchants.push({key: 'stickermule', name: 'Stickermule', link: 'https://www.stickermule.com/uk/marketplace/9317-habitica-gryphon-sticker', image: 'stickermule.png', logo: 'stickermule-logo.png'}) - merchants.push({key: 'stickermule', logo: true, name: 'Stickermule', link: 'https://www.stickermule.com/uk/marketplace/9317-habitica-gryphon-sticker'})
block title block title
title=env.t('merch') title=env.t('merch')
@ -38,10 +37,10 @@ block content
.col-lg-6.col-md-6.col-sm-12 .col-lg-6.col-md-6.col-sm-12
.merch-block .merch-block
if merchant.logo if merchant.logo
img(src="/merch/" + "#{merchant.logo}") img(src="/merch/" + "#{merchant.key}" + "-logo.png")
else else
h3=merchant.name h3=merchant.name
div: a(href="#{merchant.link}" target='_blank'): img.img-rendering-auto(src="/merch/" + "#{merchant.image}") div: a(href="#{merchant.link}" target='_blank'): img.img-rendering-auto(src="/merch/" + "#{merchant.key}" + ".png")
p=env.t('merch-' + merchant.key + '-summary') p=env.t('merch-' + merchant.key + '-summary')
a.btn(href="#{merchant.link}" target='_blank')=env.t('merch-' + merchant.key + '-goto') a.btn(href="#{merchant.link}" target='_blank')=env.t('merch-' + merchant.key + '-goto')
// Merchandise block - END // Merchandise block - END