Merge branch 'master' of ssh://k.sfconservancy.org/website
This commit is contained in:
commit
ce6174de6d
12 changed files with 182 additions and 7 deletions
|
@ -1,7 +1,14 @@
|
|||
from django.contrib import admin
|
||||
from conservancy.apps.fundgoal.models import FundraisingGoal
|
||||
from conservancy.apps.fundgoal import models as fundgoal_models
|
||||
|
||||
class FundraisingGoalAdmin(admin.ModelAdmin):
|
||||
list_display = ('fundraiser_code_name', 'fundraiser_goal_amount')
|
||||
|
||||
admin.site.register(FundraisingGoal, FundraisingGoalAdmin)
|
||||
class GoalProviderAdmin(admin.ModelAdmin):
|
||||
fields = [
|
||||
'fundraising_goal',
|
||||
'provider_name',
|
||||
]
|
||||
|
||||
admin.site.register(fundgoal_models.FundraisingGoal, FundraisingGoalAdmin)
|
||||
admin.site.register(fundgoal_models.GoalProvider, GoalProviderAdmin)
|
||||
|
|
30
www/conservancy/apps/fundgoal/migrations/0001_initial.py
Normal file
30
www/conservancy/apps/fundgoal/migrations/0001_initial.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.7 on 2018-11-18 12:09
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='FundraisingGoal',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('fundraiser_code_name', models.CharField(max_length=200, unique=True)),
|
||||
('fundraiser_goal_amount', models.DecimalField(decimal_places=2, max_digits=10)),
|
||||
('fundraiser_so_far_amount', models.DecimalField(decimal_places=2, max_digits=10)),
|
||||
('fundraiser_donation_count', models.IntegerField()),
|
||||
('fundraiser_donation_count_disclose_threshold', models.IntegerField()),
|
||||
],
|
||||
options={
|
||||
'ordering': ('fundraiser_code_name',),
|
||||
},
|
||||
),
|
||||
]
|
|
@ -0,0 +1,24 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.7 on 2018-11-18 12:11
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fundgoal', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='GoalProvider',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('provider_name', models.CharField(max_length=512)),
|
||||
('fundraising_goal', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='fundgoal.FundraisingGoal')),
|
||||
],
|
||||
),
|
||||
]
|
0
www/conservancy/apps/fundgoal/migrations/__init__.py
Normal file
0
www/conservancy/apps/fundgoal/migrations/__init__.py
Normal file
|
@ -1,5 +1,6 @@
|
|||
import random
|
||||
|
||||
from django.db import models
|
||||
from decimal import *
|
||||
|
||||
class FundraisingGoal(models.Model):
|
||||
"""Conservancy fundraiser Goal"""
|
||||
|
@ -14,7 +15,30 @@ class FundraisingGoal(models.Model):
|
|||
return self.fundraiser_code_name
|
||||
|
||||
def percentage_there(self):
|
||||
return (self.fundraiser_so_far_amount / self.fundraiser_goal_amount ) * Decimal('100.00')
|
||||
return (self.fundraiser_so_far_amount / self.fundraiser_goal_amount ) * 100
|
||||
|
||||
class Meta:
|
||||
ordering = ('fundraiser_code_name',)
|
||||
|
||||
def providers(self):
|
||||
return GoalProvider.objects.filter(fundraising_goal=self)
|
||||
|
||||
def random_providers(self, k=None):
|
||||
providers = self.providers()
|
||||
if not providers.exists():
|
||||
return None
|
||||
elif k is None:
|
||||
return random.choice(providers)
|
||||
else:
|
||||
return random.sample(providers, k)
|
||||
|
||||
|
||||
class GoalProvider(models.Model):
|
||||
fundraising_goal = models.ForeignKey(
|
||||
'FundraisingGoal',
|
||||
on_delete=models.CASCADE,
|
||||
)
|
||||
provider_name = models.CharField(max_length=512)
|
||||
|
||||
def __unicode__(self):
|
||||
return self.provider_name
|
||||
|
|
|
@ -9,7 +9,7 @@ def fundgoal_lookup(fundraiser_sought):
|
|||
return None
|
||||
|
||||
def sitefundraiser(request):
|
||||
return {'sitefundgoal': fundgoal_lookup('fy-2018-main-match') }
|
||||
return {'sitefundgoal': fundgoal_lookup('cy2018-end-year-match') }
|
||||
|
||||
if conservancy.settings.FORCE_CANONICAL_HOSTNAME:
|
||||
_HOST_URL_VAR = {'host_url': 'https://' + conservancy.settings.FORCE_CANONICAL_HOSTNAME}
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 212 KiB |
42
www/conservancy/static/img/projects/racket.svg
Normal file
42
www/conservancy/static/img/projects/racket.svg
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1140pt" height="320pt" viewBox="0 0 1140 320" version="1.1">
|
||||
<defs>
|
||||
<g>
|
||||
<symbol overflow="visible" id="glyph0-0">
|
||||
<path style="stroke:none;" d=""/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-1">
|
||||
<path style="stroke:none;" d="M 37.960938 -82.421875 L 75.398438 -82.421875 C 78.519531 -82.421875 81.640625 -82.421875 84.761719 -82.679688 L 117 0 L 137.539062 0 L 102.441406 -86.320312 C 121.679688 -92.558594 137.539062 -107.640625 137.539062 -139.878906 L 137.539062 -145.078125 C 137.539062 -191.878906 104.261719 -202.800781 75.398438 -202.800781 L 19.238281 -202.800781 L 19.238281 0 L 37.960938 0 Z M 37.960938 -99.320312 L 37.960938 -185.898438 L 75.921875 -185.898438 C 93.339844 -185.898438 118.300781 -179.398438 118.300781 -144.558594 L 118.300781 -140.660156 C 118.300781 -105.820312 93.339844 -99.320312 75.921875 -99.320312 Z M 37.960938 -99.320312 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-2">
|
||||
<path style="stroke:none;" d="M 102.960938 0 L 118.039062 0 L 116.480469 -39 L 116.480469 -89.441406 C 116.480469 -119.859375 104.78125 -140.660156 66.558594 -140.660156 C 26 -140.660156 16.898438 -115.441406 16.898438 -94.640625 L 16.898438 -92.300781 L 34.320312 -92.300781 C 34.320312 -110.238281 40.300781 -125.320312 66.300781 -125.320312 C 90.738281 -125.320312 98.28125 -113.101562 98.28125 -89.441406 L 98.28125 -85.800781 L 56.679688 -79.300781 C 34.320312 -75.921875 11.699219 -67.339844 11.699219 -37.441406 L 11.699219 -34.839844 C 11.699219 -12.738281 26.261719 2.859375 51.480469 2.859375 C 75.398438 2.859375 91 -7.28125 100.101562 -19.238281 Z M 56.160156 -13 C 37.699219 -13 29.898438 -24.179688 29.898438 -36.398438 L 29.898438 -38.738281 C 29.898438 -54.339844 40.558594 -62.921875 58.238281 -66.039062 L 98.28125 -72.539062 L 98.28125 -34.839844 C 93.339844 -26.78125 81.640625 -13 56.160156 -13 Z M 56.160156 -13 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-3">
|
||||
<path style="stroke:none;" d="M 31.199219 -65.78125 L 31.199219 -72.019531 C 31.199219 -103.480469 43.160156 -124.28125 70.460938 -124.28125 C 95.421875 -124.28125 105.558594 -108.421875 105.558594 -87.359375 L 122.980469 -87.359375 L 122.980469 -92.558594 C 122.980469 -114.921875 108.160156 -140.660156 70.199219 -140.660156 C 29.898438 -140.660156 12.738281 -110.238281 12.738281 -72.019531 L 12.738281 -65.78125 C 12.738281 -27.558594 29.898438 2.859375 70.199219 2.859375 C 108.160156 2.859375 122.980469 -21.839844 122.980469 -43.679688 L 122.980469 -47.839844 L 105.558594 -47.839844 C 105.558594 -29.898438 96.199219 -13.519531 70.460938 -13.519531 C 43.160156 -13.519531 31.199219 -34.320312 31.199219 -65.78125 Z M 31.199219 -65.78125 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-4">
|
||||
<path style="stroke:none;" d="M 16.898438 0 L 35.101562 0 L 35.101562 -40.558594 L 63.441406 -71.761719 L 102.441406 0 L 123.238281 0 L 75.921875 -85.539062 L 123.238281 -137.800781 L 100.621094 -137.800781 L 35.101562 -65 L 35.101562 -208 L 16.898438 -208 Z M 16.898438 0 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-5">
|
||||
<path style="stroke:none;" d="M 128.699219 -61.359375 L 128.699219 -71.761719 C 128.699219 -109.980469 111.28125 -140.660156 70.980469 -140.660156 C 30.679688 -140.660156 12.738281 -109.980469 12.738281 -71.761719 L 12.738281 -66.039062 C 12.738281 -27.820312 30.679688 2.859375 72.28125 2.859375 C 111.019531 2.859375 128.699219 -21.839844 128.699219 -43.160156 L 128.699219 -44.199219 L 111.28125 -44.199219 C 111.28125 -29.378906 99.839844 -12.480469 72.28125 -12.480469 C 44.71875 -12.480469 31.980469 -31.199219 31.199219 -61.359375 Z M 70.71875 -125.320312 C 96.980469 -125.320312 109.199219 -106.339844 110.238281 -76.441406 L 31.199219 -76.441406 C 31.980469 -106.339844 44.71875 -125.320312 70.71875 -125.320312 Z M 70.71875 -125.320312 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-6">
|
||||
<path style="stroke:none;" d="M 48.101562 -137.800781 L 48.101562 -176.800781 L 29.898438 -176.800781 L 29.898438 -137.800781 L 8.058594 -137.800781 L 8.058594 -121.421875 L 29.898438 -121.421875 L 29.898438 -38.21875 C 29.898438 -8.320312 46.800781 2.859375 70.199219 2.859375 C 81.121094 2.859375 87.359375 0.78125 89.441406 0 L 89.441406 -15.859375 C 87.359375 -14.820312 80.339844 -13.519531 74.621094 -13.519531 C 57.199219 -13.519531 48.101562 -18.71875 48.101562 -40.558594 L 48.101562 -121.421875 L 92.039062 -121.421875 L 92.039062 -137.800781 Z M 48.101562 -137.800781 "/>
|
||||
</symbol>
|
||||
</g>
|
||||
</defs>
|
||||
<g id="surface1">
|
||||
<rect x="0" y="0" width="1140" height="320" style="fill:rgb(100%,100%,100%);fill-opacity:1;stroke:none;"/>
|
||||
<path style=" stroke:none;fill-rule:evenodd;fill:rgb(24.313725%,35.686275%,66.27451%);fill-opacity:1;" d="M 272.160156 247.859375 C 291.167969 223.660156 302.507812 193.152344 302.507812 159.992188 C 302.507812 81.367188 238.765625 17.628906 160.140625 17.628906 C 143.039062 17.628906 126.640625 20.644531 111.449219 26.175781 C 169.246094 56.492188 245.695312 155.410156 272.160156 247.859375 Z M 272.160156 247.859375 "/>
|
||||
<path style=" stroke:none;fill-rule:evenodd;fill:rgb(62.352941%,11.372549%,12.54902%);fill-opacity:1;" d="M 139.75 108.441406 C 117.542969 84.515625 92.671875 65.515625 66.332031 52.914062 C 36.574219 79.007812 17.777344 117.300781 17.777344 159.992188 C 17.777344 195.886719 31.066406 228.675781 52.988281 253.71875 C 72.3125 195.65625 108.640625 139.699219 139.75 108.441406 Z M 139.75 108.441406 "/>
|
||||
<path style=" stroke:none;fill-rule:evenodd;fill:rgb(62.352941%,11.372549%,12.54902%);fill-opacity:1;" d="M 165.984375 140.722656 C 135.164062 173.9375 104.449219 232.082031 93.335938 285.730469 C 113.257812 296.335938 135.996094 302.359375 160.140625 302.359375 C 184.964844 302.359375 208.300781 295.996094 228.621094 284.828125 C 216.910156 230.714844 194.800781 181.152344 165.984375 140.722656 Z M 165.984375 140.722656 "/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph0-1" x="350" y="267"/>
|
||||
<use xlink:href="#glyph0-2" x="501.839844" y="267"/>
|
||||
<use xlink:href="#glyph0-3" x="634.958984" y="267"/>
|
||||
<use xlink:href="#glyph0-4" x="770.678711" y="267"/>
|
||||
<use xlink:href="#glyph0-5" x="893.138672" y="267"/>
|
||||
<use xlink:href="#glyph0-6" x="1031.458008" y="267"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 6.2 KiB |
BIN
www/conservancy/static/img/projects/xapian.png
Normal file
BIN
www/conservancy/static/img/projects/xapian.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.4 KiB |
|
@ -579,6 +579,20 @@ to encode low level details into it.</li></ul>
|
|||
KVM kernel module in Linux. When using KVM, QEMU can virtualize x86,
|
||||
server and embedded PowerPC, and S390 guests.</p>
|
||||
|
||||
<h2><a href="https://racket-lang.org">Racket</a></h2>
|
||||
|
||||
<img class="project-logo" src="../../img/projects/racket.svg" alt="" />
|
||||
|
||||
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
|
||||
<input type="hidden" name="cmd" value="_s-xclick">
|
||||
<input type="hidden" name="hosted_button_id" value="URMNGBCTB96G2">
|
||||
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" name="submit" alt="Donate to Racket via PayPal">
|
||||
</form>
|
||||
|
||||
<p>Racket is a general-purpose programming language as well as the world’s
|
||||
first ecosystem for language-oriented programming. Make your dream language,
|
||||
or use one of the dozens already available.</p>
|
||||
|
||||
<h2><a href="https://reproducible-builds.org">Reproducible Builds</a></h2>
|
||||
|
||||
<img class="project-logo" src="../../img/projects/2018-10_Reproducible-Builds.svg" alt="" />
|
||||
|
@ -797,4 +811,19 @@ development toolkit for porting Windows source code to Unix as well as
|
|||
a program loader, allowing many unmodified Windows programs to run on
|
||||
x86-based Unixes, including Linux, Mac OS X, FreeBSD, and Solaris.</p>
|
||||
|
||||
<h2><a href="https://xapian.org/">Xapian</a></h2>
|
||||
|
||||
<img class="project-logo" src="../../img/projects/xapian.png" alt="" />
|
||||
|
||||
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
|
||||
<input type="hidden" name="cmd" value="_s-xclick">
|
||||
<input type="hidden" name="hosted_button_id" value="Y8WL47RVZJ3LQ">
|
||||
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" name="submit" alt="Donate to Xapian via PayPal">
|
||||
</form>
|
||||
|
||||
<p>Xapian is a highly adaptable toolkit which allows developers to
|
||||
easily add advanced indexing and search facilities to their own
|
||||
applications. It has built-in support for several families of weighting
|
||||
models and also supports a rich set of boolean query operators.</p>
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -63,7 +63,7 @@ this_match_remaining: this_match_goal - this_match_so_far
|
|||
{% endcomment %}
|
||||
|
||||
{% comment %}
|
||||
{% if sitefundgoal and sitefundgoal.fundraiser_so_far_amount %}
|
||||
{% if sitefundgoal %}
|
||||
{% with this_match_goal=sitefundgoal.fundraiser_goal_amount this_match_so_far=sitefundgoal.fundraiser_so_far_amount %}
|
||||
{% with this_match_remaining=this_match_goal|subtract:this_match_so_far %}
|
||||
<div class="fundraiser-top-text">
|
||||
|
@ -72,9 +72,11 @@ this_match_remaining: this_match_goal - this_match_so_far
|
|||
Thanks to {{ sitegoal.fundraiser_donation_count|intcomma }} Supporters we earned our full match! Help us go further to stand up for software
|
||||
freedom — <a href="/supporter">sign up now</a>!
|
||||
{% else %}
|
||||
The next ${{ this_match_remaining|floatformat:0|intcomma }} of support we receive will be matched thanks to Private Internet Access and an anonymous donor! <a href="/supporter/">Support Conservancy today!</a>
|
||||
The next ${{ this_match_remaining|floatformat:0|intcomma }} of support we receive will be matched thanks to Private Internet Access and a group of generous donors, including {{ sitefundgoal.random_providers }}! <a href="/supporter/">Support Conservancy today!</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
{% if sitefundgoal.fundraiser_so_far_amount %}
|
||||
<div id="siteprogressbar">
|
||||
<a href="/supporter">
|
||||
We've matched
|
||||
|
@ -88,6 +90,8 @@ this_match_remaining: this_match_goal - this_match_so_far
|
|||
so far!
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
|
|
15
www/manage.py
Executable file
15
www/manage.py
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
if __name__ == "__main__":
|
||||
www_path = os.path.abspath(os.path.dirname(sys.argv[0]))
|
||||
if www_path not in sys.path:
|
||||
sys.path.append(www_path)
|
||||
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "conservancy.settings")
|
||||
|
||||
from django.core.management import execute_from_command_line
|
||||
|
||||
execute_from_command_line(sys.argv)
|
Loading…
Reference in a new issue