home

Add code for wishlist (Dutch only)

Author
Maarten Vangeneugden
Date
Feb. 10, 2023, 2:59 p.m.
Hash
64a4b8c6a3bc093d814d0c87fb3076899e483bf7
Parent
63dd125c6044b1b278d3d6a68e5be715e4ab623a
Modified files
templates/about/about.djhtml
templates/about/verlanglijst.djhtml
views.py

templates/about/about.djhtml

2 additions and 3 deletions.

View changes Hide changes
1
1
{% load i18n %}
2
2
{% load static %}
3
3
4
4
{% block title %}{% translate "About myself" %}{% endblock title %}
5
5
{% block description %}{% blocktranslate trimmed %}A page where I talk about myself, what I
6
6
	do, what I (dis)like, ...{% endblocktranslate %}
7
7
{% endblock description %}
8
8
{% block main %}
9
9
{# TODO sections: languages "link naar paper"; meer redenen voor mijn website en
10
10
waarom ik trots ben daarop #}
11
11
<section>
12
12
<p>
13
13
    {% blocktranslate trimmed %}Hello! Thanks for stopping by! As I mentioned on my
14
14
    homepage, My name is Maarten. I'm a {{ age }} years old student, and I dabble in
15
15
    a lot of things that I enjoy doing.
16
16
    Some of these things I put on display here, my website, for the world to
17
17
    see!<br>
18
18
    On this page, I talk a bit about myself, my daily routine, what I do, my
19
19
    view on life, ...
20
20
    It's not all-encompassing, and I've narrowed it down quite a bit to the most
21
21
    important things. I share more about me (and other interesting things) on 
22
22
    <a href="{% url 'blog-index' %}">my blog</a>, so be sure to check that out
23
23
    as well!
24
24
    {% endblocktranslate %}
25
25
</p>
26
26
27
27
<h3 id="kodumuli">{% translate "Hacking" %}</h3>
28
28
<p> 
29
29
    {% blocktranslate trimmed %}What I do most at work and in my spare time is
30
30
    hacking/coding. It's kind of my jam. I've 
31
31
        been working and playing with computers since I was a toddler, so it
32
32
        shouldn't come as a surprise that that became a big hobby for me.
33
33
        I'm doing a lot of other things as well, but they're either not really well
34
34
        enough developed to talk about, or too minor to mention.
35
35
    {% endblocktranslate %}
36
36
</p>
37
37
<h3 id="muziko">{% translate "Music" %}</h3>
38
38
<p>
39
39
    {% blocktranslate trimmed %}I don't like rap and pop music. I get annoyed by
40
40
        hearing most of it, so I try to avoid it. Especially recent popular songs can
41
41
        irritate me to no end, almost without exception. Luckily I don't get that much
42
42
        joy out of listening music anyway, so I don't feel like I miss out a lot.<br>
43
43
    {% endblocktranslate %}
44
44
</p>
45
45
46
46
<h3 id="manĝaĵo">{% translate "Food" %}</h3>
47
47
<p>
48
48
    {% blocktranslate trimmed %}I'm an omnivore, and eat everything that I like to eat. I like
49
49
        a variety of different things, but I heavily dislike pureed food, beans
50
50
        and peas, and complex desserts. I'll seldom turn down things like
51
51
        hamburgers, pizzas, ...<br>
52
52
        Spaghettis (and other pastas) are extremely satisfying for me to eat, because
53
53
        practically
54
54
        everyone knows how to make it, but almost every time I try someone's version,
55
55
        it's a different taste. I love how many varieties of all the pastas exist!<br>
56
56
        This is quite the opposite with fries: Only Belgians seem to know how
57
57
        fries are served properly. I've seen (and sadly, tasted) the ways fries
58
58
        are prepared abroad, and it's often an insult against our national
59
59
        pride, so much so that I avoid eating them outside of Belgium.<br>
60
60
        I enjoy Belgian fries a lot, but I am picky about them. I consider my portion
61
61
        "great" if fresh potatoes are used, they're medium sized, and well baked,
62
62
        topped off with a generous amount of (real) mayonnaise. Eating them with a
63
63
        <a href="https://en.wikipedia.org/wiki/Frikandel" target="_blank">frikandel</a>
64
64
        makes me feel like a true Belgian.<br>
65
65
        
66
66
        These days my diet is mostly vegetarian; I make an effort to restrict
67
67
        purchasing meat as much as possible. This definitely helps to reduce my
68
68
        carbon footprint. Even though vegetarian replacements are still
69
69
        incredibly expensive, I will keep buying them for the foreseeable
70
70
        future.
71
71
    {% endblocktranslate %}
72
72
</p>
73
73
74
74
<h3 id="narkotoj">{% translate "Drugs" %}</h3>
75
75
<p>
76
76
  {% blocktranslate trimmed %}I have banned recreational use of all drugs out of my life for as long as I
77
77
  can remember. This includes nicotine products and alcoholic beverages.<br>
78
78
  I do this for multiple reasons:
79
79
  <ul>
80
80
	<li>I don't believe drugs are necessary to have fun. When I'm with friends
81
81
	they may be drinking alcohol, but I enjoy my time just as much with
82
82
	  non-alcoholic drinks like sodas.</li>
83
83
	<li>Drugs are unhealthy. Most of them cause damage to organs, and can badly
84
84
        affect the body long-term. I have no desire for any of that.</li>
85
85
	<li>For social purposes, it's always easy that I am the person that's
86
86
	sober. This can be for multiple reasons; an emergency, being the driver of
87
87
	  the evening, ...</li>
88
88
	<li>Drugs alter the user's perception of, and actions in reality. I don't
89
89
	  have any need to go through that. I enjoy being sober.</li>
90
90
  </ul>
91
91
  That being said, I do see why people enjoy them, and I've read about how
92
92
  cannabis is sometimes used for medical purposes (which I would do as well
93
93
  should I need it, since that's not recreational), so I don't oppose to others
94
94
  using them, nor do I refrain from buying them if I know they will be consumed
95
95
  in moderation. I do oppose to usage that inflicts harm to others, or in
96
96
  general, forces other people to use it as well in a passive way.{% endblocktranslate %}
97
97
</p>
98
98
99
99
100
100
<h3 id="studoj">{% translate "Studies &amp; work" %}</h3>
101
101
<p>
102
102
    {% blocktranslate trimmed %}I hold an undergraduate Informatics degree from Hasselt University.
103
103
    (coloquially named UHasselt), and a graduate degree of Scientific
104
104
    Engineering Informatics from Ghent University, specialisation Artificial
105
105
    Intelligence.<br>
106
106
    Currently I'm employed as a doctorate researcher at the University of
107
107
    Antwerp. I chose this because I want to keep learning about informatics as
108
108
    much as possible, and researching it at a university is the best way to do
109
109
    that.
110
110
    {% endblocktranslate %}
111
111
</p>
112
112
<p>
113
113
  {% blocktranslate trimmed %}I cycle approximately 13 kilometres per day, because I use my
114
114
  bicycle to commute to work. I also use my bicycle for getting around in
115
115
  general. That way, I can combine my need for transport with my need to sport.
116
116
  This saves me a lot of time, because I don't have to spend it with going to a
117
117
  gym.
118
118
  {% endblocktranslate %}
119
119
</p>
120
120
<h3 id="politics">{% translate "Politics" %}</h3>
121
121
    {% blocktranslate trimmed %}I keep myself informed about political subjects that
122
122
    interest me. A list of some subjects I follow with hightened attention:
123
123
    <ul>
124
124
        <li>Law enforcement</li>
125
125
        <li>Public transport</li>
126
126
        <li>Climate mayhem</li>
127
127
        <li>Freedom and privacy</li>
128
128
        <li>Human rights</li>
129
129
        <li>Digital agenda</li>
130
130
        <li>Copyright abuse &amp; reform</li>
131
131
        <li>Belgian communautarian debate</li>
132
132
        <li>Governmental &amp; corporate accountability</li>
133
133
    </ul>
134
134
    I also hold opinions on many issues, which I believe to be rational (but
135
135
    who doesn't, right?), but I don't feel attached to a political orientation, nor do I
136
136
    change my viewpoint to better align with one. I will say that <em>in
137
137
    general</em> I tend to lean towards ideas that ecological parties and pirate
138
138
    parties often espouse. But again, my opinions might differ
139
139
    drastically. Do ask me if you would like to know more, I'm all for
140
140
    explaining.{% endblocktranslate %}
141
141
</p>
142
142
143
143
<h3 id="computing">{% translate "How I do my computing" %}</h3>
144
144
<p>
145
145
    {% blocktranslate trimmed %}It's what I do most, so for those interested, I
146
146
    figured I'd talk about how I do the things with computers =3{% endblocktranslate %}
147
147
</p>
148
148
<p>
149
149
    {% blocktranslate trimmed %}I have a reliable computer that I built myself, a
150
150
    companion laptop through Hasselt University, and a work laptop from the
151
151
    University of Antwerp. Both run
152
152
    <a href="https://archlinux.org" target="_blank">Arch</a>,
153
153
    the best
154
154
    <a href="https://GNU.org" target="_blank">GNU</a> distro out there.
155
155
    I do almost all my stuff in
156
156
    <a href="https://www.gnu.org/software/emacs/" target="_blank">GNU Emacs</a>, like
157
157
    programming, maintaining my diary, working, and system maitenance. 
158
158
    I sometimes also use
159
159
    <a  href="https://neovim.io" target="_blank">NeoVim</a>.
160
160
    &gt;80% of my work is text
161
161
    related, and terminals are just better at that than a fully fledged desktop
162
162
    environment.<br>
163
163
    Languages I prefer are
164
164
    <a href="https://en.wikipedia.org/wiki/C_%28programming_language%29" target="_blank">C</a>,
165
165
    <a href="https://www.python.org/" target="_blank">Python</a>,
166
166
    <a href="https://clojure.org" target="_blank">Clojure</a>,
167
167
    and (my current favourite)
168
168
    <a href="https://haskell.org" target="_blank">Haskell</a>. I'm still
169
169
    learning how to fully use the latter one, which is a very exicting journey.
170
170
    It almost feels like learning to program for the second time!<br>
171
171
    I run
172
172
    <a href="https://lineageos.org/" target="_blank">Lineage OS</a>
173
173
    on my phone (In laymen terms: It's basically
174
174
    a cool and slim Android/Linux version with next to no Google interference).<br>
175
175
    Code repositories are always
176
176
    <a href="https://git-scm.com/" target="_blank">Git</a>
177
177
    repos, no exceptions. Depending on
178
178
    the project size, I use a simple dependency listing, or a recognized project
179
179
    manager like
180
180
    <a href="https://leiningen.org/" target="_blank">Leiningen</a>,
181
181
    <a href="https://STACKLINK.org/" target="_blank">Stack</a>
182
182
    or
183
183
    <a href="http://doc.crates.io/" target="_blank">Cargo</a>.
184
184
    {% endblocktranslate %}
185
185
</p>
186
186
<h4 id="retejo">{% translate "My website" %}</h4>
187
187
<p>
188
188
    {% blocktranslate trimmed %}
189
189
    My web server runs on
190
190
    <a href="https://nginx.com" target="_blank">Nginx</a>with an enabled QUIC
191
191
    module.
192
192
    The website itself is built using 
193
193
    <a href="https://djangoproject.com" target="_blank">Django</a>, a Python
194
194
    web framework that's extremely well written. Data is stored in a PostgreSQL
195
195
    database. On that amazing foundation, I've been
196
196
    able to build a very strong and secure website that's 100% mine.
197
197
    {% endblocktranslate %}
198
198
</p>
199
199
<p>
200
200
    {% blocktranslate trimmed %}I take pride in how I present my website, since
201
201
    I do so by only using the best practices, of which a lot have been forgotten by
202
202
    other web developers, even in university courses: The most noteworthy aspect
203
203
    of that is that I do not use any JavaScript in my
204
204
    website: A cornerstone of good web
205
205
    design is that your website ought to retain its functionality even if
206
206
    JavaScript is not available. I go one step further than that, and don't
207
207
    write JavaScript at all! This way, I can show the world by example that
208
208
    you <em>can</em> create nice-looking, interactive, responsive and fast
209
209
    websites for
210
210
    both desktop computers and phones without having to resort to JS.<br>
211
211
    Compare that to other websites that, once you visit them, are caught
212
212
    with their pants on their knees and a sad line of text on the upper
213
213
    left corner (if anything is shown at all) á la “Please enable
214
214
    JavaScript for our web application”, which actually means: “We're so bad at making
215
215
    websites we can't even show you some basic text and images without client-side
216
216
    scripting, yet we're so full of it we think
217
217
    our garbage qualifies for the word 'application'.” How pathetic!
218
218
    {% endblocktranslate %}
219
219
</p>
220
220
<p>
221
221
    {% blocktranslate trimmed %}I regularly add new texts to my website, or do general
222
222
    maitenance. I try to extract time where I can, but maintaining a website
223
223
    (and doing it well) is not an easy job. 
224
224
    Nevertheless, if I find a free spot somewhere, I might very well be updating
225
225
    my website. It's satisfying work to see my own place grow under my
226
226
    fingertips, albeit slower than I want it to.<br>
227
227
    Sometimes, it might seem I've not been doing anything on my website for a
228
228
    while. This might indicate real-life obligations, but might also be
229
229
    invisible changes to the source code, which are just as important as
230
230
    anything else I do around here. 
231
231
    {% endblocktranslate %}
232
232
</p>
233
233
<p>
234
234
    {% blocktranslate trimmed %}
235
235
    I try to make my website available in multiple languages, more specifically
236
236
    in those languages that I feel comfortable enough with to translate myself.
237
237
    To this end, I use a translator program that can translate from and to more
238
238
    than 100 languages. The core of that program is made up of 
239
239
    <a href="https://apertium.org" target="_blank">Apertium</a> and the 
240
240
    <a href="link naar paper" target="_blank">M2M-100</a> neural translator
241
241
    model.
242
242
    Both of these are free/libre software, and can operate without any
243
243
    internet connection, so I highly recommend both projects for your (digital)
244
244
    translation tasks.<br>
245
245
246
246
    I refuse to use any
247
247
    <a href="https://www.gnu.org/philosophy/who-does-that-server-really-serve.html"
248
248
    target="_blank"><abbr title="Service as a Software
249
249
        Substitute">SaaSS</abbr></a> (especially if made by
250
250
    <a href="https://stallman.org/google.html" target="_blank">Google</a>),
251
251
    which means I won't use Google Translate (or any other SaaSS), because these
252
252
    services are made to take away digital independence (i.e. freedom) from the people, in the
253
253
    same way that proprietary software tries to embed digital dependence in our society.<br>
254
254
255
255
    While machine translators lack the quality of a human translator, that's no
256
256
    problem for me: I only use my program to do the "bulk translations", which are very
257
257
    tedious and can take
258
258
    up months of my time, time that I simply don't have. After those translations
259
259
    are made, I go over them manually to fix all the remaining mistakes, and add
260
260
    the missing details and contextual nuances (if necessary) that machine
261
261
    translators have a lot of trouble with. That is how I'm able to maintain
262
262
    so many different translations of my website on my own.
263
263
    {% endblocktranslate %}
264
264
</p>
265
265
266
266
<p>
267
267
    {% blocktranslate trimmed %}I use Esperanto for hyperlinks, because I want my web
268
268
    pages to be navigated in a language-agnostic way, and in those cases, a
269
269
    politically neutral, international language is best.{% endblocktranslate %}
270
270
</p>
271
271
272
272
<h4 id="sociaj-retejoj">{% translate "Social media" %}</h4>
273
273
<p>
274
274
    {% blocktranslate trimmed %}I do not have/use a social media account on any big platform.
275
275
    Most of these platforms (like Facebook, Instagram, Whatsapp, ...) vehemently
276
276
    violate their <s>users'</s> useds'
277
277
    privacy in order to get more profits. I will not create an account on those.
278
278
    I also hope others will follow me in this decision, as being on platforms like
279
279
    Facebook compels others to do the same. An easy way to break their power is to
280
280
    refuse being used, and additionally, this makes it easier for others to act
281
281
    similarly.{% endblocktranslate %}
282
282
</p>
283
283
284
284
<h4 id="retumili">{% translate "Browsing" %}</h4>
285
285
<p>
286
286
    {% blocktranslate trimmed %}I fully condemn the practice of tracking people's (browser)
287
287
        habits for financial gain without proper consent (and no, clicking "I agree"
288
288
        does not imply giving proper consent),
289
289
        and I refuse to tolerate it. That's why I often browse using
290
290
        <a href="https://torproject.org" target="_blank">Tor</a>
291
291
        to conceal my identity. You can do so likewise, even for practical purposes;
292
292
        the network is steadily gaining more speed because of the growing amount of
293
293
        people concerned with their privacy. Some offer Tor nodes that speed the
294
294
        network up and increase the security. If you really want to, you can also
295
295
        help by becoming a <strong>non</strong>-exit node (because exit nodes
296
296
        may get blocked by some websites, I don't recommend doing that 
297
297
        unless you know what you're doing).
298
298
    {% endblocktranslate %}
299
299
</p>
300
300
<p id="kontrareklamo">
301
301
    {% blocktranslate trimmed %}I normally would not use an adblocker to browse the web. As much as I
302
302
    resent the use of advertisements, I understand that keeping a website up
303
303
    costs money, and advertising is an easy way to fund that, a practice of which traces
304
304
    can be found back until the Roman empire. Because their existence is not
305
305
    harmful to society either (they're merely annoying), I see no valid ethical objection to an
306
306
    advertisement on a website. I also don't oppose the
307
307
    use of adblockers by others: I think people have a right to decide whether they
308
308
    want to see ads or not.<br>
309
309
    However, I do use
310
310
    <a href="https://noscript.net" target="_blank">NoScript</a>,
311
311
    which is a <em>script blocker</em>. It helps me stay anonymous on the
312
312
    internet by blocking (mostly client side) scripts that may reveal my
313
313
    identity.<br>
314
314
    Unfortunately, a lot of websites have started using tracking scripts to
315
315
    trace what I see, what I do, what I surf to on the internet, and use that
316
316
    for advertising, profiling, and identifying me, which is ethically wrong.
317
317
    Because I oppose this practice, I go one
318
318
    step further by using <a href="https://adnauseam.io">AdNauseam</a>, which goes beyond simply
319
319
    blocking spyware-like advertising, but also randomly clicks on the ads in the
320
320
    background, which causes the advertiser to pay for a worthless
321
321
    advertisement, while at the same time 
322
322
    <a href="https://ceur-ws.org/Vol-1873/IWPE17_paper_23.pdf">obfuscates the data obtained by Google</a>,
323
-
    <a href="https://rednoise.org/AdNauseamVsGoogle.pdf">making it decrease in value</a>.
+
323
    <a href="https://rednoise.org/AdNauseamVsGoogle.pdf">making it decrease in value</a>.
324
324
    This is a zero-effort way for me (and you!) to
325
325
    legally rebel against an unjust system that violates our privacy for profit,
326
326
    and you get an ad-free experience in return! If there's anything I'd want
327
327
    you to remember from this entire page, is that you should install AdNauseam right
328
328
    now. Really, do it now! Do it 
329
329
    <a href="https://github.com/dhowe/AdNauseam/wiki/Install-AdNauseam-on-Chromium-based-browsers#install-adnauseam">on Chrome!</a>
330
330
    Do it 
331
331
    <a href="https://microsoftedge.microsoft.com/addons/detail/adnauseam/mlojlfildnehdpnlmpkeiiglhhkofhpb">on Edge!</a>
332
332
    Do it 
333
333
    <a href="https://addons.mozilla.org/en-US/firefox/addon/adnauseam/">on Firefox!</a>
334
334
    Do it 
335
335
    <a href="https://addons.opera.com/en/extensions/details/adnauseam-2/">on Opera!</a>
336
336
    <strong>Just do it!</strong>{% endblocktranslate %}
337
337
</p>
338
338
339
339
<h4 id="libera-programaro">{% translate "Free software" %}</h4>
340
340
<p>
341
341
    {% blocktranslate trimmed %}I am a very strong supporter of the free/libre software
342
342
    movement and organizations that battle to preserve our computing freedom,
343
343
    which I regard as a human right. I go out of my
344
344
    way to find replacements for any proprietary software, and have a high
345
345
    tolerance for practical ease of use I'm willing to sacrifice.<br>
346
346
    Very seldom, I use Windows (often in an emulated environment) for some
347
-
    programs that I need to 
348
-
    run for my university courses, as annoying and terrible I might find that.<br>
+
347
    run for my university courses, as annoying and terrible I might find that.<br>
349
348
350
349
    I also voluntarily help people move from using proprietary software to free
351
350
    software. I feel responsible for doing so, because I'm an informatician, and
352
351
    not many people understand these subjects well.
353
352
    If you want to try it (on your own), you can find a lot of GNU/Linux distros on the
354
353
    internet that are pretty easy for novice free/libre software users. You can
355
354
    also install them alongside an existing operating system, giving you the
356
355
    chance to make an easy transition to computing freedom (which I admit, is
357
356
    difficult when you're not used to it). For your freedom's sake, I implore
358
357
    you to give it a shot too.{% endblocktranslate %}
359
358
</p>
360
359
361
360
<h4 id="kulturo">{% translate "Cultural works" %}</h4>
362
361
<p>
363
362
    {% blocktranslate trimmed %}Although I avoid proprietary software, I take a mild
364
363
    approach to proprietary video games. This is because games
365
364
    serve a cultural/entertainment purpose, not a general/functional
366
365
    purpose. They're a form of art, so to speak. That's a fundamental
367
366
    difference from other types of software, and that reflects in how I
368
367
    experience the (lack of) freedom in games.
369
368
370
369
    I do draw the line with
371
370
    <a href="https://www.gnu.org/proprietary/malware-games.html" target="_blank">games that
372
371
    are distributed with malware</a>, most often taking the form of
373
372
    <a
374
373
    href="https://www.defectivebydesign.org/what_is_drm_digital_restrictions_management"
375
374
    target="_blank">intrusive DRM</a>.
376
375
377
376
    <br>
378
377
    However, I still think that games also ought to be free software, because
379
378
    that would also make them free cultural works.
380
379
    Proprietary games can get
381
380
    lost because of technical changes (ranging from instruction set architecture
382
381
    to a specific high-level library or simply the DRM), making them unplayable
383
382
    as time goes on.
384
383
    {% endblocktranslate %}
385
384
</p>
386
385
387
386
     
388
387
</section>
389
388
{% endblock main %}
390
389

templates/about/verlanglijst.djhtml

1 addition and 1 deletion.

View changes Hide changes
1
1
{% load i18n %}
2
2
{% load static %}
3
3
{% get_language_info for LANGUAGE_CODE as lang %}
4
4
5
5
{# NOG TOEVOEGEN:
6
6
https://www.demorgen.be/nieuws/filip-dewinter-wordt-cafebaas-in-kroeg-waar-collaborateurs-nog-aan-de-muur-hangen-je-ziet-hier-ook-de-zwarte-bladzijden-van-de-vlaamse-beweging~bcffd103/?fbclid=IwAR2lASmVssh_oW458oOzJOnJyvy3jDm_2-Uj0Q1jcyr9iztGbQfSfaTphgw&referrer=https%3A%2F%2Fold.reddit.com%2Fr%2Fbelgium%2Fcomments%2Fok1qm9%2Ffilip_dewinter_wordt_caf%25C3%25A9baas_in_kroeg_waar%2F #} 
7
7
{# TEKST OP ANDER BESTAND #}
8
8
9
9
{% block stylesheets %}
10
10
    {{ block.super }}
11
11
    <!-- NOTE: This is a temporary stylesheet for this page, until I've added
12
12
    the table stylesheet to Material3.-->
13
13
    <style>
14
14
    div.purchased {
15
15
        border-color: red;
16
16
        border-style: dashed;
17
17
        border-width: 2em;
18
18
    }
19
19
        </style>
20
20
        {% endblock stylesheets %}
21
21
{% block title %}{% translate "Activism" %}{% endblock title %}
22
22
{% block description %}{% blocktranslate trimmed %}For the greater good. Find out about some interesting things to better the world as we all know it.{% endblocktranslate %}
23
23
{% endblock description %}
24
24
{% block main %}
25
25
<section class="emphasis">
26
26
<h3>Lees eerst even dit:</h3>
27
27
<p>Elke keer als mensen aan mij vragen wat ik wil hebben, gebiedt de eerlijkheid
28
28
mij te antwoorden met “geluk en gezondheid”, maar blijkbaar is dat niet waar de
29
29
meesten op doelen. Neen, men wilt weten welke materiële dingen ik verlang.
30
30
</p>
31
31
<p>En die vraag komt altijd als een verassing, zelfs in aanloop naar Kerstmis.
32
32
Materieel bezit doet mij erg weinig en het kan makkelijk een week duren
33
33
vooraleer ik met één goed idee op de proppen kom.
34
34
Maar ik ben geen eremiet en heb ook af en toe wel gewoon iets nodig om mijn
35
35
leven zijn gang te laten gaan.
36
36
</p>
37
37
<p>Voor zij die op zoek zijn naar iets waar ze mij en/of Jonathan een plezier
38
38
mee kunnen doen: Ge zijt op het juiste adres, figuurlijk en letterlijk. Op deze
39
39
pagina lijsten wij samen doorheen het jaar allerlei dingen op die gekocht kunnen
40
40
worden. Ze zijn gesorteerd op prijs om het gemakkelijk te maken voor u.<br>
41
41
Om te voorkomen dat iets dubbel gekocht wordt: <strong>Als ge iets ziet dat gij
42
42
gaat kopen, klik dan op de knop “Ik koop dat” zodat het voor anderen
43
43
uit de lijst gehaald wordt!</strong> Dat 'iets' wordt dan als dusdanig
44
44
aangemerkt en kan dan niet meer door anderen gekozen worden.<br>
45
45
Merk ook op dat ik niet naar een naam of zo vraag; ik weet dus niet wie het is
46
46
die iets voor mij zal kopen en ik krijg hier ook geen melding van. Zo zal het
47
47
ook zeker een verrassing blijven!
48
48
</p>
49
49
<p>Mogen wij u ook <strong>met aandrang</strong> vragen om NOOIT (en al
50
50
<em>zeker niet voor ons</em>) iets bij Amazon te kopen: Amazon is één van 's
51
51
werelds slechtste bedrijven waar mensenrechten met de voeten getreden worden,
52
52
van de privacy van klanten tot en met arbeidsrechten van werknemers en alles
53
53
daartussenin. Voor een steeds verder aangevulde lijst van wanpraktijken kunt u
54
54
<a href="https://stallman.org/amazon.html">hier</a> klikken. Serieus, als ge het
55
55
nergens anders dan op Amazon kunt vinden, dan hebben wij VEEL liever dat ge
56
56
gewoon niks
57
57
koopt voor mij/ons dan dat ge aan dat bedrijf geld geeft, en dan zegt dat mijn
58
58
uitleg hier u overtuigd heeft om dat te doen. Wij boycotten Amazon
59
59
en het laatste wat wij willen is dat mensen door maatschappelijke druk om
60
60
geschenken te geven geld gespendeerd wordt aan dat bedrijf.
61
-
</p>
+
61
</p>
62
62
<p>Moest ge nog vragen hebben, aarzel niet om mij te contacteren via mijn
63
63
GSM-nummer of 
64
64
het contactformulier op <a href="https://maartenv.be">mijn startpagina</a>.
65
65
</p>
66
66
</section>
67
67
68
68
<section>
69
69
    {% for product in products %}
70
70
71
71
    {% if address == product.purchaser %}
72
72
    <div class="purchased">
73
73
    {% endif %}
74
74
75
75
    <h3 id="{{ product.id }}">{{ product.name }} (~ €{{ product.price }})</h3>
76
76
    {% if product.picture %}
77
77
    <img src="{{ product.image }}">
78
78
    {% endif %}
79
79
    <dl>
80
80
        {% if product.url %}
81
81
            <dt>URL<dt>
82
82
            <dd><a href="{{ product.url }}">{{ product.url }}</a></dd>
83
83
        {% endif %}
84
84
        {% if product.isbn %}
85
85
            <dt>ISBN<dt>
86
86
            <dd>{{ product.isbn_pretty }}</dd>
87
87
        {% endif %}
88
88
        <dt>Voor Jonathan?</dt>
89
89
            <dd>
90
90
    </dl>
91
91
    {% if product.extra_info %}
92
92
        <p>{{ product.extra_info|maakurlsaan }}</p>
93
93
    {% endif %}
94
94
95
95
    <form method="POST" action="#{{ product.id }}">
96
96
        <input type="hidden" name="product_id" value="{{ product.id }}">
97
97
        <input type="submit" value="Ik ga dit kopen">
98
98
    </form>
99
99
100
100
    {% if address == product.purchaser %}
101
101
    </div>
102
102
    {% endif %}
103
103
    {% endfor %}
104
104
</section>
105
105
106
106
{% endblock main %}
107
107

views.py

1 addition and 1 deletion.

View changes Hide changes
1
1
import requests  # For direct communication with me
2
2
from datetime import date
3
3
from django.utils import timezone
4
4
from django.shortcuts import get_object_or_404, render # This allows to render the template with the view here. It's pretty cool and important.
5
5
from django.http import HttpResponseRedirect, HttpResponse # Why?
6
6
from django.urls import reverse # Why?
7
7
from django.utils.translation import gettext as _
8
8
from .models import *
9
9
from .forms import MessageForm
10
10
from ipware import get_client_ip
11
11
12
12
13
13
def get_age():
14
14
    """Returns my current age."""
15
15
    today = date.today()
16
16
    birthday = date(1996, 8, 28)
17
17
    age = today - birthday
18
18
    years = str(int(age.days / 365))
19
19
    return years
20
20
21
21
def footer_description():
22
22
    return _("Main pages of Maarten's website, a %(years)s year old Belgian programmer. Also an undergraduate student of Informatics @ UHasselt, and graduate student of Engineering Informatics at Ghent University.") % {'years': get_age()}
23
23
24
24
def footer_links():
25
25
    footer_links = [
26
26
        [_("Contact me"), "mailto:maarten.vangeneugden@student.uhasselt.be"],
27
27
        [_("Hasselt University"), "https://www.uhasselt.be"],
28
28
        [_("Ghent University"), "https://www.ugent.be"],
29
29
            ]
30
30
    return footer_links
31
31
32
32
# TODO: Move this stuff to the template module. This is basically a description
33
33
# of HOW to display data, but the view module is only responsible for WHAT data
34
34
# to display.
35
35
def standard_context():
36
36
    context = {
37
37
            'navbar_backArrow': True,
38
38
            'footer_title': _("Home page"),
39
39
            'footer_description': footer_description(),
40
40
            'footer_links': footer_links(),
41
41
            'stylesheet_name': "home",
42
42
            }
43
43
    return context
44
44
45
45
def get_current_status(dt = None):
46
46
    """Returns a string specifying my current state (and sometimes location).
47
47
48
48
    This function is actually based on my weekly schedule. I'd normally hook it
49
49
    up to my iCal files, but that doesn't include things like sleeping. Not to
50
50
    mention my university has a hard time following standards like "Put the
51
51
    location in the location field, not in the title of the appointment". I
52
52
    figured a simple function would do the job just as well.
53
53
54
54
    Keyword arguments:
55
55
    dt -- The datetime object of the day to check (defaults to current local time)
56
56
    """
57
57
58
58
    MONDAY = 0
59
59
    TUESDAY = 1
60
60
    WEDNESDAY = 2
61
61
    THURSDAY = 3
62
62
    FRIDAY = 4
63
63
    SATURDAY = 5
64
64
    SUNDAY = 6
65
65
66
66
    if dt is None:
67
67
        timezone.activate("Europe/Brussels")
68
68
        dt = timezone.localtime(timezone.now())
69
69
70
70
    day = dt.weekday()
71
71
    hour = dt.time().hour
72
72
    minute = dt.time().minute
73
73
74
74
    """ Note on usage of the range() function:
75
75
    range(x, y) returns a list, beginning from x, but excluding y. So if a
76
76
    course runs from 13:00 to 15:00, then y should still be 15. Why? Because
77
77
    that makes it so that 14:59 is included, but 15:00 is not. if y would be 16,
78
78
    then 15:30 would also be included.
79
79
    """
80
80
81
81
    # If nothing's returned by now, return a general response
82
82
    return _("Probably chilling a bit. Feel free to talk! ❤")
83
83
84
84
def send_message(name, ip, message):
85
85
    """ Sends a message to me if the visitor submits one on my website. """
86
86
    # First task: Retrieve the token, which mustn't be in the tracker:
87
87
    with open("token.txt", 'r') as f:
88
88
        url = f.readline()
89
89
    url += name + " (" +str(ip)+ ") stuurt:\n" + message
90
90
    
91
91
    response = requests.get(url)
92
92
    return response.status_code == 200
93
93
94
94
def contains_hyperlink(string):
95
95
    return ("https://" in string.lower() or "http://" in string.lower())
96
96
  
97
97
98
98
def add_to_bots(request):
99
99
    client_ip, is_routable = get_client_ip(request)
100
100
    if client_ip is not None:
101
101
        with open('blog/bot-ip-addresses.txt', 'a') as f:
102
102
            print("deny " + str(client_ip) + ";  # Abused contact form.", file=f)
103
103
104
104
105
105
# Views:
106
106
107
107
def index(request):
108
108
    from django.utils.translation import gettext as _
109
109
    context = standard_context()
110
110
    # First, handle possible contact
111
111
    if request.method == "POST":  # Message received
112
112
        form = MessageForm(request.POST)
113
113
        if form.is_valid():
114
114
            clean_message = form.cleaned_data
115
115
            # Bot test:
116
116
            if clean_message["provincio"].lower() not in [
117
117
                    "limburg", "limbourg",
118
118
                    "antwerpen", "anvers", "antorf", "antorff",
119
119
                    "vlaams-brabant", "brabant flamand", "flämisch-brabant",
120
120
                    "oost-vlaanderen", "flandre-orientale", "ostflandern", 
121
-
                    "west-vlaanderen", "flandre-occidentale", "westflandern",
+
121
                    "west-vlaanderen", "flandre-occidentale", "westflandern",
122
122
                    "henegouwen", "hainaut", "hennegau",
123
123
                    "luik", "liège", "lüttich",
124
124
                    "luxemburg", "luxembourg",
125
125
                    "namen", "namur", "namür",
126
126
                    "waals-brabant", "brabant wallon", "wallonisch-brabant",
127
127
                    "brussel", "bruxelles", "brüssel",
128
128
                    ]:
129
129
                context["contact_response"] = _("The province you entered (") + \
130
130
                clean_message["provincio"] + _(") was a misspelling, or is not a Belgian province. Message discarded.")
131
131
            elif "henryquorp" in clean_message["name"].lower():  # Removed the hyperlink detector, since I'm allowing that now. 
132
132
                add_to_bots(request)
133
133
            else:
134
134
                # Neutralize possible hyperlinks
135
135
                neutralized_message = clean_message["message"].replace(".", ".   ")
136
136
                client_ip, _ = get_client_ip(request)
137
137
                if send_message(clean_message["name"], str(client_ip), neutralized_message):
138
138
                    from django.utils.translation import gettext as _
139
139
                    context["contact_response"] = _("Message sent!")
140
140
                else:
141
141
                    from django.utils.translation import gettext as _
142
142
                    context["contact_response"] = _("An error occured while trying to send the message. Please try again later.")
143
143
        else:  # The submitted form data was invalid
144
144
            from django.utils.translation import gettext as _
145
145
            context["contact_response"] = _("The submitted form contained invalid data, and was discarded.")
146
146
        
147
147
148
148
    
149
149
    timezone.activate("Europe/Brussels")
150
150
    time_string = timezone.localtime(timezone.now()).strftime(" (%H:%M) ")
151
151
    #status = _("Current status/location:") + time_string + get_current_status()
152
152
    template = "about/index.djhtml"
153
153
154
154
    return render(request, template, context)
155
155
156
156
def verlanglijst(request):
157
157
    if request.method == "POST":  # Handling a reply if one is sent
158
158
        form = ProductForm(request.POST)
159
159
160
160
        product = models.Product.objects.get(id=form.id)
161
161
        product.purchaser = request.META['REMOTE_ADDR']
162
162
        if form.is_valid():
163
163
            new_comment = form.save(commit=False)
164
164
            context["comment_response"] = _("Comment succesfully submitted!")
165
165
        else:
166
166
            print("ERROR")
167
167
            print(form.errors)
168
168
            context["contact_response"] = _("An error occured while trying to submit your comment. Please try again later.")
169
169
170
170
    template = "about/verlanglijst.djhtml"
171
171
    context = {
172
172
            'js': models.Product.objects.filter(jonathan=True,maarten=False,purchaser=None),
173
173
            'ms': models.Product.objects.filter(jonathan=False,maarten=True,purchaser=None),
174
174
            'jms': models.Product.objects.filter(jonathan=True,maarten=True,purchaser=None),
175
175
            'boughts': models.Product.objects.exclude(purchaser=None),
176
176
            'address': request.META['REMOTE_ADDR'],
177
177
            }
178
178
    context.update(standard_context())
179
179
180
180
181
181
def myself(request):
182
182
    template = "about/about.djhtml"
183
183
184
184
    context = {
185
185
            'subject': _("Myself"),
186
186
            'navbar_title': _("Myself"),
187
187
            'age': get_age(),
188
188
            }
189
189
    context.update(standard_context())
190
190
    return render(request, template, context)
191
191
192
192
def project_archive(request):
193
193
    template = "about/project-archive.djhtml"
194
194
    context = standard_context()
195
195
    return render(request, template, context)
196
196
197
197
def activism(request):
198
198
    template = "about/activism.djhtml"
199
199
    context = standard_context()
200
200
    return render(request, template, context)
201
201
    
202
202