feat: Add warning about deactivated ANs
This commit is contained in:
		@@ -139,7 +139,6 @@ class Species(models.Model):
 | 
			
		||||
        verbose_name_plural = _('Tierarten')
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class RescueOrganization(models.Model):
 | 
			
		||||
    name = models.CharField(max_length=200)
 | 
			
		||||
    trusted = models.BooleanField(default=False, verbose_name=_('Vertrauenswürdig'))
 | 
			
		||||
@@ -470,6 +469,19 @@ class AdoptionNotice(models.Model):
 | 
			
		||||
            return False
 | 
			
		||||
        return self.adoptionnoticestatus.is_active
 | 
			
		||||
 | 
			
		||||
    @property
 | 
			
		||||
    def is_disabled(self):
 | 
			
		||||
        if not hasattr(self, 'adoptionnoticestatus'):
 | 
			
		||||
            return False
 | 
			
		||||
        return self.adoptionnoticestatus.is_disabled
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @property
 | 
			
		||||
    def is_closed(self):
 | 
			
		||||
        if not hasattr(self, 'adoptionnoticestatus'):
 | 
			
		||||
            return False
 | 
			
		||||
        return self.adoptionnoticestatus.is_closed
 | 
			
		||||
 | 
			
		||||
    @property
 | 
			
		||||
    def is_disabled_unchecked(self):
 | 
			
		||||
        if not hasattr(self, 'adoptionnoticestatus'):
 | 
			
		||||
@@ -567,6 +579,14 @@ class AdoptionNoticeStatus(models.Model):
 | 
			
		||||
    def is_active(self):
 | 
			
		||||
        return self.major_status == self.ACTIVE
 | 
			
		||||
 | 
			
		||||
    @property
 | 
			
		||||
    def is_disabled(self):
 | 
			
		||||
        return self.major_status == self.DISABLED
 | 
			
		||||
 | 
			
		||||
    @property
 | 
			
		||||
    def is_closed(self):
 | 
			
		||||
        return self.major_status == self.CLOSED
 | 
			
		||||
 | 
			
		||||
    @property
 | 
			
		||||
    def is_disabled_unchecked(self):
 | 
			
		||||
        return self.major_status == self.DISABLED and self.minor_status == "unchecked"
 | 
			
		||||
 
 | 
			
		||||
@@ -25,6 +25,20 @@
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
    {% if adoption_notice.is_closed %}
 | 
			
		||||
        <article class="message is-warning">
 | 
			
		||||
            <div class="message-header">
 | 
			
		||||
                <p>{% translate 'Vermittlung deaktiviert' %}</p>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="message-body content">
 | 
			
		||||
                {% blocktranslate %}
 | 
			
		||||
                    Diese Vermittlung wurde deaktiviert. Typischerweise passiert das, wenn die Tiere erfolgreich
 | 
			
		||||
                    vermittelt wurden.
 | 
			
		||||
                    In den Kommentaren findest du ggf. mehr Informationen.
 | 
			
		||||
                {% endblocktranslate %}
 | 
			
		||||
            </div>
 | 
			
		||||
        </article>
 | 
			
		||||
    {% endif %}
 | 
			
		||||
    <div class="columns">
 | 
			
		||||
        <div class="column is-two-thirds">
 | 
			
		||||
            <!--- Title level (including action dropdown) -->
 | 
			
		||||
@@ -99,7 +113,8 @@
 | 
			
		||||
                                            <i class="fas fa-plus fa-fw"
 | 
			
		||||
                                               aria-hidden="true"></i> {% trans 'Tier hinzufügen' %}
 | 
			
		||||
                                        </a>
 | 
			
		||||
                                        <a class="dropdown-item" href="{% url 'adoption-notice-close' adoption_notice_id=adoption_notice.pk%}">
 | 
			
		||||
                                        <a class="dropdown-item"
 | 
			
		||||
                                           href="{% url 'adoption-notice-close' adoption_notice_id=adoption_notice.pk %}">
 | 
			
		||||
                                            <i class="fas fa-circle-xmark fa-fw"
 | 
			
		||||
                                               aria-hidden="true"></i> {% trans 'Deaktivieren' %}
 | 
			
		||||
                                        </a>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user