Skip to content
Newer
Older
100644 83 lines (45 sloc) 2.08 KB
3d6a694 @jtauber initial documentation of sponsorship app
jtauber authored Feb 5, 2012
1 Sponsorship App
2 ===============
3
4 Sponsorship is managed via the ``sponsorship`` app.
5
6 Sponsorship levels and sponsors are added via the Django admin.
7
8
9 Models
10 ------
11
12 Each sponsor level has a ``name`` (e.g. "Gold", "Silver") and an ``order``
13 field which is an integer that is used to sort levels (lowest first). Each
14 level also has a ``description`` which is not currently exposed anywhere
15 but can be used for private annotation.
16
17 Each sponsor has a ``name``, ``external_url`` (i.e. link to the sponsor's
18 website), ``contact_name`` and ``contact_email``, ``logo``, and ``level``.
19
20 A sponsor may also have a private ``annotation`` that can be used by
21 organizers to take notes about the sponsor.
22
23 A sponsor will not appear on the site until the ``active`` flag is set true.
24
25
26 Template Snippets
27 -----------------
28
29 The easiest way to include sponsor logos, grouped by level, is to either::
30
31 {% include "sponsorship/_vertical_by_level.html" %}
32
33 or::
34
35 {% include "sponsorship/_horizontal_by_level.html" %}
36
37 You can get a wall of sponsors (without level designation) with::
38
39 {% include "sponsorship/_wall.html" %}
40
41
42 You can always tweak these templates or use them as the basis for your own.
43 This is often all you'll need to do to display sponsors on your site.
44
45 If you want to display a specific sponsor logo you can use::
46
47 {% include "sponsorship/_sponsor_link.html" with sponsor=sponsor %}
48
49 or::
50
51 {% include "sponsorship/_sponsor_link.html" with sponsor=sponsor dimensions="100x100" %}
52
53 if you want different dimensions than the default 150 x 150.
54
55
56 Template Tags
57 -------------
58
59 If you want to retrieve the sponsors and traverse them yourself, you can use
60 the provided template tags::
61
62 {% load sponsorship_tags %}
63
64 {% sponsors as all_sponsors %}
65
66 or::
67
68 {% load sponsorship_tags %}
69
70 {% sponsors "Gold" as gold_sponsors %}
71
72 if you want to just get a specific level.
73
74
75 You can get the levels with::
76
77 {% load sponsorship_tags %}
78
79 {% sponsor_levels as levels %}
80
81 and you can always iterate over those levels, calling ``level.sponsors`` to
82 get the sponsors at that level.
Something went wrong with that request. Please try again.