๐Ÿ“ฆ bevyengine / bevy-website

๐Ÿ“„ donate.html ยท 178 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178{% import "macros/numbers.html" as numbers %}
{% extends "layouts/base.html" %}

{% block content %}

{% set donors = load_data(path="content/donate/donors.toml") %}
{% set tiers = load_data(path="content/donate/tiers.toml") %}
{% set metrics = load_data(path="content/donate/metrics.toml") %}

{% set_global member_count = metrics.members %}
{% set_global sponsor_count = metrics.sponsors %}
{% set_global monthly_donations = metrics.monthly_dollars %}

<!-- commented out for now -->
{#
    {% set_global member_count = 0 %}
    {% set_global sponsor_count = 0 %}
    {% for tier in tiers.tier | reverse %}
        {% set next_tier_index = tiers.tier | length - loop.index0 %}
        {% set next_tier = tiers.tier | nth(n=next_tier_index) %}

        <!-- Note: this "sponsor filtering logic" _must_ be kept in sync with the logic in sponsors.html -->
        <!-- If we can find a way to reuse this logic in Zola, we absolutely should! -->
        {% if donors.donor %}
            {% for donor in donors.donor %}
                {% if donor.past %}
                    {% continue %}
                {% endif %}
                {% if donor.amount >= tier.amount %}
                    {% if next_tier and donor.amount >= next_tier.amount %}
                        {% continue %}
                    {% endif %}
                    {% if tier.sponsor_tier %}
                        {% set_global sponsor_count = sponsor_count + 1 %}
                    {% else %}
                        {% set_global member_count = member_count + 1 %}
                    {% endif %}
                {% endif %}
            {% endfor %}
        {% endif %}
    {% endfor %}

    {% set_global monthly_donations = 0 %}
    {% if donors.donor %}
        {% for donor in donors.donor %}
            {% if donor.past %}
                {% continue %}
            {% endif %}
            {% set_global monthly_donations = monthly_donations + donor.amount %}
        {% endfor %}
    {% endif %}
#}


{% set monthly_donations_string = numbers::comma_string(value=monthly_donations) %}

<div class="donate-page">

<div class="donate-support">
    <div class="donate-support-text">
        <div class="donate-support-bevy">Support Bevy</div>
        <div class="donate-support-description">
            Donate to <a href="/foundation">Bevy Foundation</a> and <a href="/foundation">support our mission</a> to develop and support the free and open source Bevy Engine.
        </div>
    </div>
    <div class="donate-metrics">
        <div class="donate-metric">
            <span class="donate-number">${{ monthly_donations_string }}</span>
            <span class="donate-number-label">Per Month</span>
        </div>
        <div class="donate-metric">
            <span class="donate-number">{{ member_count }}</span>
            <span class="donate-number-label">Members</span>
        </div>
        <div class="donate-metric">
            <span class="donate-number">{{ sponsor_count }}</span>
            <span class="donate-number-label">Sponsors</span>
        </div>
    </div>
</div>

<input id="donate-view-state" class="hidden" type="checkbox">
<div data-donate-view-state-container>
<div id="membership">
<h2 class="donate-header-padding">Membership</h2>
<div class="donate-levels-container">
    <div class="donate-membership-levels">
        {% for tier in tiers.tier %}
            {% if tier.sponsor_tier %}
                {% continue %}
            {% endif %}
            {% set amount_string = numbers::comma_string(value=tier.amount) %}
            {% if tier.every_org_link %}
                {% set donate_link = tier.every_org_link %}
            {% elif tier.stripe_link %}
                {% set donate_link = tier.stripe_link %}
            {% endif %}
            <a href="{{ donate_link }}" class="card donate-level">
                <div class="donate-level-info">
                    <img class="donate-level-icon" alt="donate level icon" src="{{ tier.icon }}"/>
                    <div class="donate-level-text donate-level-{{ tier.name | replace(from=" ", to="_") | lower }}">
                        <div class="donate-level-name">{{ tier.name }}</div>
                        <div class="donate-level-amount">${{ amount_string }} / month</div>
                    </div>
                </div>
                <div class="tier-rewards">
                    {% if tier.reward_name %}
                    <div class="tier-reward">Name in Credits</div>
                    {% endif %}
                    {% if tier.reward_logo %}
                    <div class="tier-reward">Logo in Credits</div>
                    {% endif %}
                    {% if tier.reward_link %}
                    <div class="tier-reward">Link in Credits</div>
                    {% endif %}
                </div>
            </a>
        {% endfor %}
    </div>
</div>
<label for="donate-view-state" class="card donate-corporate-button">
    Corporate Tiers 
</label>
</div>

<div id="corporate-sponsorship">
<h2 class="donate-header-padding">Corporate Sponsorship</h2>
<div class="donate-membership-description">
These tiers exist for individuals or organizations that want to support Bevy in a big way. We <i>highly</i> recommend using bank transfers for payments at these levels to avoid exorbitant credit card processor fees. Please <a href="mailto:support@bevy.org">contact us</a> if you have any questions, or if you would like to discuss other payment options!
</div>
<div class="donate-levels-container">
<div class="donate-membership-levels">
    {% for tier in tiers.tier %}
        {% if not tier.sponsor_tier %}
            {% continue %}
        {% endif %}
        {% set amount_string = numbers::comma_string(value=tier.amount) %}
        {% if tier.every_org_link %}
            {% set donate_link = tier.every_org_link %}
        {% elif tier.stripe_link %}
            {% set donate_link = tier.stripe_link %}
        {% endif %}
        <a href="{{ donate_link }}" class="card donate-level">
            <div class="donate-level-info">
                <img alt="donate level icon" class="donate-level-icon" src="{{ tier.icon }}"/>
                <div class="donate-level-text donate-level-{{ tier.name | replace(from="Corporate ", to="") | replace(from=" ", to="_") | lower }}">
                    <div class="donate-level-corporate">Corporate</div>
                    <div class="donate-level-name">{{ tier.name | replace(from="Corporate ", to="") }}</div>
                    <div class="donate-level-amount">${{ amount_string }} / month</div>
                </div>
            </div>
            <div class="tier-rewards">
                {% if tier.reward_name %}
                <div class="tier-reward">Name in Credits</div>
                {% endif %}
                {% if tier.reward_logo %}
                <div class="tier-reward">Logo in Credits</div>
                {% endif %}
                {% if tier.reward_link %}
                <div class="tier-reward">Link in Credits</div>
                {% endif %}
            </div>
        </a>
    {% endfor %}
</div>
</div>
<label for="donate-view-state" class="card donate-corporate-button">
    Individual Tiers
</label>
</div>
</div>

<div class="donate-faq-link"><a href="/donate/options">Click here</a> for more donation options and FAQs</div>
{% include "sponsors.html" %}
</div>

{% endblock content %}