...
 
Commits (4)
......@@ -14,7 +14,7 @@ get dependencies:
script:
- nodejs -v
- npm -v
- npm install
- npm ci
- npx bower update --allow-root
cache:
paths:
......
FROM alpine
RUN apk add --no-cache openssl nginx
ENV DOCKERIZE_VERSION v0.6.0
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz
RUN echo "daemon off;" >> /etc/nginx/nginx.conf \
&& mkdir "/run/nginx"
EXPOSE 80
FROM registry.gitlab.techcultivation.org/morbidick/dockerize-nginx
ADD docs/nginx.template.conf /etc/nginx/conf.d/default.tmpl
COPY build /var/www/donate
ARG RELEASE_SHA
ARG RELEASE_NAME
ENV RELEASE_SHA $RELEASE_SHA
ENV RELEASE_NAME $RELEASE_NAME
CMD ["dockerize", "-template", "/etc/nginx/conf.d/default.tmpl:/etc/nginx/conf.d/default.conf", "-stdout", "/var/log/nginx/access.log", "-stderr", "/var/log/nginx/error.log", "-poll", "nginx"]
......@@ -52,21 +52,21 @@ server {
location / {
# send request to prerender service
if ($prerender = 1) {
proxy_pass $rendertron$scheme://$host$request_uri?wc-inject-shadydom=true;
proxy_pass $rendertron{{ default .Env.FRONTEND_URI "$scheme://$host" }}$request_uri?wc-inject-shadydom=true;
}
# set version header for debugging purposes
add_header X-Version $version;
# preconnect to api to save dns lookup and tls handshake time
add_header Link "<{{ .Env.API_URL }}>; rel=preconnect; crossorigin";
add_header Link "<{{ default .Env.API_URL "https://sandbox.api.sangha.techcultivation.org/v1" }}>; rel=preconnect; crossorigin";
try_files $uri /index.html;
# dynamic config via docker environment
sub_filter_once off;
sub_filter "release_sha" "{{ .Env.RELEASE_SHA }}";
sub_filter "release_name" "{{ .Env.RELEASE_NAME }}";
sub_filter "release_dev" "{{ .Env.RELEASE_NAME }}";
{{ if .Env.API_URL }}
sub_filter "https://sandbox.api.sangha.techcultivation.org/v1" "{{ .Env.API_URL }}";
{{ end }}
......@@ -79,5 +79,8 @@ server {
{{ if .Env.NAVBAR_SIMPLE }}
sub_filter "&quot;navbar_full&quot;" "false";
{{ end }}
{{ if .Env.CART_DISABLED }}
sub_filter "&quot;cart_available&quot;" "false";
{{ end }}
}
}
......@@ -42,7 +42,7 @@
script.src = "/bower_components/raven-js/dist/raven.min.js";
script.onload = () => {
Raven.config(sentry_dsn, {
release: "release_name",
release: "release_dev",
tags: {git_commit: "release_sha"}
}).install();
};
......@@ -109,7 +109,7 @@
</noscript>
</head>
<body>
<sangha-app settings='{"api_url": "https://sandbox.api.sangha.techcultivation.org/v1","navbar": "navbar_full"}'>
<sangha-app settings='{"api_url": "https://sandbox.api.sangha.techcultivation.org/v1","navbar": "navbar_full", "cart_available": "global_cart"}'>
<div class="loading jsonly">
<svg class="spinner" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40">
<path opacity=".2" fill="currentColor" d="M20.2 5.17c-8.25 0-14.94 6.7-14.94 14.95s6.7 14.94 14.94 14.94 14.95-6.7 14.95-14.95c0-8.2-6.7-14.9-14.95-14.9zm0 26.58c-6.42 0-11.63-5.2-11.63-11.64 0-6.4 5.2-11.6 11.63-11.6 6.43 0 11.63 5.2 11.63 11.65S26.63 31.8 20.2 31.8z"/>
......
......@@ -140,7 +140,7 @@
<!-- Nav on desktop: tabs -->
<paper-tabs selected="{{ selected }}" attr-for-selected="path" bottom-item hidden$="{{ !wideLayout }}">
<template is="dom-repeat" items="{{ navigation }}">
<paper-tab path$="[[ item.path ]]">
<paper-tab path$="[[ item.path ]]" hidden="[[ item.hidden ]]">
<a href="[[ routePrefix ]]/[[ item.path ]]/" tabindex="-1">
[[ item.title ]]
</a>
......
......@@ -110,7 +110,7 @@
<sangha-markdown-content class="container" view="faq" content="faq.md"></sangha-markdown-content>
<sangha-markdown-content class="container" view="how-it-works" content="how-it-works.md"></sangha-markdown-content>
<sangha-checkout view="checkout" data-path="views/sangha-checkout.html" settings="[[ sanghaSettings ]]"></sangha-checkout>
<sangha-projects view="projects" data-path="views/sangha-projects.html" route="{{ subroute }}" settings="[[ sanghaSettings ]]"></sangha-projects>
<sangha-projects view="projects" data-path="views/sangha-projects.html" route="{{ subroute }}" settings="[[ sanghaSettings ]]" cart-available="[[ settings.cart_available ]]"></sangha-projects>
<sangha-404 view="404" data-path="views/sangha-404.html" route="[[ route ]]"></sangha-404>
</iron-lazy-pages>
......@@ -160,23 +160,7 @@
},
navigation: {
type: Array,
value: () => {
return [
{
path: "how-it-works",
title: "How it works",
}, {
path: "projects",
title: "Discover Projects",
}, {
path: "faq",
title: "FAQ",
}, {
path: "checkout",
title: "Checkout",
icon: "shopping-cart",
}];
},
computed: "_navigation(settings)",
},
};
}
......@@ -193,6 +177,24 @@
Polymer.setPassiveTouchGestures(true);
}
_navigation(settings) {
return [{
path: "how-it-works",
title: "How it works",
}, {
path: "projects",
title: "Discover Projects",
}, {
path: "faq",
title: "FAQ",
}, {
path: "checkout",
title: "Checkout",
icon: "shopping-cart",
hidden: !settings.cart_available,
}];
}
_updateView(view) {
this.view = view || "home";
}
......
......@@ -86,6 +86,9 @@
@apply --shadow-elevation-2dp;
padding: 1em;
}
sangha-material-checkout.highlight {
@apply --shadow-elevation-8dp;
}
.bottom-buttons {
margin: 3em 0 2em;
}
......@@ -172,7 +175,7 @@
return {
project: {
type: Object,
observer: "updateMetadata",
observer: "updateHandler",
},
baseUrl: {
type: String,
......@@ -195,7 +198,7 @@
];
}
updateMetadata(project) {
updateHandler(project) {
this.dispatchEvent(new CustomEvent('sangha-metadata', {
detail: {
title: project.name,
......@@ -205,6 +208,10 @@
bubbles: true,
composed: true,
}));
if (window.location.hash.slice(1) === "donate") {
window.setTimeout(this._scrollToDonationForm.bind(this), 300);
}
}
_cartItems(project) {
......@@ -217,7 +224,14 @@
}
_scrollToDonationForm() {
this.$.donate.scrollIntoView({behavior: "smooth", block: "start", inline: "start"});
const form = this.$.donate;
form.scrollIntoView({behavior: "smooth", block: "start", inline: "start"});
setTimeout(() => {
form.classList.add("highlight");
}, 200);
setTimeout(() => {
form.classList.remove("highlight");
}, 2000);
}
addToCart(event) {
......
......@@ -41,7 +41,7 @@
<sangha-top-projects
view="list"
cart-available
cart-available="[[ cartAvailable ]]"
data-path="../../bower_components/sangha-embed/sangha-top-projects.html"
base-url="."
limit="0"
......@@ -79,6 +79,11 @@
settings: {
type: Object,
},
cartAvailable: {
type: Boolean,
value: false,
reflectToAttribute: true,
},
};
}
......