From 0b51a7d5195928863add40dc89939e22859e2800 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 28 Mar 2017 13:12:50 +0200 Subject: [PATCH 1/3] first version of partnerparge --- rowers/templates/base.html | 24 +++++++++++++++---- rowers/templates/partners.html | 43 ++++++++++++++++++++++++++++++++++ rowers/urls.py | 1 + 3 files changed, 63 insertions(+), 5 deletions(-) create mode 100644 rowers/templates/partners.html diff --git a/rowers/templates/base.html b/rowers/templates/base.html index 11e99b6c..86d4840f 100644 --- a/rowers/templates/base.html +++ b/rowers/templates/base.html @@ -36,7 +36,21 @@ {% endif %}
-

 

+
+
+ +
+ +
+ +
+ +
{% if user.is_authenticated %}

Password Change

@@ -189,14 +203,14 @@
+
+ +
-
- -
diff --git a/rowers/templates/partners.html b/rowers/templates/partners.html new file mode 100644 index 00000000..bc16ff4e --- /dev/null +++ b/rowers/templates/partners.html @@ -0,0 +1,43 @@ + +{% extends "base.html" %} +{% block title %}About us{% endblock title %} +{% block content %} + +
+

Are you interested in partnering with Rowsandall.com?

+ +

We are open to working together with partners serving the rowing + community. To maintain maximum transparency to our users, we have + the following principles for collaboration:

+ +
    +
  1. On blog.rowsandall.com, analytics.rowsandall.com and in through + our Twitter account, we write about hardware, software, and other + rowing related kit that we have used, tested, and are enthusiastic about.
  2. +
  3. If you send us a unit, or a piece of software to test, we will not + write a public review about it. If we like the unit (software, etc) and + keep using it, you may see it appear in our blog posts. If there are + reasons why we are not satisfied with the unit, but we feel that + an improved version would serve the rowing community, we will contact + you with constructive criticism. We will do our best not to mention + your product in + a negative way on our public blogs or twitter. However, we retain the + freedom to engage in online discussions about your product, but will + try to keep our communication factual.
  4. +
  5. We encourage vendors to send us their products for testing. We are + especially interested in software and hardware used for indoor and + on-the-water rowing. We want to avoid the hassle of sending back + your products, so we will not send back any item that has a value of + less than 1000 EURO. If you want us to test an item of higher value, + please mention this when you contact us.
  6. +
+ +
+ + + +
+

 

+
+ + {% endblock content %} diff --git a/rowers/urls.py b/rowers/urls.py index ae58dcad..18ab3665 100644 --- a/rowers/urls.py +++ b/rowers/urls.py @@ -194,6 +194,7 @@ urlpatterns = [ url(r'^workout/fusion/(?P\d+)/(?P\d+-\d+-\d+)/(?P\w+.*)$',views.workout_fusion_list), url(r'^physics$',TemplateView.as_view(template_name='physics.html'),name='physics'), + url(r'^partners$',TemplateView.as_view(template_name='partners.html'),name='partners'), url(r'^workout/(\d+)/$',views.workout_view), url(r'^workout/(\d+)/addtimeplot$',views.workout_add_timeplot_view), url(r'^workout/(\d+)/addpiechart$',views.workout_add_piechart_view), From 3923f69933e010e1e05d4fc5e79fcf6e07f9eaa8 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 28 Mar 2017 14:01:37 +0200 Subject: [PATCH 2/3] nothing --- rowers/templates/ga.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rowers/templates/ga.html b/rowers/templates/ga.html index dd37c1c6..15741226 100644 --- a/rowers/templates/ga.html +++ b/rowers/templates/ga.html @@ -2,7 +2,7 @@ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) - })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', '{{ GOOGLE_ANALYTICS_PROPERTY_ID }}', '{{ GOOGLE_ANALYTICS_DOMAIN }}'); ga('send', 'pageview'); From c692f4f7b576694b4b3afbf5f7eac07415edef9e Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Wed, 29 Mar 2017 11:20:03 +0200 Subject: [PATCH 3/3] initial text of partnership page --- .gitignore | 1 + rowers/templates/partners.html | 34 +++++++++++++++++++++++++++++++++- rowers/tests.py | 8 ++++++++ rowers/views.py | 6 ++++-- 4 files changed, 46 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 058059f8..3c4022c7 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ # Emacs temp files *.*~ +\#* # database *.sqlite3 diff --git a/rowers/templates/partners.html b/rowers/templates/partners.html index bc16ff4e..e6e27d5d 100644 --- a/rowers/templates/partners.html +++ b/rowers/templates/partners.html @@ -37,7 +37,39 @@
-

 

