Commit graph

46 commits

Author SHA1 Message Date
Bradley M. Kuhn
30b1a3d23d Correct attr in lookup as well. 2015-05-09 17:34:49 -07:00
Bradley M. Kuhn
97ab9c7541 Correct lookup of attribute. 2015-05-09 17:33:51 -07:00
Bradley M. Kuhn
4d4f520900 Correct keys to be the code name of the fundraiser 2015-05-09 17:31:47 -07:00
Bradley M. Kuhn
8df76219f8 Get an empty dict & no error when attrs not there 2015-05-09 17:29:08 -07:00
Bradley M. Kuhn
87a658a6b6 correct variable name. 2015-05-09 17:25:25 -07:00
Bradley M. Kuhn
9dab283774 Generate JSON output of a fundraiser data
Allow public interface to query the fundraiser data.
2015-05-09 16:50:32 -07:00
Bradley M. Kuhn
8b469cff18 Support display of donation count in fundraiser.
Allow display of a donation count in the fundraiser pages, with an
optional threshold that must be met before it's displayed.
2015-03-11 18:10:28 -07:00
Bradley M. Kuhn
db4a82f432 Correct goal amount for admin display. 2015-03-08 23:00:32 -07:00
Bradley M. Kuhn
8888a12699 Import decimal needed. 2015-03-08 21:28:44 -07:00
Bradley M. Kuhn
65142c984a Convert 100.00 to Decimal for operation. 2015-03-08 21:27:13 -07:00
Bradley M. Kuhn
637dd98a68 self. was needed here. 2015-03-08 21:24:09 -07:00
Bradley M. Kuhn
027964192a Function to compute how far to the goal we are.
This is also inserted by the Javascript code as well, but no reason we
can't compute it server side, too.
2015-03-08 21:21:58 -07:00
Bradley M. Kuhn
0d2908ef30 Add empty __init__.py for fundgoal. 2015-03-08 18:18:46 -07:00
Bradley M. Kuhn
71834b60ec Fix another typo in import correction. 2015-03-08 18:16:33 -07:00
Bradley M. Kuhn
a5cd6ab63b Make defaults for BooleanFields.
According to django-admin check,

   (1_6.W002) BooleanField does not have a default value.
    HINT: Django 1.6 changed the default value of BooleanField from False to None. See https://docs.djangoproject.com/en/1.6/ref/models/fields/#booleanfield for more information.
2015-03-08 18:00:50 -07:00
Bradley M. Kuhn
bef4637016 Fix typos in module path names from last commit. 2015-03-08 17:56:56 -07:00
Bradley M. Kuhn
f6bbcc7ee3 Just quit it with this relative import stuff.
While I think these relative imports seem to be valid for the running
application, I am having trouble with the django-admin applications
regarding them.  I don't see this syntactic sugar as absolutely
essential, so I'm just going to change it now.
2015-03-08 17:54:05 -07:00
Bradley M. Kuhn
d73018440a Initial hack at a fundraising goal application.
This simple application will simply store the code name and the to goal
of each fundraiser.  The so_far number will likely just be updated by
some external script, modifying the appropriate entry in the SQL
database.
2015-03-08 17:40:24 -07:00
Bradley M. Kuhn
fb16e1127d Correct to use pub_date here, not a variable. 2015-03-04 15:43:04 -08:00
Bradley M. Kuhn
c7d4309149 Fix blog by year index.
Add an additional context data that is always the entire list of years,
and use that instead of date_list for the current queryset.
2015-03-04 15:40:54 -08:00
Bradley M. Kuhn
1c6e685ee4 Remove dead code, no longer needed. 2015-03-04 15:31:05 -08:00
Bradley M. Kuhn
cdf9c67b42 Typo fix from last commit:
s/extra_content/extra_context/
2015-03-04 15:25:50 -08:00
Bradley M. Kuhn
1e396f77a3 More extra_context stuff? Put it all in there!
Simply move the blog_entries field into extra_context and pass the whole
darn thing along to the template.
2015-03-04 15:24:53 -08:00
Bradley M. Kuhn
8e6c2e54ac date_list should come from the extra_context too. 2015-03-04 15:18:18 -08:00
Bradley M. Kuhn
103ffefc87 Correct variables for setting. 2015-03-04 15:17:31 -08:00
Bradley M. Kuhn
0b530f1139 Only 4 blog entries per page. 2015-03-04 15:12:02 -08:00
Bradley M. Kuhn
1ed42c6c89 Must extract paginate_by from kwargs to use it. 2015-03-04 15:07:30 -08:00
Bradley M. Kuhn
b7316e0555 Paginator must be imported if one wants to use it. 2015-03-04 15:06:13 -08:00
Bradley M. Kuhn
8f4c8a69d6 Rework blog's custom_index for new pagination.
The pagination support changed, and as was previously done a few commits
ago for news, I'm trying a similar solution for blogs.

