Skip to content
Snippets Groups Projects
Verified Commit 2c92422f authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Merge branch 'master' into celery-progress

parents c74b02bc 94f66037
No related branches found
No related tags found
1 merge request!304Add universally usable progress bar for Celery tasks
Showing
with 45 additions and 20 deletions
......@@ -2,6 +2,7 @@ from typing import Any, List, Optional, Tuple
import django.apps
from django.http import HttpRequest
from django.utils.module_loading import autodiscover_modules
from dynamic_preferences.registries import preference_models
......@@ -36,6 +37,9 @@ class CoreConfig(AppConfig):
def ready(self):
super().ready()
# Autodiscover various modules defined by AlekSIS
autodiscover_modules("form_extensions", "model_extensions", "checks")
sitepreferencemodel = self.get_model("SitePreferenceModel")
personpreferencemodel = self.get_model("PersonPreferenceModel")
grouppreferencemodel = self.get_model("GroupPreferenceModel")
......
......@@ -164,17 +164,17 @@ class ExtensibleModel(models.Model, metaclass=_ExtensibleModelBase):
@classmethod
def property_(cls, func: Callable[[], Any], name: Optional[str] = None) -> None:
"""Add the passed callable as a property."""
cls._safe_add(property(func), func.__name__)
cls._safe_add(property(func), name or func.__name__)
@classmethod
def method(cls, func: Callable[[], Any], name: Optional[str] = None) -> None:
"""Add the passed callable as a method."""
cls._safe_add(func, func.__name__)
cls._safe_add(func, name or func.__name__)
@classmethod
def class_method(cls, func: Callable[[], Any], name: Optional[str] = None) -> None:
"""Add the passed callable as a classmethod."""
cls._safe_add(classmethod(func), func.__name__)
cls._safe_add(classmethod(func), name or func.__name__)
@classmethod
def field(cls, **kwargs) -> None:
......
......@@ -302,7 +302,9 @@ class Group(ExtensibleModel):
null=True,
blank=True,
)
additional_fields = models.ManyToManyField(AdditionalField, verbose_name=_("Additional fields"))
additional_fields = models.ManyToManyField(
AdditionalField, verbose_name=_("Additional fields"), blank=True
)
def get_absolute_url(self) -> str:
return reverse("group_by_id", args=[self.id])
......
......@@ -15,7 +15,7 @@
administrators:
{% endblocktrans %}
</p>
{% include "core/admins_list.html" %}
{% include "core/partials/admins_list.html" %}
</div>
</div>
</div>
......
......@@ -19,7 +19,7 @@
administrators:
{% endblocktrans %}
</p>
{% include "core/admins_list.html" %}
{% include "core/partials/admins_list.html" %}
</div>
</div>
</div>
......
......@@ -15,7 +15,7 @@
error. You can also contact them directly:
{% endblocktrans %}
</p>
{% include "core/admins_list.html" %}
{% include "core/partials/admins_list.html" %}
</div>
</div>
</div>
......
......@@ -14,7 +14,7 @@
This page is currently unavailable. If this error persists, contact your site administrators:
{% endblocktrans %}
</p>
{% include "core/admins_list.html" %}
{% include "core/partials/admins_list.html" %}
</div>
</div>
</div>
......
......@@ -7,7 +7,7 @@
<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE }}">
<head>
{% include "core/meta.html" %}
{% include "core/partials/meta.html" %}
<title>
{% block no_browser_title %}
......@@ -81,14 +81,14 @@
</li>
{% endif %}
<li class="no-padding">
{% include "core/sidenav.html" %}
{% include "core/partials/sidenav.html" %}
</li>
</ul>
</header>
<main role="main">
{% include 'core/no_person.html' %}
{% include 'core/partials/no_person.html' %}
{% if messages %}
{% for message in messages %}
......@@ -122,23 +122,23 @@
<div class="row no-margin footer-row-large">
<div class="col l6 s12 no-pad-left height-inherit">
<p class="white-text valign-bot">
{% include 'core/language_form.html' %}
{% include 'core/partials/language_form.html' %}
</p>
</div>
<div class="col xl15 l6 offset-xl01 s12 no-pad-right">
<ul class="no-margin right">
{% include "core/footer-menu.html" %}
{% include "core/partials/footer-menu.html" %}
</ul>
</div>
</div>
<div class="row no-margin footer-row-small">
<span class="white-text make-it-higher">
{% include 'core/language_form.html' %}
{% include 'core/partials/language_form.html' %}
</span>
<ul class="no-margin footer-ul">
{% include "core/footer-menu.html" %}
{% include "core/partials/footer-menu.html" %}
</ul>
</div>
</div>
......
......@@ -5,7 +5,7 @@
<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE }}">
<head>
{% include "core/meta.html" %}
{% include "core/partials/meta.html" %}
<title>
{% block no_browser_title %}
......
......@@ -11,7 +11,7 @@
<form method="post">
{% csrf_token %}
{% form form=edit_group_form %}{% endform %}
{% include "core/save_button.html" %}
{% include "core/partials/save_button.html" %}
</form>
{% endblock %}
......@@ -31,6 +31,25 @@
</p>
{% endif %}
<table>
<tr>
<th>
<i class="material-icons center" title="{% trans "Group type" %}">category</i>
</th>
<td>
{{ group.group_type }}
</td>
</tr>
<tr>
<th>
<i class="material-icons center" title="{% trans "Parent groups" %}">vertical_align_top</i>
</th>
<td>
{{ group.parent_groups.all|join:", " }}
</td>
</tr>
</table>
<h5>{% blocktrans %}Owners{% endblocktrans %}</h5>
{% render_table owners_table %}
......
......@@ -11,7 +11,7 @@
<form method="post">
{% csrf_token %}
{% form form=edit_group_type_form %}{% endform %}
{% include "core/save_button.html" %}
{% include "core/partials/save_button.html" %}
</form>
{% endblock %}
......@@ -27,7 +27,7 @@
</div>
{% endfor %}
{% include "core/announcements.html" with announcements=announcements %}
{% include "core/partials/announcements.html" with announcements=announcements %}
<div class="row" id="live_load">
{% for widget in widgets %}
......
......@@ -8,5 +8,5 @@
{% block content %}
{% get_menu "DATA_MANAGEMENT_MENU" as menu %}
{% include "core/on_page_menu.html" %}
{% include "core/partials/on_page_menu.html" %}
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment