Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor changes and GDPR-button feature #689

Merged
merged 20 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
c80f7e0
urlize links in role descriptions and avoid long links to break the p…
dakaza98 Feb 21, 2022
038a2c7
Bump phonenumbers from 8.12.23 to 8.12.47 (#647)
dependabot[bot] May 2, 2022
c1a07a6
More event bugfixes (#640)
lshoravi May 2, 2022
8142513
Bump psycopg2 from 2.8.6 to 2.9.3 (#610)
dependabot[bot] May 3, 2022
2c31fa8
Bump wagtailmedia from 0.7.0 to 0.9.0 (#639)
dependabot[bot] May 3, 2022
8b152bd
change list display for applications and positions (#573)
dakaza98 May 3, 2022
e6023af
Bump requests from 2.25.1 to 2.27.1 (#652)
dependabot[bot] May 3, 2022
a2d7352
Bump rules from 3.0 to 3.3 (#651)
dependabot[bot] May 3, 2022
bc3936d
Bump djangorestframework from 3.12.4 to 3.13.1 (#653)
dependabot[bot] May 3, 2022
efa0c44
Bump django-libsass from 0.8 to 0.9 (#654)
dependabot[bot] May 3, 2022
d6edd14
Bump phonenumbers from 8.12.47 to 8.12.48 (#656)
dependabot[bot] May 9, 2022
e9b53b1
Bump sentry-sdk from 1.1.0 to 1.5.11 (#655)
dependabot[bot] May 9, 2022
17068c2
Feat/gdpr button (#687)
Plastpase123 Nov 10, 2022
be6e727
Merge branch 'master' of https://github.com/UTNkar/moore into develop…
Marmingen Nov 11, 2022
858c421
Merge branch 'development' of https://github.com/UTNkar/moore into de…
Marmingen Nov 11, 2022
21c7ca4
Merge branch 'master' into development
Marmingen Nov 11, 2022
b6e0e11
Update CHANGELOG.md
Marmingen Nov 11, 2022
b8f1235
Changelog updated
Marmingen Nov 11, 2022
ebbd624
Merge branch 'development' of https://github.com/UTNkar/moore into de…
Marmingen Nov 11, 2022
6dabfa7
Update README.md
Marmingen Nov 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [3.1.0] - 2022-11-11
- Changed list display for applications and positions [#573](https://github.com/UTNkar/moore/pull/573)
- Fix urlize links in role descriptions and avoid long links to break the page [#638](https://github.com/UTNkar/moore/pull/638)
- Added feature gdpr-button [#678](https://github.com/UTNkar/moore/pull/687)
- Bugfixes [#640](https://github.com/UTNkar/moore/pull/640)
- Bump psycopg2 from 2.8.6 to 2.9.3 [#610](https://github.com/UTNkar/moore/pull/610)
- Bump wagtailmedia from 0.7.0 to 0.9.0 [#639](https://github.com/UTNkar/moore/pull/639)
- Bump phonenumbers from 8.12.23 to 8.12.47 [#47](https://github.com/UTNkar/moore/pull/647)
- Bump rules from 3.0 to 3.3 [#651](https://github.com/UTNkar/moore/pull/651)
- Bump requests from 2.25.1 to 2.27.1 [#652](https://github.com/UTNkar/moore/pull/652)
- Bump djangorestframework from 3.12.4 to 3.13.1 [#653](https://github.com/UTNkar/moore/pull/653)
- Bump django-libsass from 0.8 to 0.9 [#654](https://github.com/UTNkar/moore/pull/654)
- Bump sentry-sdk from 1.1.0 to 1.5.11 [#655](https://github.com/UTNkar/moore/pull/655)
- Bump phonenumbers from 8.12.47 to 8.12.48 [#656](https://github.com/UTNkar/moore/pull/656)

## [3.0.5] - 2022-01-26
- Buggfixes [#613](https://github.com/UTNkar/moore/pull/613),[#624](https://github.com/UTNkar/moore/pull/624),[#625](https://github.com/UTNkar/moore/pull/625), [#627](https://github.com/UTNkar/moore/pull/627).
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ Using and developing it is a bit special so it has some separate instructions wh

## License

[AGPL-v2.0](LICENSE), unless a different, usually external, license is provided within a folder or file.
[AGPL-v3.0](LICENSE), unless a different, usually external, license is provided within a folder or file.
16 changes: 8 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@ wagtail==2.13


# External Libraries
requests==2.25.1
requests==2.27.1

# Templates
django-compressor==2.4.1
django-libsass==0.8
django-libsass==0.9
wagtailfontawesome==1.2.1

# Scheduled tasks
django-kronos==1.0

# User management
rules==3.0
rules==3.3
django-simple-email-confirmation==0.70

# Logging
sentry-sdk==1.1.0
sentry-sdk==1.5.11

# Postgres
psycopg2==2.8.6
psycopg2==2.9.3

# Phonenumber validation
phonenumbers==8.12.23
phonenumbers==8.12.48

# Wagtail media module
wagtailmedia==0.7.0
wagtailmedia==0.9.0

djangorestframework==3.12.4
djangorestframework==3.13.1

# Recaptcha for wagtail form pages
wagtail-django-recaptcha==1.0
Expand Down
11 changes: 11 additions & 0 deletions src/events/blocks/event_list_block.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django.utils.translation import gettext_lazy as _
from wagtail.snippets.blocks import SnippetChooserBlock
from wagtail.core import blocks
from events.models import Ticket


class EventBlock(SnippetChooserBlock):
Expand All @@ -19,6 +20,16 @@ class Meta:
class EventListBlock(blocks.StructBlock):
events = blocks.ListBlock(EventBlock)

def get_context(self, value, parent_context=None):
ctx = super().get_context(value, parent_context=parent_context)

for event in ctx['self']['events']:
event.user_has_ticket = Ticket.objects.filter(
owner=ctx['user'], event=event
).exists()

return ctx

class Meta:
label = _('Event list')
icon = 'fa-ticket'
Expand Down
18 changes: 18 additions & 0 deletions src/events/migrations/0005_event_raffle_has_been_held.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.3 on 2022-02-10 17:00

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('events', '0004_auto_20220120_1936'),
]

operations = [
migrations.AddField(
model_name='event',
name='raffle_has_been_held',
field=models.BooleanField(default=False, help_text='This signals to users whether a raffle has been held. This field populates automatically once a raffle has been held.', verbose_name='Raffle has been held'),
),
]
18 changes: 18 additions & 0 deletions src/events/migrations/0006_alter_event_raffle_has_been_held.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.3 on 2022-11-10 16:54

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('events', '0005_event_raffle_has_been_held'),
]

operations = [
migrations.AlterField(
model_name='event',
name='raffle_has_been_held',
field=models.BooleanField(default=False, help_text='This signals to users whether a raffle has been held. This field populates automatically once a raffle has been held.', verbose_name='Raffle has been held'),
),
]
9 changes: 9 additions & 0 deletions src/events/models/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ class Event(models.Model):
help_text=_('Email address for who to contact regarding this event.')
)

raffle_has_been_held = models.BooleanField(
default=False,
verbose_name=_('Raffle has been held'),
help_text=_('This signals to users whether a raffle has been held. '
'This field populates automatically once a '
' raffle has been held.')
)

class Meta:
verbose_name = _('event')
verbose_name_plural = _('events')
Expand Down Expand Up @@ -172,6 +180,7 @@ def __str__(self) -> str:
]),
FieldPanel('contact_email'),
FieldPanel('published'),
FieldPanel('raffle_has_been_held'),
])
]

Expand Down
16 changes: 14 additions & 2 deletions src/events/models/ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
from django.utils.translation import gettext_lazy as _
from wagtail.admin.edit_handlers import FieldPanel
import events.models as event_models
from members.models import Member


class OwnerFieldPanel(FieldPanel):
def on_form_bound(self):
choices = self.model.get_owner_choices(self.model)
self.form.fields['owner'].queryset = choices
self.form.fields['owner'].empty_label = None
super().on_form_bound()


class Ticket(models.Model):
Expand Down Expand Up @@ -72,9 +81,12 @@ def __str__(self) -> str:
str(self.event),
)

# ------ Administrator settings ------
def get_owner_choices(self):
return Member.objects.all().order_by('email')

# ------ Administrator settings ------
panels = [
FieldPanel('owner'),
OwnerFieldPanel('owner'),
FieldPanel('event'),
FieldPanel('ticket_number'),
FieldPanel('locked'),
Expand Down
6 changes: 5 additions & 1 deletion src/events/templates/events/blocks/event.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
</div>
</div>
<div class="card-action">
<a href="{% url 'single-event-page' event.id %}">Read more and register</a>
{% if event.user_has_ticket %}
<a href="{% url 'my-ticket' event.id %}">View my entry</a>
{% else %}
<a href="{% url 'single-event-page' event.id %}">Read more and register</a>
{% endif %}
</div>
</div>
</div>
Expand Down
12 changes: 10 additions & 2 deletions src/events/templates/events/event_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ <h5>{% trans 'Please log in to apply to this event' %}</h5>
<h5>{% trans 'You have a spot for this event!' %}</h5>
<a href="{% url 'my-ticket' object.id %}" class="btn btn-primary">{% trans 'View my spot' %}</a>
{% elif already_applied %}
<h5>{% trans 'You have applied to this event. Stay tuned!' %}</h5>
{% if not object.raffle_has_been_held %}
<h5>{% trans 'You have applied to this event. Stay tuned!' %}</h5>
{% else %}
<h5>{% trans "You have applied to this event, but you haven't recieved an entry yet." %}</h5>
{% endif %}

<form method="post">
{% csrf_token %}
Expand All @@ -37,7 +41,11 @@ <h5>{% trans 'You can apply to this event.' %}</h5>
<input type="submit" value="{% trans 'Apply' %}" class="btn btn-primary">
</form>
{% else %}
<h5>{% trans 'Application date has passed.' %}</h5>
{% if object.raffle_has_been_held %}
<h5>{% trans "You don't have a ticket to this event." %}</h5>
{% else %}
<h5>{% trans 'Application date has passed.' %}</h5>
{% endif %}
{% endif %}
{% endif %}
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/events/views/admin_assign.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ def admin_assign(request, pos_id=None):
application.ticket = ticket
application.save()

event.raffle_has_been_held = True
event.save()
ticket_formset = formset(queryset=Ticket.objects.none())

view = {
Expand Down
1 change: 1 addition & 0 deletions src/events/views/ticket_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def my_ticket(request, event_pk):
instance.delete()
elif 'lock_for_payment' in request.POST:
ticket.locked = True
instance.save()
else:
cleaned_data = form.cleaned_data
instance.order = cleaned_data['order']
Expand Down
Binary file modified src/involvement/locale/sv/LC_MESSAGES/django.mo
Binary file not shown.
Loading