commiting
This commit is contained in:
6
all_paw_care/content/pages/services/cards/__init__.py
Normal file
6
all_paw_care/content/pages/services/cards/__init__.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from all_paw_care.content.pages.services.cards.drop_ins import drop_ins
|
||||
from all_paw_care.content.pages.services.cards.house_sitting import house_sitting
|
||||
from all_paw_care.content.pages.services.cards.walking import walking
|
||||
|
||||
primary_services = [drop_ins, house_sitting, walking]
|
||||
|
||||
37
all_paw_care/content/pages/services/cards/card.py
Normal file
37
all_paw_care/content/pages/services/cards/card.py
Normal file
@@ -0,0 +1,37 @@
|
||||
from markdown import markdown
|
||||
import frontmatter
|
||||
|
||||
import os
|
||||
|
||||
class Card(object):
|
||||
def __init__(self, card_file: str):
|
||||
metadata = frontmatter.load(card_file).metadata
|
||||
self.service_type = metadata['type']
|
||||
self.title = metadata['title']
|
||||
self.images = self._get_image_list(
|
||||
metadata['image-dir'], metadata['images'])
|
||||
self.price = metadata['price']
|
||||
self.included = metadata['included']
|
||||
|
||||
def _get_image_list(self, base_dir: str, images: list):
|
||||
image_list = list()
|
||||
for img in images:
|
||||
image_list.append(os.path.join(base_dir, img))
|
||||
|
||||
return image_list
|
||||
|
||||
def get_title(self):
|
||||
return self.title
|
||||
|
||||
def get_price(self):
|
||||
return self.price
|
||||
|
||||
def get_included(self):
|
||||
return self.included
|
||||
|
||||
def get_images(self):
|
||||
return self.images
|
||||
|
||||
def get_default_image(self):
|
||||
return self.images[1]
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
from all_paw_care.content.pages.services.cards.card import Card
|
||||
|
||||
import os
|
||||
|
||||
__markdown_file = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'drop-ins.md')
|
||||
|
||||
drop_ins = Card(__markdown_file)
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
type: primary
|
||||
title: Drop-ins
|
||||
image-dir: img/services
|
||||
images:
|
||||
- drop_in_card_sm.png
|
||||
- drop_in_card_md.png
|
||||
- drop_in_card_lg.png
|
||||
- drop_in_card_xl.png
|
||||
- drop_in_card_xxl.png
|
||||
price: $20/visit
|
||||
included:
|
||||
- 30 minute at home visit
|
||||
- Bags for poop clean-up
|
||||
---
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
from all_paw_care.content.pages.services.cards.card import Card
|
||||
|
||||
import os
|
||||
|
||||
__markdown_file = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'house-sitting.md')
|
||||
|
||||
house_sitting = Card(__markdown_file)
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
type: primary
|
||||
title: House sitting
|
||||
image-dir: img/services
|
||||
images:
|
||||
- house_sitting_card_sm.png
|
||||
- house_sitting_card_md.png
|
||||
- house_sitting_card_lg.png
|
||||
- house_sitting_card_xl.png
|
||||
- house_sitting_card_xxl.png
|
||||
price: $38/night
|
||||
included:
|
||||
- Animal care
|
||||
- At home overnight stays
|
||||
- Bags for poop clean-up
|
||||
---
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
from all_paw_care.content.pages.services.cards.card import Card
|
||||
|
||||
from markdown import markdown
|
||||
import frontmatter
|
||||
|
||||
import os
|
||||
|
||||
__markdown_file = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'walking.md')
|
||||
|
||||
walking = Card(__markdown_file)
|
||||
|
||||
16
all_paw_care/content/pages/services/cards/walking/walking.md
Normal file
16
all_paw_care/content/pages/services/cards/walking/walking.md
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
type: primary
|
||||
title: Walking
|
||||
image-dir: img/services
|
||||
images:
|
||||
- dog_walking_card_sm.png
|
||||
- dog_walking_card_md.png
|
||||
- dog_walking_card_lg.png
|
||||
- dog_walking_card_xl.png
|
||||
- dog_walking_card_xxl.png
|
||||
price: $20/visit
|
||||
included:
|
||||
- 30 minute walk
|
||||
- Bags for poop clean-up
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user