diff --git a/public/styles.css b/public/styles.css index 3a0ae11..d13f59f 100644 --- a/public/styles.css +++ b/public/styles.css @@ -44,6 +44,18 @@ ul > li > a { color: #ff8585; } +.tableau ul:nth-child(odd) a.btn { + background-color: red; + border-color: red; + color: white; +} +.tableau ul:nth-child(even) a.btn { + background-color: white; + border-color: red; + color: red; +} + + img { height: 80px !important; transition: transform .1s; diff --git a/views/index.hbs b/views/index.hbs index a548979..1a6d8a9 100644 --- a/views/index.hbs +++ b/views/index.hbs @@ -40,7 +40,7 @@
  • {{this.prix}} €
  • {{#if this.acheteur}}{{this.acheteur}} - {{else}}Le réserver{{/if}} + {{else}}Le réserver{{/if}}
  • @@ -52,10 +52,14 @@
  • {{#if this.pourNoel}}Noël{{else}}Anniversaire{{/if}}
  • - {{#if this.emballe}} - + {{#if this.achete}} + {{#if this.emballe}} + + {{else}} + + {{/if}} {{else}} - +   {{/if}}
  • diff --git a/wishlist.js b/wishlist.js index 69fc12b..6bffb7d 100644 --- a/wishlist.js +++ b/wishlist.js @@ -48,7 +48,7 @@ hbs.registerHelper('equals', isEqual); app.get("/", (req, res) => { - db.query('SELECT c.id as "id", c.libelle as "libelle", c.prix, c.photo as "photo", c.lien, p.prenom as "acheteur", c.achete as "achete", c.paye as "paye", p2.prenom as "responsableAchat", c.pour_noel as "pourNoel", c.emballe as "emballe" FROM cadeau c LEFT OUTER JOIN participations pc on pc.cadeau = c.id LEFT OUTER JOIN participant p on p.id = pc.offrant LEFT OUTER JOIN participant p2 on p2.id = pc.responsable_achat ORDER BY c.prix', async (error, resultCadeaux) => { + db.query('SELECT c.id as "id", c.libelle as "libelle", c.prix, c.photo as "photo", c.lien, p.prenom as "acheteur", c.achete as "achete", c.paye as "paye", p2.prenom as "responsableAchat", c.pour_noel as "pourNoel", c.emballe as "emballe" FROM cadeau c LEFT OUTER JOIN participations pc on pc.cadeau = c.id LEFT OUTER JOIN participant p on p.id = pc.offrant LEFT OUTER JOIN participant p2 on p2.id = pc.responsable_achat ORDER BY c.pour_noel, c.prix', async (error, resultCadeaux) => { let message; if(error){