forked from CodingPirates/forenings_medlemmer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'CodingPirates:master' into master
- Loading branch information
Showing
40 changed files
with
1,325 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ members/static/members/css | |
.sass-cache/ | ||
public_data.zip | ||
test-screens | ||
/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# Generated by Django 3.1.1 on 2021-04-19 07:14 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("members", "0024_auto_20200902_1108"), | ||
] | ||
|
||
def add_activity_types(apps, schema_editor): | ||
ActivityType = apps.get_model("members", "activitytype") | ||
db_alias = schema_editor.connection.alias | ||
ActivityType.objects.using(db_alias).bulk_create( | ||
[ | ||
ActivityType( | ||
id="FORLØB", | ||
display_name="Forløb", | ||
description="Aktivitetsforløb med klubaftener.", | ||
), | ||
ActivityType( | ||
id="ARRANGEMENT", | ||
display_name="Arrangement", | ||
description="Endagsarrangementer eller aktivitet der ikke passer ind under forløb.", | ||
), | ||
ActivityType( | ||
id="FORENINGSMEDLEMSKAB", | ||
display_name="Foreningsmedlemskab", | ||
description="Aktiviteten gør deltageren til medlem af din lokalforening, og skal kun bruges til personer der ikke er tilmeldt et forløb.", | ||
), | ||
ActivityType( | ||
id="STØTTEMEDLEMSKAB", | ||
display_name="Støttemedlemskab", | ||
description="Mulighed for at støtte lokalforening eller landsorganisationen økonomisk uden at blive stemmeberettiget medlem.", | ||
), | ||
] | ||
) | ||
|
||
def remove_activity_types(apps, schema_editor): | ||
ActivityType = apps.get_model("members", "activitytype") | ||
db_alias = schema_editor.connection.alias | ||
ActivityType.objects.using(db_alias).filter(id="FORLØB").delete() | ||
ActivityType.objects.using(db_alias).filter(id="ARRANGEMENT").delete() | ||
ActivityType.objects.using(db_alias).filter(id="FORENINGSMEDLEMSKAB").delete() | ||
ActivityType.objects.using(db_alias).filter(id="STØTTEMEDLEMSKAB").delete() | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="ActivityType", | ||
fields=[ | ||
( | ||
"id", | ||
models.CharField( | ||
help_text="En sigende identifikator for aktivitetstypen. Fx 'STØTTEMEDLEM'.", | ||
max_length=50, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="id", | ||
), | ||
), | ||
( | ||
"display_name", | ||
models.CharField( | ||
help_text="Et visningsnavn for aktivitetstypen. Fx 'Støttemedlem'.", | ||
max_length=100, | ||
verbose_name="Navn", | ||
), | ||
), | ||
( | ||
"description", | ||
models.CharField( | ||
help_text="En beskrivelse af hvad aktivitetstypen dækker over.", | ||
max_length=200, | ||
verbose_name="Beskrivelse", | ||
), | ||
), | ||
( | ||
"updated_dtm", | ||
models.DateTimeField(auto_now=True, verbose_name="Opdateret"), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "Aktivitetstype", | ||
"verbose_name_plural": "Aktivitetstyper", | ||
"ordering": ["display_name"], | ||
}, | ||
), | ||
migrations.RunPython(add_activity_types, remove_activity_types), | ||
migrations.AddField( | ||
model_name="activity", | ||
name="activitytype", | ||
field=models.ForeignKey( | ||
default="FORLØB", | ||
help_text="Angiv typen af aktivtet. " | ||
+ "Brugere vil se Forløb og Arrangementer under Aktiviteter. " | ||
+ "Medlemskab og Støttemedlemskab vil blive vist på separate sider. " | ||
+ "Normalt vil det kun være sekretariatet der oprettet aktiviteter for medlemskaber.", | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="members.activitytype", | ||
verbose_name="Aktivitetstype", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Added to support different types of activities. | ||
# Makes is possible to filter certain activities out when showing the list to users. | ||
|
||
from django.db import models | ||
|
||
|
||
class ActivityType(models.Model): | ||
class Meta: | ||
verbose_name = "Aktivitetstype" | ||
verbose_name_plural = "Aktivitetstyper" | ||
ordering = ["display_name"] | ||
|
||
id = models.CharField( | ||
"id", | ||
primary_key=True, | ||
max_length=50, | ||
help_text="En sigende identifikator for aktivitetstypen. Fx 'STØTTEMEDLEM'.", | ||
) | ||
display_name = models.CharField( | ||
"Navn", | ||
max_length=100, | ||
help_text="Et visningsnavn for aktivitetstypen. Fx 'Støttemedlem'.", | ||
) | ||
description = models.CharField( | ||
"Beskrivelse", | ||
max_length=200, | ||
help_text="En beskrivelse af hvad aktivitetstypen dækker over.", | ||
) | ||
updated_dtm = models.DateTimeField("Opdateret", auto_now=True) | ||
|
||
def __str__(self): | ||
return self.display_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.