In this case, I'm trying to use the existing custom_index() method we
have and adapt it to properly support pagination in the way we want.

I'm not completely sure this will work, but I think it's at least close.
2015-03-04 15:04:13 -08:00
Bradley M. Kuhn
47b446cd3b Correct template path name. 2015-03-04 12:42:42 -08:00
Bradley M. Kuhn
c478c2165b import render_to_response 2015-03-04 12:35:30 -08:00
Bradley M. Kuhn
87c68de62a news_queryset is what we wanted here, not news. 2015-03-04 12:33:12 -08:00
Bradley M. Kuhn
076345298e Allow additional arguments to listing() call.
The urls setup of old gave us various arguments at call time for
custom_index(), and some where useful.  Hopefully, listing() can support
the same type of system, over time, once adapted.  Here's an attempt to
get it started, first by supporting paginate_by.
2015-03-04 12:30:54 -08:00
Bradley M. Kuhn
317dd24206 Remove custom_index() method from news view.
I don't believe custom_index() should be used anymore given that we have
this new listing setup.  At least, that's what I surmise based on
current error messages.  I may bring this back if removing it breaks
something else.
2015-03-04 12:28:03 -08:00
Bradley M. Kuhn
00995bff4d Fix cut and paste error from documentation
This is trying to build a pagination of a news queryset.

HT tmarble for pointing this out.
2015-03-04 12:22:33 -08:00
Bradley M. Kuhn
5c7710954b Attempt to use Django 1.7 Paginator object.
Upon reading
  https://docs.djangoproject.com/en/1.7/topics/pagination/#using-paginator-in-a-view

I wonder if we should simply follow this model for pagination of news
items.  I've attempted to adapt that herein.  This is a first attempt
and likely will have issues.
2015-03-04 12:08:39 -08:00
Tom Marble
f742f86f4b fixed /admin 2015-03-04 19:30:51 +00:00
Tom Marble
86e1646f8f Fixed "(page of)" thing at the top of news 2015-03-03 19:23:57 +00:00
Tom Marble
2bf594b86c First pass at migration to Django 1.7 2015-03-03 18:40:18 +00:00
Bradley M. Kuhn
5688ffcd48 Change sort of supporters to be lexicographical. 2015-01-04 12:10:09 -05:00
Bradley M. Kuhn
462cbc3963 Supporters list built dynamically.
Hitherto the supporters list has been committed directly to the static
sponsors/index.html file.  This was never ideal and a quick hack to
build Conservancy's supporters list at the beginning of the supporters
program.

With this change, a Django app now exists that dynamically generates the
supporters list.

The database rows must be built from Conservancy's internal Ledger file,
which will be done in a separate script.
2015-01-03 09:53:12 -05:00
Bradley M. Kuhn
1688c69b0f Keep blog posts on front page for 30 days. 2012-02-15 15:13:30 -08:00
Bradley M. Kuhn
3a224ca78e Correct URLs for /about that reference long-since non-existent "team" directory (patch from Martin Michlmayr <tbm@hp.com>) 2011-10-28 10:43:29 +02:00
Bradley M. Kuhn
85eae7afbb removed reference to SFLC object 2010-09-30 10:24:03 -04:00
Bradley M. Kuhn
f7e45da6dd Adapted Django application stuff for Conservancy; and normalized to string
"conservancy" within code and templates.
2010-09-26 17:54:29 -04:00
Bradley M. Kuhn
8e6ea8ad71 Applications directory from SFLC website; About to adapt it for Conservancy website to run on its own 2010-09-26 17:32:53 -04:00