Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add form to accept donations #935

Open
wants to merge 4 commits into
base: stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion python_env_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo 'activating env: pb_env'
source activate pb_env

echo 'installing conda packages'
conda install -c ospc -c anaconda --file conda-requirements.txt --yes
conda install -c ospc -c defaults --file conda-requirements.txt --yes


echo 'pip installing remaining requirements'
Expand Down
105 changes: 105 additions & 0 deletions templates/pages/donate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{% extends 'pages/home.html' %}

{% load staticfiles %}

{% load flatblocks %}

{% block content %}

<div class="wrapper">
<div class="container">

<div class="page-header">
<h1 class="text-center">Donate</h1>
</div>

<div>
<script src='https://widgets.kimbia.com/widgets/form.js?channel=aei/ospc'></script>
</div>

<section class="join join-complete" id="join-mailinglist">
<h2>Join the community</h2>
<div class="input-container">
<div class="input-group">
` <form action="{% url 'about' %}" method="post">{% csrf_token %}
<span class="input-group-btn">
{{ email_form.email }}
{{ email_form.email.errors }}
<input type="submit" class="btn btn-join" value="Sign Up"/>
</span>
</form>
</div>
</div>
<div class="join-info">
Welcome to the community!
</div>
</section>

</div> <!-- container -->

{% comment %}
<!-- https://github.com/OpenSourcePolicyCenter/webapp-public/issues/56 -->
<div class="section-header">
<h2>What People Are Saying</h2>
</div>

<section class="news-items">
<div class="container">
<p class="text-right"><a href="#" class="see-all">See all news</a></p>
<div class="row">
<div class="col-sm-6">
<div class="news-item tagged">
<h4><a href="#">Praesent commodo cursus magna, vel scelerisque nisl consectetur et.</a></h4>
<p>Vestibulum id ligula porta felis euismod semper. Curabitur blandit tempus porttitor.</p>
</div>
</div>
<div class="col-sm-6">
<div class="news-item tagged">
<h4><a href="#">Sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</a></h4>
<p>Vestibulum id ligula porta felis euismod semper. Curabitur blandit tempus porttitor.</p>
</div>
</div>
</div>
</div>
</section>

{% endcomment %}

<div class="container">
<section class="sponsor-info">
<h2>Our Sponsor</h2>
<div>
<img src="{% static 'images/logo-aei.png' %}" alt="AEI" class="img-responsive">
</div>
</section>
<section class="contact-info">
<ul class="contact-social">
<li class="contact-twitter"><a href="https://twitter.com/PolicyBrains">Post link on Twitter</a></li>
<li class="contact-facebook"><a href="#">Share on Facebook</a></li>
<li class="contact-linkedin"><a href="#">Discuss on LinkedIn</a></li>
</ul>
<div class="contact-info-break"></div>
<div class="row">
<div class="col-sm-5 col-sm-offset-5">
<h3>MATT JENSEN</h3>
<p>+1 202 862 5941</p>
<p>matt.jensen@aei.org</p>
</div>
<!--
<div class="col-sm-5">
<h3>PERSON NAME, PH.D.</h3>
<p>+1 555 555-3333 voice<br>
hello@mediacontactinfo.us</p>
<p>Company name PR<br>
1000 N Streetname Ave Suite 34<br>
Washington, DC 10000</p>
</div>
-->
</div>
</section>
</div>


<div class="push"></div>
</div> <!-- /wrapper -->
{% endblock %}
4 changes: 3 additions & 1 deletion webapp/apps/pages/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

from .views import (homepage, aboutpage, newspage, gallerypage, hellopage,
embedpage, widgetpage, newsdetailpage,
apps_landing_page, border_adjustment_plot, docspage, gettingstartedpage)
apps_landing_page, border_adjustment_plot, docspage,
gettingstartedpage, donate)

urlpatterns = [
url(r'^$', homepage, name='home'), # url(r'^apps/$', apps_landing_page, name='apps'),
url(r'^about/$', aboutpage, name='about'),
url(r'^getting-started/$', gettingstartedpage, name='gettingstartedpage'),
url(r'^hello/$', hellopage, name='hello'),
url(r'^gallery/$', gallerypage, name='gallery'),
url(r'^donate/$', donate, name='donate'),
url(r'^news/$', newspage, name='news'),
url(r'^news/news-detail$', newsdetailpage, name='newsdetail'),
url(r'^gallery/(?P<widget_id>\w+)/$', widgetpage),
Expand Down
18 changes: 18 additions & 0 deletions webapp/apps/pages/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,24 @@ def homepage(request):

return test

def donate(request):
form = subscribeform(request)
csrf_token = csrf(request)
if request.method == 'POST' and form.is_valid():
return check_email(request)

test = render(request, 'pages/donate.html', {
'csrv_token': csrf(request)['csrf_token'],
'email_form': form,
'section': {
'active_nav': 'home',
'title': 'Welcome to the Open Source Policy Center',
},
'username': request.user
})

return test

def aboutpage(request):
form = subscribeform(request)
if request.method == 'POST' and form.is_valid():
Expand Down