From e18f927e744e880b9c37309c5eca0194259fc02a Mon Sep 17 00:00:00 2001 From: hdoupe Date: Mon, 29 Oct 2018 15:21:19 -0400 Subject: [PATCH 1/4] Add donate script --- templates/pages/home_content.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/pages/home_content.html b/templates/pages/home_content.html index bbac9e64..0c87bdfc 100644 --- a/templates/pages/home_content.html +++ b/templates/pages/home_content.html @@ -90,6 +90,10 @@

Join the community

+
+ +
+

Become a contributor

From 5518683bbc6b7a2a18ca677b4ffb6203d3eba222 Mon Sep 17 00:00:00 2001 From: hdoupe Date: Mon, 29 Oct 2018 15:36:03 -0400 Subject: [PATCH 2/4] Use defaults channel --- python_env_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_env_build.sh b/python_env_build.sh index d4dbf5de..eb619dd9 100755 --- a/python_env_build.sh +++ b/python_env_build.sh @@ -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' From b40de850501031ce577c69411cb0482716bcdcbb Mon Sep 17 00:00:00 2001 From: hdoupe Date: Mon, 29 Oct 2018 16:12:33 -0400 Subject: [PATCH 3/4] make donate form a separate page --- templates/pages/donate.html | 105 ++++++++++++++++++++++++++++++ templates/pages/home.html | 3 + templates/pages/home_content.html | 4 -- webapp/apps/pages/urls.py | 4 +- webapp/apps/pages/views.py | 18 +++++ 5 files changed, 129 insertions(+), 5 deletions(-) create mode 100644 templates/pages/donate.html diff --git a/templates/pages/donate.html b/templates/pages/donate.html new file mode 100644 index 00000000..9261ea51 --- /dev/null +++ b/templates/pages/donate.html @@ -0,0 +1,105 @@ +{% extends 'pages/home.html' %} + +{% load staticfiles %} + +{% load flatblocks %} + +{% block content %} + +
+
+ + + +
+ +
+ +
+

Join the community

+
+
+`
{% csrf_token %} + + {{ email_form.email }} + {{ email_form.email.errors }} + + +
+
+
+
+ Welcome to the community! +
+
+ +
+ +{% comment %} + +
+

What People Are Saying

+
+ +
+
+

See all news

+
+
+
+

Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

+

Vestibulum id ligula porta felis euismod semper. Curabitur blandit tempus porttitor.

+
+
+
+
+

Sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

+

Vestibulum id ligula porta felis euismod semper. Curabitur blandit tempus porttitor.

+
+
+
+
+
+ +{% endcomment %} + +
+ +
+ +
+
+
+

MATT JENSEN

+

+1 202 862 5941

+

matt.jensen@aei.org

+
+ +
+
+
+ + +
+
+{% endblock %} diff --git a/templates/pages/home.html b/templates/pages/home.html index f4691c80..9c081dc1 100644 --- a/templates/pages/home.html +++ b/templates/pages/home.html @@ -73,6 +73,9 @@
  • About OSPC
  • +
  • + Donate +
  • diff --git a/templates/pages/home_content.html b/templates/pages/home_content.html index 0c87bdfc..bbac9e64 100644 --- a/templates/pages/home_content.html +++ b/templates/pages/home_content.html @@ -90,10 +90,6 @@

    Join the community

    -
    - -
    -

    Become a contributor

    diff --git a/webapp/apps/pages/urls.py b/webapp/apps/pages/urls.py index dc4a346f..d5cee530 100644 --- a/webapp/apps/pages/urls.py +++ b/webapp/apps/pages/urls.py @@ -2,7 +2,8 @@ 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'), @@ -10,6 +11,7 @@ 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\w+)/$', widgetpage), diff --git a/webapp/apps/pages/views.py b/webapp/apps/pages/views.py index 9808a872..4b60ef09 100644 --- a/webapp/apps/pages/views.py +++ b/webapp/apps/pages/views.py @@ -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(): From 45699c6ea6848d3a2784879d81953f761865da7f Mon Sep 17 00:00:00 2001 From: hdoupe Date: Mon, 29 Oct 2018 16:18:22 -0400 Subject: [PATCH 4/4] Drop nav item --- templates/pages/home.html | 3 --- 1 file changed, 3 deletions(-) diff --git a/templates/pages/home.html b/templates/pages/home.html index 9c081dc1..f4691c80 100644 --- a/templates/pages/home.html +++ b/templates/pages/home.html @@ -73,9 +73,6 @@
  • About OSPC
  • -
  • - Donate -