diff --git a/compensation/account_urls.py b/compensation/account_urls.py index d29c827b..5d9d635f 100644 --- a/compensation/account_urls.py +++ b/compensation/account_urls.py @@ -21,6 +21,8 @@ urlpatterns = [ path('/state/new', state_new_view, name='acc-new-state'), path('/action/new', action_new_view, name='acc-new-action'), path('/deadline/new', deadline_new_view, name="acc-new-deadline"), + path('/share/', share_view, name='share'), + path('/share', create_share_view, name='share-create'), # Documents path('/document/new/', new_document_view, name='acc-new-doc'), diff --git a/compensation/models.py b/compensation/models.py index 37550125..b355a428 100644 --- a/compensation/models.py +++ b/compensation/models.py @@ -22,7 +22,7 @@ from compensation.managers import CompensationStateManager, EcoAccountDeductionM from compensation.utils.quality import CompensationQualityChecker, EcoAccountQualityChecker from intervention.models import Intervention, ResponsibilityData, LegalData from konova.models import BaseObject, BaseResource, Geometry, UuidModel, AbstractDocument, \ - generate_document_file_upload_path, RecordableMixin + generate_document_file_upload_path, RecordableObject, ShareableObject from konova.settings import DEFAULT_SRID_RLP, LANIS_LINK_TEMPLATE from user.models import UserActionLogEntry @@ -311,28 +311,11 @@ class CompensationDocument(AbstractDocument): pass -class EcoAccount(AbstractCompensation, RecordableMixin): +class EcoAccount(AbstractCompensation, ShareableObject, RecordableObject): """ An eco account is a kind of 'prepaid' compensation. It can be compared to an account that already has been filled with some kind of currency. From this account one is able to deduct currency for current projects. """ - # Users having access on this object - # Not needed in regular Compensation since their access is defined by the linked intervention's access - users = models.ManyToManyField( - User, - help_text="Users having access (shared with)" - ) - - # Refers to "verzeichnen" - recorded = models.OneToOneField( - UserActionLogEntry, - on_delete=models.SET_NULL, - null=True, - blank=True, - help_text="Holds data on user and timestamp of this action", - related_name="+" - ) - deductable_surface = models.FloatField( blank=True, null=True, diff --git a/compensation/templates/compensation/detail/eco_account/includes/controls.html b/compensation/templates/compensation/detail/eco_account/includes/controls.html index 5aa9620e..f43ddebe 100644 --- a/compensation/templates/compensation/detail/eco_account/includes/controls.html +++ b/compensation/templates/compensation/detail/eco_account/includes/controls.html @@ -12,6 +12,9 @@ {% if has_access %} + {% if is_ets_member %} {% if obj.recorded %} {% if has_access %} + {% if is_ets_member %} {% if obj.recorded %}