-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1108 from Amsterdam-Music-Lab/release/2.2.0
Release: v2.2.0
- Loading branch information
Showing
165 changed files
with
7,227 additions
and
3,871 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,25 @@ | ||
name: Database Backup Template | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
runner: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
backup: | ||
runs-on: ${{ inputs.runner }} | ||
steps: | ||
|
||
- name: Set Date | ||
id: date | ||
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV | ||
|
||
- name: Backup Database | ||
run: | | ||
podman exec muscle_db_1 sh -c "pg_dump -Fc > /backups/${{ env.DATE }}.dump" | ||
- name: Remove Old Backups (older than 7 days) | ||
run: | | ||
podman exec muscle_db_1 sh -c "find /backups -type f -name '*.dump' -mtime +7 -exec rm {} \;" |
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,13 @@ | ||
name: Schedule Database Backup | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' # Runs every night at midnight UTC | ||
workflow_dispatch: # Allows manual triggering | ||
|
||
jobs: | ||
|
||
backup-production: | ||
uses: ./.github/workflows/db-backup-template.yml | ||
with: | ||
runner: PRD |
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 |
---|---|---|
|
@@ -9,3 +9,5 @@ yarn.lock | |
tests/*.ini | ||
tests/*.log | ||
tests/__pycache__ | ||
|
||
e2e/screenshots |
Empty file.
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,105 @@ | ||
from django.contrib import admin | ||
from django.utils.html import format_html | ||
from .models import AdminInterfaceConfiguration, AdminInterfaceThemeConfiguration | ||
from .forms import AdminInterfaceConfigurationForm, AdminInterfaceThemeConfigurationForm | ||
|
||
|
||
class AdminInterfaceThemeConfigurationInline(admin.StackedInline): | ||
model = AdminInterfaceThemeConfiguration | ||
form = AdminInterfaceThemeConfigurationForm | ||
extra = 0 | ||
fields = ( | ||
# Color scheme | ||
|
||
# - Official Django colors | ||
|
||
# -- Main colors | ||
'color_primary', | ||
'color_secondary', | ||
'color_accent', | ||
'color_primary_fg', | ||
|
||
# -- Body | ||
'color_body_fg', | ||
'color_body_bg', | ||
'color_body_quiet_color', | ||
'color_body_loud_color', | ||
|
||
# -- Header | ||
'color_header_color', | ||
|
||
# -- Breadcumbs | ||
'color_breadcrumbs_fg', | ||
|
||
# -- Link | ||
'color_link_fg', | ||
'color_link_hover_color', | ||
'color_link_selected_fg', | ||
|
||
# -- Borders | ||
'color_hairline_color', | ||
'color_border_color', | ||
|
||
# -- Error | ||
'color_error_fg', | ||
|
||
# -- Message | ||
'color_message_success_bg', | ||
'color_message_warning_bg', | ||
'color_message_error_bg', | ||
|
||
# -- Darkened | ||
'color_darkened_bg', | ||
|
||
# -- Selected | ||
'color_selected_bg', | ||
'color_selected_row', | ||
|
||
# -- Button | ||
'color_button_fg', | ||
'color_button_bg', | ||
'color_button_hover_bg', | ||
'color_default_button_bg', | ||
'color_default_button_hover_bg', | ||
'color_close_button_bg', | ||
'color_close_button_hover_bg', | ||
'color_delete_button_bg', | ||
'color_delete_button_hover_bg', | ||
|
||
# Custom colors | ||
'color_default_bg', | ||
'color_default_fg', | ||
'color_success_bg', | ||
'color_success_fg', | ||
'color_warning_bg', | ||
'color_warning_fg', | ||
'color_error_bg', | ||
) | ||
|
||
|
||
class AdminInterfaceConfigurationAdmin(admin.ModelAdmin): | ||
list_display = ('name', 'description', 'theme_overview', 'active',) | ||
|
||
form = AdminInterfaceConfigurationForm | ||
inlines = [AdminInterfaceThemeConfigurationInline] | ||
|
||
def theme_overview(self, obj): | ||
theme = obj.theme if hasattr(obj, 'theme') else None | ||
|
||
if not theme: | ||
return "No theme assigned" | ||
|
||
fields = AdminInterfaceThemeConfigurationInline.fields | ||
color_fields = [f for f in fields if f.startswith('color_')] | ||
color_overview = ''.join( | ||
f'<span style="display: inline-block; width: 20px; height: 20px; background-color: {getattr(theme, f)}; margin-right: 5px;"></span>' | ||
for f in color_fields | ||
) | ||
|
||
return format_html(f'<div>{color_overview}</div>') | ||
|
||
|
||
admin.site.register( | ||
AdminInterfaceConfiguration, | ||
AdminInterfaceConfigurationAdmin, | ||
) |
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,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class AdminInterfaceConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'admin_interface' |
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,19 @@ | ||
|
||
from django import forms | ||
from .models import AdminInterfaceConfiguration | ||
|
||
|
||
class AdminInterfaceConfigurationForm(forms.ModelForm): | ||
|
||
class Meta: | ||
model = AdminInterfaceConfiguration | ||
fields = '__all__' | ||
|
||
|
||
class AdminInterfaceThemeConfigurationForm(forms.ModelForm): | ||
|
||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
|
||
for field in self.fields: | ||
self.fields[field].widget = forms.TextInput(attrs={'type': 'color'}) |
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,69 @@ | ||
# Generated by Django 3.2.25 on 2024-05-01 14:23 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='AdminInterfaceConfiguration', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(default='Default', max_length=255, unique=True)), | ||
('description', models.TextField(blank=True, default='')), | ||
('active', models.BooleanField(default=True)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='AdminInterfaceThemeConfiguration', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('color_primary', models.CharField(blank=True, default='#79aec8', max_length=255)), | ||
('color_secondary', models.CharField(blank=True, default='#417690', max_length=255)), | ||
('color_accent', models.CharField(blank=True, default='#f5dd5d', max_length=255)), | ||
('color_primary_fg', models.CharField(blank=True, default='#ffffff', max_length=255)), | ||
('color_body_fg', models.CharField(blank=True, default='#333333', max_length=255)), | ||
('color_body_bg', models.CharField(blank=True, default='#ffffff', max_length=255)), | ||
('color_body_quiet_color', models.CharField(blank=True, default='#666666', max_length=255)), | ||
('color_body_loud_color', models.CharField(blank=True, default='#000000', max_length=255)), | ||
('color_header_color', models.CharField(blank=True, default='#ffffcc', max_length=255)), | ||
('color_breadcrumbs_fg', models.CharField(blank=True, default='#c4dce8', max_length=255)), | ||
('color_link_fg', models.CharField(blank=True, default='#447e9b', max_length=255)), | ||
('color_link_hover_color', models.CharField(blank=True, default='#003366', max_length=255)), | ||
('color_link_selected_fg', models.CharField(blank=True, default='#5b80b2', max_length=255)), | ||
('color_hairline_color', models.CharField(blank=True, default='#e8e8e8', max_length=255)), | ||
('color_border_color', models.CharField(blank=True, default='#cccccc', max_length=255)), | ||
('color_error_fg', models.CharField(blank=True, default='#ba2121', max_length=255)), | ||
('color_message_success_bg', models.CharField(blank=True, default='#ddffdd', max_length=255)), | ||
('color_message_warning_bg', models.CharField(blank=True, default='#ffffcc', max_length=255)), | ||
('color_message_error_bg', models.CharField(blank=True, default='#ffefef', max_length=255)), | ||
('color_darkened_bg', models.CharField(blank=True, default='#f8f8f8', max_length=255)), | ||
('color_selected_bg', models.CharField(blank=True, default='#e4e4e4', max_length=255)), | ||
('color_selected_row', models.CharField(blank=True, default='#ffffcc', max_length=255)), | ||
('color_button_fg', models.CharField(blank=True, default='#ffffff', max_length=255)), | ||
('color_button_bg', models.CharField(blank=True, default='#79aec8', max_length=255)), | ||
('color_button_hover_bg', models.CharField(blank=True, default='#609ab6', max_length=255)), | ||
('color_default_button_bg', models.CharField(blank=True, default='#417690', max_length=255)), | ||
('color_default_button_hover_bg', models.CharField(blank=True, default='#205067', max_length=255)), | ||
('color_close_button_bg', models.CharField(blank=True, default='#888888', max_length=255)), | ||
('color_close_button_hover_bg', models.CharField(blank=True, default='#747474', max_length=255)), | ||
('color_delete_button_bg', models.CharField(blank=True, default='#ba2121', max_length=255)), | ||
('color_delete_button_hover_bg', models.CharField(blank=True, default='#a41515', max_length=255)), | ||
('color_default_bg', models.CharField(blank=True, default='#f8d7da', max_length=255)), | ||
('color_default_fg', models.CharField(blank=True, default='#721c24', max_length=255)), | ||
('color_success_bg', models.CharField(blank=True, default='#d4edda', max_length=255)), | ||
('color_success_fg', models.CharField(blank=True, default='#155724', max_length=255)), | ||
('color_warning_bg', models.CharField(blank=True, default='#fff3cd', max_length=255)), | ||
('color_warning_fg', models.CharField(blank=True, default='#856404', max_length=255)), | ||
('color_error_bg', models.CharField(blank=True, default='#f8d7da', max_length=255)), | ||
('configuration', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='theme', to='admin_interface.admininterfaceconfiguration')), | ||
], | ||
), | ||
] |
Empty file.
Oops, something went wrong.