+

Examples of possible partnerships

+

+ We currently envision a couple of ways in which we can partner with + your business. We are open for other models. If you have an interesting + proposition or want to use one of the partnership models listed below, + please contact us by email. + +

    +
  1. Sponsorship of Pro membership. + You distribute coupon codes giving right to a year of + Pro membership to the receiver of the coupon. The coupon can be + redeemed on this website by the user. He or she will get a year of + Pro membership sponsored by you. Rowsandall.com will send you a + regular invoice based on the number of redeemed coupons.
  2. +
  3. Purchasing blocks of Pro membership coupons. + This is similar to the above, except that you pay in advance (at + a reduced rate) a "block" of Pro membership coupons.
  4. +
  5. Advertising. If you decide to support rowsandall.com through + advertising, we will create a top banner where you as a sponsor + have space to put up a clickable picture. Price and content open + for negotiation.
  6. +
  7. Collaboration on prototypes or beta versions of your new products + (or product upgrades). You send us a product ahead of release (under + a confidentiality agreement) and we use it and provide feedback. + We will make no public comments or posts about the product, nor + would we inform anyone else.
  8. +
  9. Long term product feedback. Typically in the product design phase. + We would act as a sounding board for ideas, could provide feedback + on the data related features of the product. We would charge for our + time according to an agreed price.
  10. + + +

{% endblock content %} diff --git a/rowers/tests.py b/rowers/tests.py index 7966ad25..ffb4d821 100644 --- a/rowers/tests.py +++ b/rowers/tests.py @@ -1,4 +1,6 @@ from django.test import TestCase, Client,override_settings +from django.core.management import call_command +from django.utils.six import StringIO from django.test.client import RequestFactory from .views import checkworkoutuser,c2_open from rowers.models import Workout, User, Rower, WorkoutForm,RowerForm,GraphImage @@ -43,6 +45,12 @@ class DjangoTestCase(TestCase, MockTestCase): # Create your tests here. +class EmailProcessTest(TestCase): + def test_emailprocessing(self): + out = StringIO() + call_command('processemail', stdout=out) + self.assertIn('Successfully processed email attachments',out.getvalue()) + class C2Objects(DjangoTestCase): def test_strokedata(self): with open('rowers/testdata/c2stroketestdata.txt','r') as infile: diff --git a/rowers/views.py b/rowers/views.py index 2294a87f..c5dddf18 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -5215,17 +5215,19 @@ def workout_upload_view(request,message="", return HttpResponseRedirect("/rowers/me/c2authorize/") try: c2userid = c2stuff.get_userid(thetoken) + if not c2userid: + return HttpResponseRedirect("/rowers/me/c2authorize") data = c2stuff.createc2workoutdata(w) authorizationstring = str('Bearer ' + thetoken) headers = {'Authorization': authorizationstring, 'user-agent': 'sanderroosendaal', 'Content-Type': 'application/json'} import urllib - url = "httpvs://log.concept2.com/api/users/%s/results" % (c2userid) + url = "https://log.concept2.com/api/users/%s/results" % (c2userid) response = requests.post(url,headers=headers,data=json.dumps(data)) # response = c2stuff.workout_c2_upload(request.user,w) - if (response.status_code != 201): + if (response.status_code != 201 and response.status_code != 200): if settings.DEBUG: return HttpResponse(response) else: