Skip to content

Commit

Permalink
Added medical offer
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaudin committed Nov 1, 2024
1 parent 1f2a7f7 commit b4b0ee9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
11 changes: 10 additions & 1 deletion scheduler/src/routes/stripe.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"product_wikipedia": "Wikipedia Hotspot English",
"product_ted": "TED Hotspot",
"product_preppers": "Preppers Hotspot",
"product_medical": "Medical Hotspot",
"product_computer": "Computer Hotspot",
"product_access_1m": "One month Imager Access",
"product_access_1y": "Annual Imager Access",
Expand All @@ -44,6 +45,7 @@
"product_wikipedia": "Wikipedia Hotspot auf Deutsch",
"product_ted": "TED Hotspot",
"product_preppers": "Preppers Hotspot",
"product_medical": "Medical Hotspot",
"product_computer": "Computer Hotspot",
"product_access_1m": "One month Imager Access",
"product_access_1y": "Annual Imager Access",
Expand All @@ -52,6 +54,7 @@
"product_wikipedia": "Wikipedia Hotspot en español",
"product_ted": "TED Hotspot",
"product_preppers": "Preppers Hotspot",
"product_medical": "Medical Hotspot",
"product_computer": "Computer Hotspot",
"product_access_1m": "One month Imager Access",
"product_access_1y": "Annual Imager Access",
Expand All @@ -60,6 +63,7 @@
"product_wikipedia": "Wikipedia Hotspot Français",
"product_ted": "TED Hotspot",
"product_preppers": "Preppers Hotspot",
"product_medical": "Medical Hotspot",
"product_computer": "Computer Hotspot",
"product_access_1m": "Accès Imager 1 mois",
"product_access_1y": "Accès Imager annuel",
Expand Down Expand Up @@ -274,6 +278,11 @@ def handle_access_order(session, customer):
os.getenv("STRIPE_PRICE_PP"),
handle_image_order,
),
"medical": (
os.getenv("STRIPE_METHOD_MD"),
os.getenv("STRIPE_PRICE_MD"),
handle_image_order,
),
"ted": (
os.getenv("STRIPE_METHOD_TED"),
os.getenv("STRIPE_PRICE_TED"),
Expand Down Expand Up @@ -428,7 +437,7 @@ def success():

context = {"customer": customer, "session": session, "shop_url": SHOP_PUBLIC_URL}
product = session.metadata.get("product")
if product.startswith("wikipedia-") or product in ("preppers", "computer", "ted"):
if product.startswith("wikipedia-") or product in ("preppers", "computer", "ted", "medical"):
kind = "image"
http_url, torrent_url, _ = get_links_for(product)
context.update({"http_url": http_url, "torrent_url": torrent_url})
Expand Down
23 changes: 23 additions & 0 deletions scheduler/src/templates/stripe/shop.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
}

.offer:last-child { border: 1px solid #bebebe !important; }

.offer:hover { background-color:rgba(0,0,0,.05) }

.offer.splitter {
Expand Down Expand Up @@ -309,6 +310,28 @@ <h2>Computer package</h2>

<div class="table-offer">

<div class="offer">
<header>
<h2>Medical package</h2>
<p>Needed everywhere</p>
</header>
<section class="price"><span class="amount">$25</span></section>
<section class="description">
<ul>
<li>Emergency and Military Medicine</li>
<li>Traveler's Health</li>
<li>Common drugs</li>
<li>General medicine, and more!</li>
<li>Requires a 64GB microSD card. See demo <a target="_blank" href="https://medical.demo.hotspot.kiwix.org/">here</a>.</li>
</ul>
</section>
<form class="button-holder">
<input type="hidden" name="product" value="medical">
<button class="btn btn-outline-secondary">Purchase</button>
<div class="loader"><i class="spinner-border spinner-border-xl" role="status"></i></div>
</form>
</div>

<div class="offer">
<header>
<h2>Preppers package</h2>
Expand Down

0 comments on commit b4b0ee9

Please sign in to comment.