Skip to content

Commit

Permalink
Thanks redirect (#274)
Browse files Browse the repository at this point in the history
* template var for carpool site

* local dev config

* cp_site file

* support for thanks redirect
  • Loading branch information
jkbits1 authored and richardwestenra committed May 8, 2017
1 parent 69eea1e commit b1ada4b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
3 changes: 2 additions & 1 deletion _config-dev.yml
@@ -1 +1,2 @@
api: "https://api.carpoolvote.com/test"
api: "https://api.carpoolvote.com/test"
cp_site: "http://richardwestenra.com/voteamerica.github.io"
2 changes: 2 additions & 0 deletions _config-local.yml
@@ -0,0 +1,2 @@
api: "http://localhost:8000"
cp_site: "http://localhost:4000"
3 changes: 2 additions & 1 deletion _config.yml
Expand Up @@ -7,4 +7,5 @@ highlighter: rouge
permalink: :title/
relative_permalinks: false

api: "https://api.carpoolvote.com/live"
api: "https://api.carpoolvote.com/live"
cp_site: "http://carpoolvote.com"
7 changes: 7 additions & 0 deletions _includes/cp_site.html
@@ -0,0 +1,7 @@
{% comment %}
Change the carpool site url to the value defined in the relevant config file
{% endcomment %}
{% assign cp_site = site.cp_site %}
{% if site.github.owner_name == 'richardwestenra' %}
{% assign cp_site = 'http://richardwestenra.com/voteamerica.github.io' %}
{% endif %}
5 changes: 3 additions & 2 deletions pages/index.html
Expand Up @@ -7,6 +7,7 @@
---

{% include api.html %}
{% include cp_site.html %}

<noscript>
<style>
Expand Down Expand Up @@ -52,7 +53,7 @@ <h2 class="ride__title">Drivers</h2>

<div id="forms" class="forms wrapper offset-top">
<form id="need-ride" name="needRide" action="{{ api }}/rider" method="post" class="ride-form" aria-hidden="true">
<input type="hidden" name="_redirect" class="redirect" value="http://carpoolvote.com/thanks-rider/?type=rider" />
<input type="hidden" name="_redirect" class="redirect" value="{{ cp_site }}/thanks-rider/?type=rider" />
<div class="bannerbox">
<h2 class="bannerbox__title">I need a ride</h2>
<div class="bannerbox__content">
Expand Down Expand Up @@ -195,7 +196,7 @@ <h3>Dates available</h3>
</form>

<form id="offer-ride" name="offerRide" action="{{ api }}/driver" method="post" class="ride-form" aria-hidden="true">
<input type="hidden" name="_redirect" class="redirect" value="http://carpoolvote.com/thanks-driver/?type=driver" />
<input type="hidden" name="_redirect" class="redirect" value="{{ cp_site }}/thanks-driver/?type=driver" />
<div class="bannerbox">
<h2 class="bannerbox__title">I can offer a ride</h2>
<div class="bannerbox__content">
Expand Down

0 comments on commit b1ada4b

Please sign in to comment.