diff --git a/rowers/templates/frontpage.html b/rowers/templates/frontpage.html index 1d7112b2..ef972c0b 100644 --- a/rowers/templates/frontpage.html +++ b/rowers/templates/frontpage.html @@ -92,6 +92,10 @@
and more
- Compatible with:
-
-
-
-
-
-
-
-
-
-
-
-
-
+ Compatible with:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + read more + +
+(\w.*)\<\/p\>') + excerpt_first = ptester.match(excerpt).group(1) + + thedict = { + 'title': title, + 'author': '', + 'image': image_url, + 'excerpt': excerpt_first, + 'link': postdata['link'], + } + + blogposts.append(thedict) + + return JSONResponse(blogposts) + + + + @login_required() def deactivate_user(request): pk = request.user.id @@ -2463,6 +2528,7 @@ def rower_process_testcallback(request): def keyvalue_get_default(key,options,def_options): + try: return options[key] except KeyError: @@ -2481,17 +2547,17 @@ def cum_flex_data( 'xparam':'spm', 'yparam1':'power', 'yparam2':'None', - 'enddatestring':'', - 'startdatestring':'', + 'enddatestring':timezone.now().strftime("%Y-%m-%d"), + 'startdatestring':(timezone.now()-datetime.timedelta(days=30)).strftime("%Y-%m-%d"), 'deltadays':-1, }): def_options = options - if 'options' in request.session: options = request.session['options'] + modality = keyvalue_get_default('modality',options,def_options) rankingonly = keyvalue_get_default('rankingonly',options,def_options) includereststrokes = keyvalue_get_default('includereststrokes',options,def_options) @@ -2504,6 +2570,7 @@ def cum_flex_data( startdatestring = keyvalue_get_default('startdatestring',options,def_options) enddatestring = keyvalue_get_default('enddatestring',options,def_options) + if modality == 'all': modalities = [m[0] for m in mytypes.workouttypes] else: @@ -2541,7 +2608,7 @@ def cum_flex_data( rankingpiece = [True,] else: rankingpiece = [True,False] - + allworkouts = Workout.objects.filter(user=r2, workouttype__in=modalities, boattype__in=waterboattype, @@ -2582,8 +2649,8 @@ def histo_data( 'modality':'all', 'waterboattype':mytypes.waterboattype, 'theuser':0, - 'enddatestring':'', - 'startdatestring':'', + 'enddatestring':timezone.now().strftime("%Y-%m-%d"), + 'startdatestring':(timezone.now()-datetime.timedelta(days=30)).strftime("%Y-%m-%d"), 'deltadays':-1, }): @@ -2676,8 +2743,8 @@ def cum_flex(request,theuser=0, startdate=timezone.now()-datetime.timedelta(days=10), enddate=timezone.now(), deltadays=-1, - startdatestring="", - enddatestring="", + enddatestring=timezone.now().strftime("%Y-%m-%d"), + startdatestring=(timezone.now()-datetime.timedelta(days=30)).strftime("%Y-%m-%d"), options={ 'includereststrokes':False, 'workouttypes':[i[0] for i in mytypes.workouttypes], @@ -2753,6 +2820,8 @@ def cum_flex(request,theuser=0, s = enddate enddate = startdate startdate = s + startdatestring = startdate.strftime('%Y-%m-%d') + enddatestring = enddate.strftime('%Y-%m-%d') if modalityform.is_valid(): modality = modalityform.cleaned_data['modality'] waterboattype = modalityform.cleaned_data['waterboattype'] @@ -3049,14 +3118,14 @@ def histo(request,theuser=0, startdate=timezone.now()-datetime.timedelta(days=365), enddate=timezone.now(), deltadays=-1, - startdatestring="", - enddatestring="", - options={ - 'includereststrokes':False, - 'workouttypes':[i[0] for i in mytypes.workouttypes], - 'waterboattype':mytypes.waterboattype, - 'rankingonly': False, - }): + enddatestring=timezone.now().strftime("%Y-%m-%d"), + startdatestring=(timezone.now()-datetime.timedelta(days=30)).strftime("%Y-%m-%d"), + options={ + 'includereststrokes':False, + 'workouttypes':[i[0] for i in mytypes.workouttypes], + 'waterboattype':mytypes.waterboattype, + 'rankingonly': False, + }): r = getrequestrower(request,userid=theuser) theuser = r.user @@ -3124,6 +3193,8 @@ def histo(request,theuser=0, s = enddate enddate = startdate startdate = s + startdatestring = startdate.strftime('%Y-%m-%d') + enddatestring = enddate.strftime('%Y-%m-%d') if modalityform.is_valid(): modality = modalityform.cleaned_data['modality'] waterboattype = modalityform.cleaned_data['waterboattype'] diff --git a/rowsandall_app/urls.py b/rowsandall_app/urls.py index 66771e86..d824ae0e 100644 --- a/rowsandall_app/urls.py +++ b/rowsandall_app/urls.py @@ -58,6 +58,7 @@ urlpatterns += [ url(r'^admin/', admin.site.urls), url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')), url(r'^$',rootview), + url(r'^getblogs$',rowersviews.get_blog_posts), url(r'^login/',auth_views.login, name='login'), url(r'^logout/$',auth_views.logout, {'next_page': '/'}, diff --git a/rowsandall_app/views.py b/rowsandall_app/views.py index f207d1e7..e439e787 100644 --- a/rowsandall_app/views.py +++ b/rowsandall_app/views.py @@ -1,11 +1,15 @@ from django.shortcuts import render, redirect, render_to_response +from django.template.loader import render_to_string from django.template import RequestContext from django.conf import settings from rowers.forms import LoginForm +from django.http import HttpResponse from rowingdata import main as rmain + import random + def rootview(request): magicsentence = rmain() @@ -53,7 +57,7 @@ def rootview(request): 'text':'Rowsandall.com is the ideal platform for remote rowing coaching. As a coach, you can easily manage your athletes, set up plans and monitor execution and technique' } - + allofferings = [ planoffering, diff --git a/static/css/rowsandall2.css b/static/css/rowsandall2.css index 329faf27..b8bd8ecf 100644 --- a/static/css/rowsandall2.css +++ b/static/css/rowsandall2.css @@ -324,6 +324,28 @@ th.rotate > div > span { z-index: -1; } +.vignet2 { + border-radius: 50%; + width: 200px; + height: 200px; + display: block; + overflow: hidden; + padding: 5px; + margin: 5px; + -webkit-box-shadow: inset 0px 0px 85px rgba(0,0,0,0.4); + -moz-box-shadow: inset 0px 0px 85px rgba(0,0,0,0.4); + box-shadow: inset 0px 0px 85px rgba(0,0,0,0.4); + + line-height: 0; /* ensure no space between bottom */ + +} + +.vignet2 img { + position: center; + z-index: -1; +} + + .button { font: 1.1em/1.5em sans-serif; text-decoration: none;