Skip to content

Commit

Permalink
Merge branch 'release/0.3.70' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Jan 25, 2024
2 parents d0cb165 + 9ad19bf commit cff2020
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
12 changes: 8 additions & 4 deletions edc_adverse_event/modeladmin_mixins/death_report_admin_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.contrib import admin
from django.contrib.admin import display
from django.template.loader import render_to_string
from django.urls import reverse
from django.urls import NoReverseMatch, reverse
from django_audit_fields.admin import audit_fieldset_tuple
from edc_action_item import action_fieldset_tuple
from edc_action_item.modeladmin_mixins import ActionItemModelAdminMixin
Expand Down Expand Up @@ -167,11 +167,15 @@ def ae_button(self, obj):

@display(description="TMG")
def tmg_button(self, obj):
try:
changelist_url = reverse(
f"{self.admin_site.name}:{obj._meta.app_label}_deathreporttmg_changelist"
)
except NoReverseMatch:
changelist_url = None
context = dict(
subject_identifier=obj.subject_identifier,
changelist_url=reverse(
f"{self.admin_site.name}:{obj._meta.app_label}_deathreporttmg_changelist"
),
changelist_url=changelist_url,
)
return render_to_string(
template_name="edc_adverse_event/tmg_button.html", context=context
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<a style="white-space: nowrap;background-color:darkgray;color: black" title="Go TMG reports" class="button" href="{{ changelist_url }}?q={{ subject_identifier }}">TMG</a>
<a style="white-space: nowrap;background-color:darkgray;color: black" {% if changelist_url %}title="Go TMG reports"{% endif %} class="button" {% if changelist_url %}href="{{ changelist_url }}?q={{ subject_identifier }}"{% else %} disabled {% endif %}>TMG</a>
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class AeListboardViewMixin(
listboard_back_url = "ae_home_url"
home_url = "ae_home_url"
listboard_panel_title = "Adverse Events: AE Initial and Follow-up Reports"
# model_wrapper_cls = ActionItemModelWrapper

listboard_template = "ae_listboard_template"
listboard_url = "ae_listboard_url"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class DeathReportListboardViewMixin(
"left of the subject's identifier."
)

# model_wrapper_cls = ActionItemModelWrapper
navbar_selected_item = "ae_home"
ordering = "-report_datetime"
paginate_by = 25
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class TmgAeListboardViewMixin(
listboard_panel_title = "TMG: AE Reports"
listboard_view_permission_codename = "edc_adverse_event.view_tmg_listboard"

# model_wrapper_cls = TmgActionItemModelWrapper
navbar_name = get_default_navbar()
navbar_selected_item = "tmg_home"
ordering = "-report_datetime"
Expand Down
1 change: 0 additions & 1 deletion edc_adverse_event/views/tmg/death_listboard_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class DeathListboardView(
listboard_model_manager_name = "objects"
listboard_panel_title = "TMG: Death Reports"
listboard_view_permission_codename = "edc_adverse_event.view_tmg_listboard"
# model_wrapper_cls = DeathReportModelWrapper
navbar_selected_item = "tmg_home"
ordering = "-created"
paginate_by = 25
Expand Down

0 comments on commit cff2020

Please sign in to comment.